diff --git a/THIRD-PARTY-NOTICES.TXT b/THIRD-PARTY-NOTICES.TXT index 707bd024f8f8..32e23122d71a 100644 --- a/THIRD-PARTY-NOTICES.TXT +++ b/THIRD-PARTY-NOTICES.TXT @@ -860,3 +860,28 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +License notice for vectorized sorting code +------------------------------------------ + +MIT License + +Copyright (c) 2020 Dan Shechter + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/docs/deep-dive-blog-posts.md b/docs/deep-dive-blog-posts.md index 34d0b406eb99..01278693e80e 100644 --- a/docs/deep-dive-blog-posts.md +++ b/docs/deep-dive-blog-posts.md @@ -6,6 +6,7 @@ - [Performance improvements in .NET Core 2.0](https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-core/) - [Performance improvements in .NET Core 2.1](https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-core-2-1/) - [Performance improvements in .NET Core 3.0](https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-core-3-0/) +- [Performance improvements in .NET 5](https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-5/) ### Posts that take a high-level look at the entire source: diff --git a/docs/project/list-of-obsoletions.md b/docs/project/list-of-obsoletions.md index 40e833ae20f8..6b4d3a415ef8 100644 --- a/docs/project/list-of-obsoletions.md +++ b/docs/project/list-of-obsoletions.md @@ -15,3 +15,4 @@ Currently the identifiers `MSLIB0001` through `MSLIB0999` are carved out for obs | :--------------- | :---------- | | __`MSLIB0001`__ | The UTF-7 encoding is insecure and should not be used. Consider using UTF-8 instead. | | __`MSLIB0002`__ | `PrincipalPermissionAttribute` is not honored by the runtime and must not be used. | +| __`MSLIB0003`__ | `BinaryFormatter` serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for recommended alternatives. | diff --git a/docs/workflow/trimming/feature-switches.md b/docs/workflow/trimming/feature-switches.md new file mode 100644 index 000000000000..ad911e818d7a --- /dev/null +++ b/docs/workflow/trimming/feature-switches.md @@ -0,0 +1,57 @@ +# Libraries Feature Switches + +Starting with .NET 5 there are several [feature-switches](https://github.com/dotnet/designs/blob/master/accepted/2020/feature-switch.md) available which +can be used to control the size of the final binary. They are available in all +configurations but their defaults might vary as any SDK can set the defaults differently. + +## Available Feature Switches + +| MSBuild Property Name | AppContext Setting | Description | +|-|-|-| +| DebuggerSupport | System.Diagnostics.Debugger.IsSupported | Any dependency that enables better debugging experience to be trimmed when set to false | +| EnableUnsafeUTF7Encoding | System.Text.Encoding.EnableUnsafeUTF7Encoding | Insecure UTF-7 encoding is trimmed when set to false | +| EnableUnsafeBinaryFormatterSerialization | System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization | BinaryFormatter serialization support is trimmed when set to false | +| EventSourceSupport | System.Diagnostics.Tracing.EventSource.IsSupported | Any EventSource related code or logic is trimmed when set to false | +| InvariantGlobalization | System.Globalization.Invariant | All globalization specific code and data is trimmed when set to true | +| UseSystemResourceKeys | System.Resources.UseSystemResourceKeys | Any localizable resources for system assemblies is trimmed when set to true | +| - | System.Net.Http.EnableActivityPropagation | Any dependency related to diagnostics support for System.Net.Http is trimmed when set to false | + +Any feature-switch which defines property can be set in csproj file or +on the command line as any other MSBuild property. Those without predefined property name +the value can be set with following XML tag in csproj file. + +```xml + +``` + +## Adding New Feature Switch + +The primary goal of features switches is to produce smaller output by removing code which is +unreachable under feature condition. The typical approach is to introduce static bool like +property which is used to guard the dependencies which can be trimmed when the value is flipped. +Ideally, the static property should be located in type which does not have any static constructor +logic. Once you are done with the code changes following steps connects the code with trimming +settings. + +Add XML settings for the features switch to assembly substitution. It's usually located in +`src/ILLink/ILLink.Substitutions.xml` file for each library. The example of the syntax used to control +`EnableUnsafeUTF7Encoding` property is following. + +```xml + +``` + +Add MSBuild integration by adding new RuntimeHostConfigurationOption entry. The file is located in +[Microsoft.NET.Sdk.targets](https://github.com/dotnet/sdk/blob/33ce6234e6bf45bce16f610c441679252d309189/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets#L348-L401) file and includes all +other public feature-switches. You can add a new one by simply adding a new XML tag + +```xml + +``` + +Please don't forget to update the table with available features-switches when you are done. diff --git a/eng/Analyzers.props b/eng/Analyzers.props index 8d2a67cde8e1..2c9b1c8bee44 100644 --- a/eng/Analyzers.props +++ b/eng/Analyzers.props @@ -6,7 +6,7 @@ - + diff --git a/eng/CodeAnalysis.ruleset b/eng/CodeAnalysis.ruleset index e88f8fc3bd83..42ea385a079d 100644 --- a/eng/CodeAnalysis.ruleset +++ b/eng/CodeAnalysis.ruleset @@ -122,7 +122,7 @@ - + diff --git a/eng/Configurations.props b/eng/Configurations.props index 1d6ad36e8150..aa8e9add17dd 100644 --- a/eng/Configurations.props +++ b/eng/Configurations.props @@ -31,6 +31,7 @@ .NET $(NetCoreAppCurrentVersion) net472 + WINDOWS7.0 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 46f4d5a99b09..098240ee26cb 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,63 +4,67 @@ https://github.com/dotnet/standard cfe95a23647c7de1fe1a349343115bd7720d6949 + + https://github.com/dotnet/icu + 7247fa0d9e8faee2cceee6f04856b2c447f41bca + - + https://github.com/dotnet/arcade - 243cc92161ad44c2a07464425892daee19121c99 + ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 - + https://github.com/dotnet/arcade - 243cc92161ad44c2a07464425892daee19121c99 + ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 - + https://github.com/dotnet/arcade - 243cc92161ad44c2a07464425892daee19121c99 + ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 - + https://github.com/dotnet/arcade - 243cc92161ad44c2a07464425892daee19121c99 + ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 - + https://github.com/dotnet/arcade - 243cc92161ad44c2a07464425892daee19121c99 + ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 - + https://github.com/dotnet/arcade - 243cc92161ad44c2a07464425892daee19121c99 + ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 - + https://github.com/dotnet/arcade - 243cc92161ad44c2a07464425892daee19121c99 + ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 - + https://github.com/dotnet/arcade - 243cc92161ad44c2a07464425892daee19121c99 + ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 - + https://github.com/dotnet/arcade - 243cc92161ad44c2a07464425892daee19121c99 + ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 - + https://github.com/dotnet/arcade - 243cc92161ad44c2a07464425892daee19121c99 + ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 - + https://github.com/dotnet/arcade - 243cc92161ad44c2a07464425892daee19121c99 + ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 - + https://github.com/dotnet/arcade - 243cc92161ad44c2a07464425892daee19121c99 + ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 - + https://github.com/dotnet/arcade - 243cc92161ad44c2a07464425892daee19121c99 + ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 - + https://github.com/dotnet/arcade - 243cc92161ad44c2a07464425892daee19121c99 + ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 https://dev.azure.com/dnceng/internal/_git/dotnet-optimization @@ -86,41 +90,37 @@ https://github.com/microsoft/vstest b9296fc900e2f2d717d507b4ee2a4306521796d4 - + https://github.com/dotnet/runtime-assets - 629993236116221fba87fe1de6d7893dd02c3722 + b34a70799faa67f13c2e72852e4f3af463ff4d6c - + https://github.com/dotnet/runtime-assets - 629993236116221fba87fe1de6d7893dd02c3722 + b34a70799faa67f13c2e72852e4f3af463ff4d6c - + https://github.com/dotnet/runtime-assets - 629993236116221fba87fe1de6d7893dd02c3722 + b34a70799faa67f13c2e72852e4f3af463ff4d6c - + https://github.com/dotnet/runtime-assets - 629993236116221fba87fe1de6d7893dd02c3722 + b34a70799faa67f13c2e72852e4f3af463ff4d6c - + https://github.com/dotnet/runtime-assets - 629993236116221fba87fe1de6d7893dd02c3722 + b34a70799faa67f13c2e72852e4f3af463ff4d6c - + https://github.com/dotnet/runtime-assets - 629993236116221fba87fe1de6d7893dd02c3722 + b34a70799faa67f13c2e72852e4f3af463ff4d6c - + https://github.com/dotnet/runtime-assets - 629993236116221fba87fe1de6d7893dd02c3722 + b34a70799faa67f13c2e72852e4f3af463ff4d6c - + https://github.com/dotnet/runtime-assets - 629993236116221fba87fe1de6d7893dd02c3722 - - - https://github.com/dotnet/icu - + b34a70799faa67f13c2e72852e4f3af463ff4d6c https://github.com/dotnet/llvm-project @@ -182,9 +182,9 @@ https://github.com/dotnet/runtime 0375524a91a47ca4db3ee1be548f74bab7e26e76 - + https://github.com/mono/linker - 095f30a37d740e5166d71ab2d2157c5bb2041efa + e76321851c05c5016df3d1243885c02e875b9912 https://github.com/dotnet/xharness diff --git a/eng/Versions.props b/eng/Versions.props index 1cfce994d4eb..f8c1705f7064 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -51,16 +51,16 @@ - 5.0.0-beta.20330.3 - 5.0.0-beta.20330.3 - 5.0.0-beta.20330.3 - 5.0.0-beta.20330.3 - 5.0.0-beta.20330.3 - 5.0.0-beta.20353.2 - 2.5.1-beta.20330.3 - 5.0.0-beta.20358.2 - 5.0.0-beta.20330.3 - 5.0.0-beta.20330.3 + 5.0.0-beta.20364.3 + 5.0.0-beta.20364.3 + 5.0.0-beta.20364.3 + 5.0.0-beta.20364.3 + 5.0.0-beta.20364.3 + 5.0.0-beta.20364.3 + 2.5.1-beta.20364.3 + 5.0.0-beta.20364.3 + 5.0.0-beta.20364.3 + 5.0.0-beta.20364.3 5.0.0-preview.4.20202.18 5.0.0-preview.4.20202.18 @@ -72,14 +72,14 @@ 5.0.0-preview.4.20202.18 5.0.0-alpha.1.19563.3 - 5.0.0-beta.20319.2 - 5.0.0-beta.20319.2 - 5.0.0-beta.20319.2 - 5.0.0-beta.20319.2 - 5.0.0-beta.20319.2 - 5.0.0-beta.20319.2 - 5.0.0-beta.20319.2 - 5.0.0-beta.20319.2 + 5.0.0-beta.20360.1 + 5.0.0-beta.20360.1 + 5.0.0-beta.20360.1 + 5.0.0-beta.20360.1 + 5.0.0-beta.20360.1 + 5.0.0-beta.20360.1 + 5.0.0-beta.20360.1 + 5.0.0-beta.20360.1 2.2.0-prerelease.19564.1 @@ -114,11 +114,11 @@ 12.0.3 4.12.0 - 3.0.0-preview-20200602.3 + 3.0.0-preview-20200715.1 - 5.0.0-preview.3.20360.3 + 5.0.0-preview.3.20363.5 - 5.0.0-preview.8.20359.5 + 5.0.0-preview.8.20365.1 9.0.1-alpha.1.20356.1 9.0.1-alpha.1.20356.1 @@ -144,7 +144,6 @@ Microsoft.NETCore.Targets Microsoft.NETCore.Runtime.CoreCLR Microsoft.NETCore.Runtime.ICU.Transport - true @@ -51,9 +52,9 @@ - + --> $(ArtifactsBinDir)ILLinkTrimAssembly/$(BuildSettings)/trimmed @@ -70,7 +71,7 @@ + DependsOnTargets="_CombineILLinkDescriptorsXmls;_CombineILLinkSubstitutionsXmls;_CombineILLinkLinkAttributesXmls"> @@ -84,6 +85,12 @@ + + + ILLink.LinkAttributes.xml + + + @@ -111,11 +118,11 @@ - + - @@ -152,7 +159,23 @@ - + + $(ILLinkLinkAttributesXmlIntermediatePath) + + + + + + + + + + @@ -178,14 +201,15 @@ $(ILLinkArgs) -t $(ILLinkArgs) -b true - - $(ILLinkArgs) -v true $(ILLinkArgs) --strip-descriptors false $(ILLinkArgs) -x "$(ILLinkTrimXmlLibraryBuild)" $(ILLinkArgs) --strip-substitutions false + + + $(ILLinkArgs) --strip-link-attributes false --ignore-link-attributes true $(ILLinkArgs) --skip-unresolved true @@ -235,7 +259,7 @@ <_DotNetHostFileName>dotnet <_DotNetHostFileName Condition=" '$(OS)' == 'Windows_NT' ">dotnet.exe - + - - - diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index 763b369167db..e7cd12b6a4ea 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -191,7 +191,8 @@ Include=" $(LibrariesNativeArtifactsPath)dotnet.js; $(LibrariesNativeArtifactsPath)dotnet.wasm; - $(LibrariesNativeArtifactsPath)dotnet.timezones.blat;" + $(LibrariesNativeArtifactsPath)dotnet.timezones.blat; + $(LibrariesNativeArtifactsPath)icudt.dat;" IsNative="true" /> diff --git a/eng/pipelines/common/build-coreclr-and-libraries-job.yml b/eng/pipelines/common/build-coreclr-and-libraries-job.yml index ddf5d8103cac..439d97038f84 100644 --- a/eng/pipelines/common/build-coreclr-and-libraries-job.yml +++ b/eng/pipelines/common/build-coreclr-and-libraries-job.yml @@ -11,6 +11,8 @@ parameters: stagedBuild: false variables: {} pool: '' + platform: '' + testBuildPlatforms: [] jobs: - template: /eng/pipelines/coreclr/templates/build-job.yml @@ -41,8 +43,8 @@ jobs: testGroup: ${{ parameters.testGroup }} crossrootfsDir: ${{ parameters.crossrootfsDir }} timeoutInminutes: ${{ parameters.timeoutInMinutes }} - signBinaries: ${{ parameters.signBinaries }} - stagedBuild: ${{ parameters.stagedBuild }} variables: ${{ parameters.variables }} pool: ${{ parameters.pool }} liveRuntimeBuildConfig: ${{ parameters.buildConfig }} + platform: ${{ parameters.platform }} + testBuildPlatforms: ${{ parameters.testBuildPlatforms }} diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml index 8f02954c8703..dcbba9fb3654 100644 --- a/eng/pipelines/common/global-build-job.yml +++ b/eng/pipelines/common/global-build-job.yml @@ -7,7 +7,7 @@ parameters: osSubgroup: '' container: '' crossrootfsDir: '' - variables: {} + variables: [] timeoutInMinutes: '' pool: '' condition: true @@ -54,7 +54,8 @@ jobs: ${{ if ne(parameters.isOfficialBuild, true) }}: value: '' - - ${{ parameters.variables }} + - ${{ each variable in parameters.variables }}: + - ${{ variable }} steps: - template: /eng/pipelines/common/clone-checkout-bundle-step.yml diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index bf9c4a2fc976..b4f802024006 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -22,6 +22,7 @@ parameters: # Handled as an opt-in parameter to avoid excessive yaml. passPlatforms: false jobParameters: {} + variables: [] jobs: @@ -31,6 +32,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: Linux archType: arm platform: Linux_arm @@ -54,6 +56,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: Linux archType: arm64 platform: Linux_arm64 @@ -77,6 +80,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: Linux osSubgroup: _musl archType: x64 @@ -104,6 +108,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: Linux osSubgroup: _musl archType: arm64 @@ -128,6 +133,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: Linux archType: x64 platform: Linux_x64 @@ -150,6 +156,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: Browser archType: wasm platform: Browser_wasm @@ -170,6 +177,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: FreeBSD archType: x64 platform: FreeBSD_x64 @@ -192,6 +200,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: Android archType: x64 platform: Android_x64 @@ -214,6 +223,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: Android archType: x86 platform: Android_x86 @@ -236,6 +246,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: Android archType: arm platform: Android_arm @@ -258,6 +269,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: Android archType: arm64 platform: Android_arm64 @@ -280,6 +292,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: tvOS archType: x64 platform: tvOS_x64 @@ -299,6 +312,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: tvOS archType: arm64 platform: tvOS_arm64 @@ -318,6 +332,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: iOS archType: x64 platform: iOS_x64 @@ -337,6 +352,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: iOS archType: x86 platform: iOS_x86 @@ -357,6 +373,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: iOS archType: arm platform: iOS_arm @@ -376,6 +393,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: iOS archType: arm64 platform: iOS_arm64 @@ -395,6 +413,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: OSX archType: x64 platform: OSX_x64 @@ -414,6 +433,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: Windows_NT archType: x64 platform: Windows_NT_x64 @@ -433,6 +453,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: Windows_NT archType: x86 platform: Windows_NT_x86 @@ -451,6 +472,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: Windows_NT archType: arm platform: Windows_NT_arm @@ -470,6 +492,7 @@ jobs: parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} osGroup: Windows_NT archType: arm64 platform: Windows_NT_arm64 diff --git a/eng/pipelines/common/templates/runtimes/run-test-job.yml b/eng/pipelines/common/templates/runtimes/run-test-job.yml index 4a89ea975bdb..39616a833b0e 100644 --- a/eng/pipelines/common/templates/runtimes/run-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/run-test-job.yml @@ -268,6 +268,10 @@ jobs: /p:TargetArchitecture=$(archType) displayName: "Patch dotnet with mono" + - ${{ if and(eq(parameters.runtimeFlavor, 'mono'), eq(parameters.runtimeVariant, 'llvmaot')) }}: + - script: $(coreClrRepoRootDir)build-test$(scriptExt) mono_aot $(buildConfig) + displayName: "LLVM AOT compile CoreCLR tests" + # Send tests to Helix - template: /eng/pipelines/common/templates/runtimes/send-to-helix-step.yml parameters: diff --git a/eng/pipelines/common/xplat-setup.yml b/eng/pipelines/common/xplat-setup.yml index f80c77a01eb7..f6a5ee11f4ec 100644 --- a/eng/pipelines/common/xplat-setup.yml +++ b/eng/pipelines/common/xplat-setup.yml @@ -7,6 +7,7 @@ parameters: helixQueuesTemplate: '' platform: '' jobParameters: {} + variables: [] jobs: - template: ${{ coalesce(parameters.helixQueuesTemplate, parameters.jobTemplate) }} @@ -84,6 +85,9 @@ jobs: value: Mono ${{ if eq(parameters.jobParameters.runtimeFlavor, 'coreclr') }}: value: CoreCLR + + - ${{ each variable in parameters.variables }}: + - ${{ variable }} osGroup: ${{ parameters.osGroup }} osSubgroup: ${{ parameters.osSubgroup }} diff --git a/eng/pipelines/coreclr/libraries-gcstress-extra.yml b/eng/pipelines/coreclr/libraries-gcstress-extra.yml index 58b4370724df..4063b0a8ffb9 100644 --- a/eng/pipelines/coreclr/libraries-gcstress-extra.yml +++ b/eng/pipelines/coreclr/libraries-gcstress-extra.yml @@ -25,20 +25,11 @@ jobs: jobTemplate: /eng/pipelines/common/build-coreclr-and-libraries-job.yml buildConfig: checked platformGroup: gcstress - -# -# Libraries Test Build - Release innerloop. All libraries are built on x64 and reused on all platforms. -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/libraries/build-test-job.yml - buildConfig: Release - platforms: - - Linux_x64 - - Windows_NT_x64 jobParameters: - liveRuntimeBuildConfig: checked - testScope: innerloop + # libraries test build platforms + testBuildPlatforms: + - Linux_x64 + - Windows_NT_x64 # # Libraries Test Run using Release libraries, Checked CoreCLR, and stress modes diff --git a/eng/pipelines/coreclr/libraries-gcstress0x3-gcstress0xc.yml b/eng/pipelines/coreclr/libraries-gcstress0x3-gcstress0xc.yml index b11e314a983e..d5df152153db 100644 --- a/eng/pipelines/coreclr/libraries-gcstress0x3-gcstress0xc.yml +++ b/eng/pipelines/coreclr/libraries-gcstress0x3-gcstress0xc.yml @@ -25,20 +25,11 @@ jobs: jobTemplate: /eng/pipelines/common/build-coreclr-and-libraries-job.yml buildConfig: checked platformGroup: gcstress - -# -# Libraries Test Build - Release innerloop. All libraries are built on x64 and reused on all platforms. -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/libraries/build-test-job.yml - buildConfig: Release - platforms: - - Linux_x64 - - Windows_NT_x64 jobParameters: - liveRuntimeBuildConfig: checked - testScope: innerloop + # libraries test build platforms + testBuildPlatforms: + - Linux_x64 + - Windows_NT_x64 # # Libraries Test Run using Release libraries, Checked CoreCLR, and stress modes diff --git a/eng/pipelines/coreclr/libraries-jitstress.yml b/eng/pipelines/coreclr/libraries-jitstress.yml index ff7f25b767d5..7128ab1414c0 100644 --- a/eng/pipelines/coreclr/libraries-jitstress.yml +++ b/eng/pipelines/coreclr/libraries-jitstress.yml @@ -30,20 +30,11 @@ jobs: - Windows_NT_x86 - Windows_NT_x64 - Windows_NT_arm64 - -# -# Libraries Test Build - Release innerloop. All libraries are built on x64 and reused on all platforms. -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/libraries/build-test-job.yml - buildConfig: Release - platforms: - - Linux_x64 - - Windows_NT_x64 jobParameters: - liveRuntimeBuildConfig: checked - testScope: innerloop + # libraries test build platforms + testBuildPlatforms: + - Linux_x64 + - Windows_NT_x64 # # Libraries Test Run using Release libraries, Checked CoreCLR, and stress modes diff --git a/eng/pipelines/coreclr/libraries-jitstress2-jitstressregs.yml b/eng/pipelines/coreclr/libraries-jitstress2-jitstressregs.yml index 656d13926a3e..d1a2a0afd0e5 100644 --- a/eng/pipelines/coreclr/libraries-jitstress2-jitstressregs.yml +++ b/eng/pipelines/coreclr/libraries-jitstress2-jitstressregs.yml @@ -30,20 +30,11 @@ jobs: - Windows_NT_x86 - Windows_NT_x64 - Windows_NT_arm64 - -# -# Libraries Test Build - Release innerloop. All libraries are built on x64 and reused on all platforms. -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/libraries/build-test-job.yml - buildConfig: Release - platforms: - - Linux_x64 - - Windows_NT_x64 jobParameters: - liveRuntimeBuildConfig: checked - testScope: innerloop + # libraries test build platforms + testBuildPlatforms: + - Linux_x64 + - Windows_NT_x64 # # Libraries Test Run using Release libraries, Checked CoreCLR, and stress modes diff --git a/eng/pipelines/coreclr/libraries-jitstressregs.yml b/eng/pipelines/coreclr/libraries-jitstressregs.yml index 2e62420aaf19..691cb29b0d9f 100644 --- a/eng/pipelines/coreclr/libraries-jitstressregs.yml +++ b/eng/pipelines/coreclr/libraries-jitstressregs.yml @@ -30,20 +30,11 @@ jobs: - Windows_NT_x86 - Windows_NT_x64 - Windows_NT_arm64 - -# -# Libraries Test Build - Release innerloop. All libraries are built on x64 and reused on all platforms. -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/libraries/build-test-job.yml - buildConfig: Release - platforms: - - Linux_x64 - - Windows_NT_x64 jobParameters: - liveRuntimeBuildConfig: checked - testScope: innerloop + # libraries test build platforms + testBuildPlatforms: + - Linux_x64 + - Windows_NT_x64 # # Libraries Test Run using Release libraries, Checked CoreCLR, and stress modes diff --git a/eng/pipelines/coreclr/templates/run-performance-job.yml b/eng/pipelines/coreclr/templates/run-performance-job.yml index 249ff6bd1a2f..7dadb9bd5eee 100644 --- a/eng/pipelines/coreclr/templates/run-performance-job.yml +++ b/eng/pipelines/coreclr/templates/run-performance-job.yml @@ -64,10 +64,16 @@ jobs: - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: - HelixPreCommand: $(HelixPreCommandStemLinux);$(ExtraMSBuildLogsLinux) - IsInternal: --internal - - group: DotNet-HelixApi-Access - group: dotnet-benchview + - ${{ if not(and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'))) }}: + - ${{ if eq( parameters.osGroup, 'Windows_NT') }}: + - HelixPreCommand: $(ExtraMSBuildLogsWindows) + - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: + - HelixPreCommand: $(ExtraMSBuildLogsLinux) + + - ${{ if and(eq(parameters.codeGenType, 'Interpreter'), eq(parameters.runtimeType, 'mono')) }}: - ${{ if eq( parameters.osGroup, 'Windows_NT') }}: - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: diff --git a/eng/pipelines/global-build.yml b/eng/pipelines/global-build.yml index deed32365862..9721eb4b9f47 100644 --- a/eng/pipelines/global-build.yml +++ b/eng/pipelines/global-build.yml @@ -104,4 +104,4 @@ jobs: - Linux_x64 jobParameters: nameSuffix: SourceBuild - buildArgs: /p:DotNetBuildFromSource=true \ No newline at end of file + buildArgs: /p:DotNetBuildFromSource=true diff --git a/eng/pipelines/libraries/base-job.yml b/eng/pipelines/libraries/base-job.yml index 2f58e43033e2..99e627141899 100644 --- a/eng/pipelines/libraries/base-job.yml +++ b/eng/pipelines/libraries/base-job.yml @@ -43,6 +43,7 @@ jobs: # rename this variable, due to collision with build-native.proj - _runtimeOSArg: '' - _finalFrameworkArg: '' + - _testModeArg: '' - _buildScript: $(_buildScriptFileName)$(scriptExt) - _testScopeArg: '' - _extraHelixArguments: '' @@ -73,7 +74,8 @@ jobs: - ${{ if eq(parameters.framework, 'allConfigurations') }}: - _finalFrameworkArg: -allConfigurations - - _extraHelixArguments: /p:BuildAllConfigurations=true + - _testModeArg: /p:TestAssemblies=false /p:TestPackages=true + - _extraHelixArguments: /p:TestPackages=true - ${{ if eq(parameters.isOfficialAllConfigurations, true) }}: - librariesBuildArtifactName: 'libraries_bin_official_allconfigurations' @@ -89,10 +91,6 @@ jobs: - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: - _runtimeDownloadPath: '$(Build.SourcesDirectory)/artifacts/transport/${{ parameters.runtimeFlavor }}' - _runtimeConfigurationArg: -rc ${{ parameters.liveRuntimeBuildConfig }} - # Download full product dependencies for mono or test - - ${{ if or(ne(parameters.runtimeFlavor, 'coreclr'), ne(parameters.testScope, '')) }}: - - _runtimeArtifactName: '$(runtimeFlavorName)Product_${{ parameters.runtimeVariant}}_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_${{ parameters.liveRuntimeBuildConfig }}' - - _runtimeArtifactsPathArg: ' /p:RuntimeArtifactsPath=$(_runtimeDownloadPath)' - ${{ if eq(parameters.testDisplayName, '') }}: - _testRunNamePrefixSuffix: $(runtimeFlavorName)_${{ parameters.liveRuntimeBuildConfig }} - ${{ if ne(parameters.testDisplayName, '') }}: @@ -106,7 +104,7 @@ jobs: - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: - _buildScript: ./$(_buildScriptFileName)$(scriptExt) - - _buildArguments: $(_runtimeConfigurationArg) -configuration ${{ parameters.buildConfig }} -ci -arch ${{ parameters.archType }} $(_finalFrameworkArg) $(_testScopeArg) $(_runtimeOSArg) $(_msbuildCommonParameters) $(_runtimeArtifactsPathArg) $(_crossBuildPropertyArg) + - _buildArguments: $(_runtimeConfigurationArg) -configuration ${{ parameters.buildConfig }} -ci -arch ${{ parameters.archType }} $(_finalFrameworkArg) $(_testModeArg) $(_testScopeArg) $(_runtimeOSArg) $(_msbuildCommonParameters) $(_runtimeArtifactsPathArg) $(_crossBuildPropertyArg) - ${{ parameters.variables }} # we need to override this value to support build-coreclr-and-libraries-job.yml @@ -123,13 +121,4 @@ jobs: steps: - template: /eng/pipelines/common/clone-checkout-bundle-step.yml - - - ${{ if and(ne(parameters.liveRuntimeBuildConfig, ''), or(ne(parameters.runtimeFlavor, 'coreclr'), ne(parameters.testScope, ''))) }}: - - template: /eng/pipelines/common/download-artifact-step.yml - parameters: - unpackFolder: $(_runtimeDownloadPath) - artifactFileName: '$(_runtimeArtifactName)$(archiveExtension)' - artifactName: '$(_runtimeArtifactName)' - displayName: '$(runtimeFlavorName) build drop' - - ${{ parameters.steps }} diff --git a/eng/pipelines/libraries/build-job.yml b/eng/pipelines/libraries/build-job.yml index e3200bd3f2a0..f2e8ff21683c 100644 --- a/eng/pipelines/libraries/build-job.yml +++ b/eng/pipelines/libraries/build-job.yml @@ -8,6 +8,7 @@ parameters: isOfficialBuild: false isOfficialAllConfigurations: false runtimeVariant: '' + platform: '' # When set to a non-empty value (Debug / Release), it determines the runtime's # build configuration to use for building libraries and tests. Setting this @@ -25,6 +26,7 @@ parameters: pool: '' runTests: false testScope: '' + testBuildPlatforms: [] jobs: - template: /eng/pipelines/libraries/base-job.yml @@ -49,24 +51,18 @@ jobs: name: build displayName: 'Build' - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: - dependsOn: - # Use full product dependency for non-coreclr and test builds - - ${{ if or(ne(parameters.runtimeFlavor, 'coreclr'), ne(parameters.testScope, '')) }}: - - ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', parameters.runtimeFlavor, parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }} - variables: + - librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}_{1}_{2}', parameters.osGroup, parameters.archType, parameters.buildConfig) }} - _subset: libs - _additionalBuildArguments: '' - ${{ parameters.variables }} - ${{ if eq(parameters.osGroup, 'Browser') }}: - EMSDK_PATH: /usr/local/emscripten - # for coreclr library builds (when not testing) build corelib as well. - - ${{ if and(eq(parameters.runtimeFlavor, 'coreclr'), eq(parameters.testScope, '')) }}: - - _subset: clr.corelib+libs + # Tests only run for 'allConfiguration' and 'net472' build-jobs - - ${{ if eq(parameters.runTests, true) }}: - - _subset: clr.corelib+libs+libs.tests + # If platform is in testBuildPlatforms we build tests as well. + - ${{ if or(eq(parameters.runTests, true), containsValue(parameters.testBuildPlatforms, parameters.platform)) }}: + - _subset: libs+libs.tests - _additionalBuildArguments: /p:ArchiveTests=true - ${{ parameters.variables }} @@ -97,19 +93,13 @@ jobs: displayName: Disk Usage after Build - ${{ if eq(parameters.runTests, false) }}: - - ${{ if ne(parameters.isOfficialBuild, true) }}: + - ${{ if ne(parameters.isOfficialBuild, true) }}: - task: CopyFiles@2 displayName: Prepare testhost folder to publish inputs: sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/testhost targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/testhost - - task: CopyFiles@2 - displayName: Prepare artifacts toolset folder to publish - inputs: - sourceFolder: $(Build.SourcesDirectory)/artifacts/toolset - targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/toolset - - task: CopyFiles@2 displayName: Prepare runtime folder to publish inputs: @@ -162,6 +152,17 @@ jobs: tarCompression: $(tarCompression) artifactName: $(librariesBuildArtifactName) displayName: Build Assets + + - ${{ if containsValue(parameters.testBuildPlatforms, parameters.platform) }}: + - template: /eng/pipelines/common/upload-artifact-step.yml + parameters: + rootFolder: $(Build.SourcesDirectory)/artifacts/helix + includeRootFolder: true + archiveType: $(archiveType) + archiveExtension: $(archiveExtension) + tarCompression: $(tarCompression) + artifactName: $(librariesTestsArtifactName) + displayName: Test Assets # Save AllConfigurations artifacts using the prepare-signed-artifacts format. The # platform-specific jobs' nupkgs automatically flow through the matching platform-specific diff --git a/eng/pipelines/libraries/build-test-job.yml b/eng/pipelines/libraries/build-test-job.yml deleted file mode 100644 index 0ce715add47c..000000000000 --- a/eng/pipelines/libraries/build-test-job.yml +++ /dev/null @@ -1,86 +0,0 @@ -parameters: - buildConfig: '' - osGroup: '' - osSubgroup: '' - archType: '' - framework: '' - isOfficialBuild: false - liveRuntimeBuildConfig: '' - runtimeFlavor: 'coreclr' - runtimeVariant: '' - timeoutInMinutes: 150 - container: '' - publishTestArtifacs: true - pool: '' - testScope: '' - variables: {} - condition: true - runTests: false - -jobs: - - template: /eng/pipelines/libraries/base-job.yml - parameters: - buildConfig: ${{ parameters.buildConfig }} - osGroup: ${{ parameters.osGroup }} - osSubgroup: ${{ parameters.osSubgroup }} - archType: ${{ parameters.archType }} - framework: ${{ parameters.framework }} - isOfficialBuild: ${{ parameters.isOfficialBuild }} - condition: ${{ parameters.condition }} - liveRuntimeBuildConfig: ${{ parameters.liveRuntimeBuildConfig }} - timeoutInMinutes: ${{ parameters.timeoutInMinutes }} - container: ${{ parameters.container }} - runtimeVariant: ${{ parameters.runtimeVariant }} - pool: ${{ parameters.pool }} - testScope: ${{ parameters.testScope }} - name: test_build - displayName: 'Test Build' - - dependsOn: - - ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} - # Libraries Test also depends on Product, now that the libraries build only depends on corelib - - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: - - ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', parameters.runtimeFlavor, parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }} - - variables: - - librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}_{1}_{2}', parameters.osGroup, parameters.archType, parameters.buildConfig) }} - - _archiveTestsParameter: /p:ArchiveTests=true - - - ${{ parameters.variables }} - - steps: - - template: /eng/pipelines/common/download-artifact-step.yml - parameters: - displayName: Build Assets - artifactName: $(librariesBuildArtifactName) - artifactFileName: $(librariesBuildArtifactName)$(archiveExtension) - unpackFolder: $(Build.SourcesDirectory)/artifacts - cleanUnpackFolder: false - - - ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}: - - script: | - du -sh $(Build.SourcesDirectory)/* - df -h - displayName: Disk Usage before Build - - - script: $(_buildScript) - -subset libs.pretest+libs.tests - $(_buildArguments) - $(_archiveTestsParameter) - displayName: Restore and Build - - - ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}: - - script: | - du -sh $(Build.SourcesDirectory)/* - df -h - displayName: Disk Usage after Build - - - template: /eng/pipelines/common/upload-artifact-step.yml - parameters: - rootFolder: $(Build.SourcesDirectory)/artifacts/helix - includeRootFolder: true - archiveType: $(archiveType) - archiveExtension: $(archiveExtension) - tarCompression: $(tarCompression) - artifactName: $(librariesTestsArtifactName) - displayName: Test Assets diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml index 2bdfc5715886..58d1f89fe3c0 100644 --- a/eng/pipelines/libraries/helix-queues-setup.yml +++ b/eng/pipelines/libraries/helix-queues-setup.yml @@ -1,6 +1,6 @@ parameters: jobTemplate: '' - variables: {} + variables: [] osGroup: '' osSubgroup: '' archType: '' @@ -138,6 +138,6 @@ jobs: # WebAssembly - ${{ if eq(parameters.platform, 'Browser_wasm') }}: - - Ubuntu.2004.Amd64.Open + - Ubuntu.1804.Amd64.Open ${{ insert }}: ${{ parameters.jobParameters }} diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index 7f04f6e2ebb1..cf6324e79068 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -52,16 +52,20 @@ jobs: dependsOn: - ${{ if notIn(parameters.framework, 'allConfigurations', 'net472') }}: - ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} - - ${{ format('libraries_test_build_{0}_{1}_{2}', parameters.osGroup, parameters.dependsOnTestArchitecture, parameters.dependsOnTestBuildConfiguration) }} - - ${{ if in(parameters.framework, 'allConfigurations', 'net472') }}: - - ${{ format('libraries_build_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} - - ${{ format('libraries_test_build_{0}_{1}_{2}_{3}', parameters.framework, parameters.osGroup, parameters.dependsOnTestArchitecture, parameters.dependsOnTestBuildConfiguration) }} + # tests are built as part of product build + - ${{ if or(ne(parameters.archType, parameters.dependsOnTestArchitecture), ne(parameters.buildConfig, parameters.dependsOnTestBuildConfiguration)) }}: + - ${{ format('libraries_build_{0}_{1}_{2}', parameters.osGroup, parameters.dependsOnTestArchitecture, parameters.dependsOnTestBuildConfiguration) }} - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: - ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', parameters.runtimeFlavor, parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }} variables: - librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}_{1}_{2}', parameters.osGroup, parameters.dependsOnTestArchitecture, parameters.dependsOnTestBuildConfiguration) }} - _archiveTestsParameter: /p:ArchiveTests=true + + - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: + - _runtimeArtifactName: '$(runtimeFlavorName)Product_${{ parameters.runtimeVariant}}_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_${{ parameters.liveRuntimeBuildConfig }}' + - _runtimeArtifactsPathArg: ' /p:RuntimeArtifactsPath=$(_runtimeDownloadPath)' + - ${{ parameters.variables }} steps: @@ -80,6 +84,14 @@ jobs: artifactName: $(librariesTestsArtifactName) artifactFileName: $(librariesTestsArtifactName)$(archiveExtension) unpackFolder: $(Build.SourcesDirectory)/artifacts + + - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + unpackFolder: $(_runtimeDownloadPath) + artifactFileName: '$(_runtimeArtifactName)$(archiveExtension)' + artifactName: '$(_runtimeArtifactName)' + displayName: '$(runtimeFlavorName) build drop' - ${{ if in(parameters.coreclrTestGroup, 'gcstress0x3-gcstress0xc', 'gcstress-extra') }}: # We need to find and download the GC stress dependencies (namely, coredistools). Put them @@ -138,7 +150,10 @@ jobs: - jitstress2 - jitstress2_tiered - zapdisable - - tailcallstress + # tailcallstress currently has hundreds of failures on Linux/arm32, so disable it. + # Tracked by https://github.com/dotnet/runtime/issues/38892. + - ${{ if or(eq(parameters.osGroup, 'Windows_NT'), ne(parameters.archType, 'arm')) }}: + - tailcallstress ${{ if in(parameters.coreclrTestGroup, 'jitstressregs' ) }}: scenarios: - jitstressregs1 diff --git a/eng/pipelines/mono/templates/xplat-pipeline-job.yml b/eng/pipelines/mono/templates/xplat-pipeline-job.yml index 364616643e86..89917a58e0b8 100644 --- a/eng/pipelines/mono/templates/xplat-pipeline-job.yml +++ b/eng/pipelines/mono/templates/xplat-pipeline-job.yml @@ -48,7 +48,7 @@ jobs: variables: - name: coreClrProductArtifactName - value: 'CoreCLRProduct_${{ parameters.runtimeVariant }}_$(osGroup)$(osSubgroup)_$(archType)_${{ parameters.liveRuntimeBuildConfig }}' + value: 'CoreCLRProduct__$(osGroup)$(osSubgroup)_$(archType)_${{ parameters.liveRuntimeBuildConfig }}' - name: coreClrProductRootFolderPath value: '$(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).$(archType).$(liveRuntimeBuildConfigUpper)' diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 32d7dc0e686f..6d70e6cd190d 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -159,7 +159,7 @@ jobs: # # Build CoreCLR checked using GCC toolchain # Only when CoreCLR is changed -# +# - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml @@ -250,7 +250,7 @@ jobs: or( eq(dependencies.checkout.outputs['SetPathVars_coreclr.containsChange'], true), eq(variables['isFullMatrix'], true)) - + # Build the whole product using Mono runtime # Only when libraries, mono or installer are changed # @@ -311,21 +311,33 @@ jobs: runtimeFlavor: mono platforms: - Browser_wasm + variables: + # map dependencies variables to local variables + - name: librariesContainsChange + value: $[ dependencies.checkout.outputs['SetPathVars_libraries.containsChange'] ] + - name: monoContainsChange + value: $[ dependencies.checkout.outputs['SetPathVars_mono.containsChange'] ] jobParameters: testGroup: innerloop nameSuffix: AllSubsets_Mono buildArgs: -s mono+libs+installer+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true timeoutInMinutes: 120 - extraStepsTemplate: /eng/pipelines/libraries/helix.yml - extraStepsParameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) condition: >- or( eq(dependencies.checkout.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.checkout.outputs['SetPathVars_installer.containsChange'], true), eq(variables['isFullMatrix'], true)) + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + condition: >- + or( + eq(variables['librariesContainsChange'], true), + eq(variables['monoContainsChange'], true), + eq(variables['isFullMatrix'], true)) # # Build Mono and Installer on LLVMJIT mode @@ -479,6 +491,25 @@ jobs: eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true), eq(variables['isFullMatrix'], true)) +# +# Build Mono release with LLVM AOT +# Only when mono, or the runtime tests changed +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/mono/templates/build-job.yml + runtimeFlavor: mono + buildConfig: release + platforms: + - Linux_x64 + jobParameters: + runtimeVariant: llvmaot + condition: >- + or( + eq(dependencies.checkout.outputs['SetPathVars_runtimetests.containsChange'], true), + eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true), + eq(variables['isFullMatrix'], true)) + # # Build libraries using live CoreLib # These set of libraries are built always no matter what changed @@ -510,6 +541,11 @@ jobs: - Windows_NT_x64 - FreeBSD_x64 jobParameters: + testScope: innerloop + testBuildPlatforms: + - Linux_x64 + - Windows_NT_x64 + - OSX_x64 liveRuntimeBuildConfig: release # @@ -597,30 +633,6 @@ jobs: liveRuntimeBuildConfig: release liveLibrariesBuildConfig: ${{ variables.debugOnPrReleaseOnRolling }} -# -# Libraries Test Build -# Only when CoreCLR, Mono or Libraries is changed -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/libraries/build-test-job.yml - buildConfig: ${{ variables.debugOnPrReleaseOnRolling }} - platforms: - - OSX_x64 - - Linux_x64 - - Windows_NT_x64 - jobParameters: - isOfficialBuild: false - liveRuntimeBuildConfig: release - testScope: innerloop - condition: >- - or( - eq(dependencies.checkout.outputs['SetPathVars_libraries.containsChange'], true), - eq(dependencies.checkout.outputs['SetPathVars_coreclr.containsChange'], true), - eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true), - eq(dependencies.checkout.outputs['SetPathVars_runtimetests.containsChange'], true), - eq(variables['isFullMatrix'], true)) - # # Crossgen-comparison jobs # Only when CoreCLR is changed @@ -745,6 +757,29 @@ jobs: eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.checkout.outputs['SetPathVars_runtimetests.containsChange'], true), eq(variables['isFullMatrix'], true)) +# +# Mono CoreCLR runtime Test executions using live libraries and LLVM AOT +# Only when Mono is changed +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml + buildConfig: release + runtimeFlavor: mono + platforms: + - Linux_x64 + helixQueueGroup: pr + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: innerloop + liveLibrariesBuildConfig: ${{ variables.debugOnPrReleaseOnRolling }} + liveRuntimeBuildConfig: release + runtimeVariant: llvmaot + condition: >- + or( + eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true), + eq(dependencies.checkout.outputs['SetPathVars_runtimetests.containsChange'], true), + eq(variables['isFullMatrix'], true)) # # Libraries Release Test Execution against a release mono runtime. diff --git a/eng/testing/RunnerTemplate.sh b/eng/testing/RunnerTemplate.sh old mode 100644 new mode 100755 index 80b496efe82d..dbd5f4741a5d --- a/eng/testing/RunnerTemplate.sh +++ b/eng/testing/RunnerTemplate.sh @@ -170,7 +170,14 @@ fi # ======================= BEGIN Core File Inspection ========================= pushd $EXECUTION_DIR >/dev/null if [[ "$(uname -s)" == "Linux" && $test_exitcode -ne 0 ]]; then - echo Looking around for any Linux dump... + if [ -n "$HELIX_WORKITEM_PAYLOAD" ]; then + have_sleep=$(which sleep) + if [ -x "$have_sleep" ]; then + echo Waiting a few seconds for any dump to be written.. + sleep 10s + fi + fi + echo Looking around for any Linux dump.. # Depending on distro/configuration, the core files may either be named "core" # or "core." by default. We read /proc/sys/kernel/core_uses_pid to # determine which it is. diff --git a/eng/testing/linker/SupportFiles/Directory.Build.props b/eng/testing/linker/SupportFiles/Directory.Build.props index 3bec2264d6fd..4f2c8b61a1e1 100644 --- a/eng/testing/linker/SupportFiles/Directory.Build.props +++ b/eng/testing/linker/SupportFiles/Directory.Build.props @@ -1,11 +1,11 @@ true - <_TrimmerDefaultAction>link - <_TrimmerLinkSymbols>true + link + false true false true - \ No newline at end of file + diff --git a/eng/testing/linker/SupportFiles/Directory.Build.targets b/eng/testing/linker/SupportFiles/Directory.Build.targets index 90ce573551e9..49422a33b9be 100644 --- a/eng/testing/linker/SupportFiles/Directory.Build.targets +++ b/eng/testing/linker/SupportFiles/Directory.Build.targets @@ -19,6 +19,15 @@ + + + + link + + + + - \ No newline at end of file + diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index ebefed0e7e96..266a6d37be65 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -121,10 +121,17 @@ AssemblyFile="$(WasmAppBuilderTasksAssemblyPath)" /> + + + + $([System.IO.Directory]::GetParent('%(Identity)').Name) + + - + + @@ -140,7 +147,6 @@ - + AssemblySearchPaths="@(AssemblySearchPaths)"/> + + + + <_Parameter1>$(MinimiumSupportedWindowsPlatform) + + + @@ -57,6 +64,10 @@ <_Parameter1>$(AssemblyName) + + <_Parameter1>en-US + + <_Parameter1>%(AssemblyMetadata.Identity) diff --git a/global.json b/global.json index 2cbc796534d7..64916dd7429c 100644 --- a/global.json +++ b/global.json @@ -1,24 +1,24 @@ { "sdk": { - "version": "5.0.100-preview.6.20310.4", + "version": "5.0.100-preview.8.20362.3", "allowPrerelease": true, "rollForward": "major" }, "tools": { - "dotnet": "5.0.100-preview.6.20310.4" + "dotnet": "5.0.100-preview.8.20362.3" }, "native-tools": { "cmake": "3.14.5", "python3": "3.7.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "5.0.0-beta.20330.3", - "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20330.3", - "Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk": "5.0.0-beta.20330.3", - "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20330.3", + "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "5.0.0-beta.20364.3", + "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20364.3", + "Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk": "5.0.0-beta.20364.3", + "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20364.3", "Microsoft.FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", "Microsoft.NET.Sdk.IL": "5.0.0-preview.8.20359.4", "Microsoft.Build.NoTargets": "1.0.53", - "Microsoft.Build.Traversal": "2.0.34" + "Microsoft.Build.Traversal": "2.0.52" } } diff --git a/src/coreclr/build-test.sh b/src/coreclr/build-test.sh index 2de59c68c06c..f1a26c565e3b 100755 --- a/src/coreclr/build-test.sh +++ b/src/coreclr/build-test.sh @@ -47,6 +47,18 @@ build_test_wrappers() fi } +build_mono_aot() +{ + __RuntimeFlavor="mono" + __MonoBinDir="$__RootBinDir/bin/mono/$__TargetOS.$__BuildArch.$__BuildType" + __Exclude="${__ProjectDir}/tests/issues.targets" + __TestBinDir="$__TestWorkingDir" + CORE_ROOT="$__TestBinDir"/Tests/Core_Root + export __Exclude + export CORE_ROOT + build_MSBuild_projects "Tests_MonoAot" "$__ProjectDir/tests/src/runtest.proj" "Mono AOT compile tests" "/t:MonoAotCompileTests" "/p:RuntimeFlavor=$__RuntimeFlavor" "/p:MonoLlvmPath=$__MonoBinDir" +} + generate_layout() { echo "${__MsgPrefix}Creating test overlay..." @@ -608,6 +620,12 @@ handle_arguments_local() { excludemonofailures|-excludemonofailures) __Mono=1 ;; + + mono_aot|-mono_aot) + __Mono=1 + __MonoAot=1 + ;; + *) __UnprocessedBuildArgs+=("$1") ;; @@ -661,6 +679,8 @@ __UseNinja=0 __VerboseBuild=0 __CMakeArgs="" __priority1= +__Mono=0 +__MonoAot=0 CORE_ROOT= source "$__ProjectRoot"/_build-commons.sh @@ -703,10 +723,12 @@ if [[ -z "$HOME" ]]; then echo "HOME not defined; setting it to $HOME" fi -if [[ (-z "$__GenerateLayoutOnly") && (-z "$__BuildTestWrappersOnly") ]]; then +if [[ (-z "$__GenerateLayoutOnly") && (-z "$__BuildTestWrappersOnly") && ("$__MonoAot" -eq 0) ]]; then build_Tests elif [[ ! -z "$__BuildTestWrappersOnly" ]]; then build_test_wrappers +elif [[ "$__MonoAot" -eq 1 ]]; then + build_mono_aot else generate_layout fi diff --git a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj index 7d77fd31d77b..501487c6a111 100644 --- a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -147,7 +147,6 @@ - diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Enum.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Enum.CoreCLR.cs index 465884a11d6c..3dded2f8d367 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Enum.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Enum.CoreCLR.cs @@ -27,21 +27,6 @@ public abstract partial class Enum [MethodImpl(MethodImplOptions.InternalCall)] private extern bool InternalHasFlag(Enum flags); - private class EnumInfo - { - public readonly bool HasFlagsAttribute; - public readonly ulong[] Values; - public readonly string[] Names; - - // Each entry contains a list of sorted pair of enum field names and values, sorted by values - public EnumInfo(bool hasFlagsAttribute, ulong[] values, string[] names) - { - HasFlagsAttribute = hasFlagsAttribute; - Values = values; - Names = names; - } - } - private static EnumInfo GetEnumInfo(RuntimeType enumType, bool getNames = true) { EnumInfo? entry = enumType.GenericCache as EnumInfo; @@ -64,82 +49,5 @@ private static EnumInfo GetEnumInfo(RuntimeType enumType, bool getNames = true) return entry; } - - internal static ulong[] InternalGetValues(RuntimeType enumType) - { - // Get all of the values - return GetEnumInfo(enumType, false).Values; - } - - internal static string[] InternalGetNames(RuntimeType enumType) - { - // Get all of the names - return GetEnumInfo(enumType, true).Names; - } - - [Intrinsic] - public bool HasFlag(Enum flag) - { - if (flag == null) - throw new ArgumentNullException(nameof(flag)); - - if (!this.GetType().IsEquivalentTo(flag.GetType())) - { - throw new ArgumentException(SR.Format(SR.Argument_EnumTypeDoesNotMatch, flag.GetType(), this.GetType())); - } - - return InternalHasFlag(flag); - } - - public static string? GetName(Type enumType, object value) - { - if (enumType == null) - throw new ArgumentNullException(nameof(enumType)); - - return enumType.GetEnumName(value); - } - - public static string[] GetNames(Type enumType) - { - if (enumType == null) - throw new ArgumentNullException(nameof(enumType)); - - return enumType.GetEnumNames(); - } - - public static Type GetUnderlyingType(Type enumType) - { - if (enumType == null) - throw new ArgumentNullException(nameof(enumType)); - - return enumType.GetEnumUnderlyingType(); - } - - public static Array GetValues(Type enumType) - { - if (enumType == null) - throw new ArgumentNullException(nameof(enumType)); - - return enumType.GetEnumValues(); - } - - public static bool IsDefined(Type enumType, object value) - { - if (enumType == null) - throw new ArgumentNullException(nameof(enumType)); - - return enumType.IsEnumDefined(value); - } - - private static RuntimeType ValidateRuntimeType(Type enumType) - { - if (enumType == null) - throw new ArgumentNullException(nameof(enumType)); - if (!enumType.IsEnum) - throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType)); - if (!(enumType is RuntimeType rtType)) - throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType)); - return rtType; - } } } diff --git a/src/coreclr/src/binder/assemblybinder.cpp b/src/coreclr/src/binder/assemblybinder.cpp index 0b3c465fa5b7..5f13adc7b2c8 100644 --- a/src/coreclr/src/binder/assemblybinder.cpp +++ b/src/coreclr/src/binder/assemblybinder.cpp @@ -396,9 +396,9 @@ namespace BINDER_SPACE BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle(sCoreLibName, /*pathIsBundleRelative */ true); if (!bundleFileLocation.IsValid()) { - sCoreLib.Set(systemDirectory); pathSource = BinderTracing::PathSource::ApplicationAssemblies; } + sCoreLib.Set(systemDirectory); CombinePath(sCoreLib, sCoreLibName, sCoreLib); IF_FAIL_GO(AssemblyBinder::GetAssembly(sCoreLib, diff --git a/src/coreclr/src/debug/daccess/dacdbiimpl.cpp b/src/coreclr/src/debug/daccess/dacdbiimpl.cpp index 2f34a59c5d70..4bcd6f2ff4cb 100644 --- a/src/coreclr/src/debug/daccess/dacdbiimpl.cpp +++ b/src/coreclr/src/debug/daccess/dacdbiimpl.cpp @@ -22,6 +22,7 @@ #include "switches.h" #include "generics.h" #include "stackwalk.h" +#include "virtualcallstub.h" #include "dacdbiimpl.h" @@ -3570,6 +3571,139 @@ HRESULT DacDbiInterfaceImpl::GetDelegateTargetObject( return hr; } +static bool TrackMemoryRangeHelper(PTR_VOID pvArgs, PTR_VOID pvAllocationBase, SIZE_T cbReserved) +{ + // The pvArgs is really pointing to a debugger-side container. Sadly the callback only takes a PTR_VOID. + CQuickArrayList *rangeCollection = + (CQuickArrayList*)(dac_cast(pvArgs)); + TADDR rangeStart = dac_cast(pvAllocationBase); + TADDR rangeEnd = rangeStart + cbReserved; + rangeCollection->Push({rangeStart, rangeEnd}); + + // This is a tracking function, not a search callback. Pretend we never found what we were looking for + // to get all possible ranges. + return false; +} + +void DacDbiInterfaceImpl::EnumerateMemRangesForLoaderAllocator(PTR_LoaderAllocator pLoaderAllocator, CQuickArrayList *rangeAcummulator) +{ + CQuickArrayList heapsToEnumerate; + + // We always expect to see these three heaps + _ASSERTE(pLoaderAllocator->GetLowFrequencyHeap() != NULL); + heapsToEnumerate.Push(pLoaderAllocator->GetLowFrequencyHeap()); + + _ASSERTE(pLoaderAllocator->GetHighFrequencyHeap() != NULL); + heapsToEnumerate.Push(pLoaderAllocator->GetHighFrequencyHeap()); + + _ASSERTE(pLoaderAllocator->GetStubHeap() != NULL); + heapsToEnumerate.Push(pLoaderAllocator->GetStubHeap()); + + // GetVirtualCallStubManager returns VirtualCallStubManager*, but it's really an address to target as + // pLoaderAllocator is DACized. Cast it so we don't try to to a Host to Target translation. + VirtualCallStubManager *pVcsMgr = PTR_VirtualCallStubManager(TO_TADDR(pLoaderAllocator->GetVirtualCallStubManager())); + LOG((LF_CORDB, LL_INFO10000, "DDBII::EMRFLA: VirtualCallStubManager 0x%x\n", PTR_HOST_TO_TADDR(pVcsMgr))); + if (pVcsMgr) + { + if (pVcsMgr->indcell_heap != NULL) heapsToEnumerate.Push(pVcsMgr->indcell_heap); + if (pVcsMgr->lookup_heap != NULL) heapsToEnumerate.Push(pVcsMgr->lookup_heap); + if (pVcsMgr->resolve_heap != NULL) heapsToEnumerate.Push(pVcsMgr->resolve_heap); + if (pVcsMgr->dispatch_heap != NULL) heapsToEnumerate.Push(pVcsMgr->dispatch_heap); + if (pVcsMgr->cache_entry_heap != NULL) heapsToEnumerate.Push(pVcsMgr->cache_entry_heap); + } + + TADDR rangeAccumAsTaddr = TO_TADDR(rangeAcummulator); + for (uint32_t i = 0; i < (uint32_t)heapsToEnumerate.Size(); i++) + { + LOG((LF_CORDB, LL_INFO10000, "DDBII::EMRFLA: LoaderHeap 0x%x\n", heapsToEnumerate[i].GetAddr())); + heapsToEnumerate[i]->EnumPageRegions(TrackMemoryRangeHelper, rangeAccumAsTaddr); + } +} + +void DacDbiInterfaceImpl::EnumerateMemRangesForJitCodeHeaps(CQuickArrayList *rangeAcummulator) +{ + // We should always have a valid EEJitManager with at least one code heap. + EEJitManager *pEM = ExecutionManager::GetEEJitManager(); + _ASSERTE(pEM != NULL && pEM->m_pCodeHeap.IsValid()); + + PTR_HeapList pHeapList = pEM->m_pCodeHeap; + while (pHeapList != NULL) + { + CodeHeap *pHeap = pHeapList->pHeap; + DacpJitCodeHeapInfo jitCodeHeapInfo = DACGetHeapInfoForCodeHeap(pHeap); + + switch (jitCodeHeapInfo.codeHeapType) + { + case CODEHEAP_LOADER: + { + TADDR targetLoaderHeap = CLRDATA_ADDRESS_TO_TADDR(jitCodeHeapInfo.LoaderHeap); + LOG((LF_CORDB, LL_INFO10000, + "DDBII::EMRFJCH: LoaderCodeHeap 0x%x with LoaderHeap at 0x%x\n", + PTR_HOST_TO_TADDR(pHeap), targetLoaderHeap)); + PTR_ExplicitControlLoaderHeap pLoaderHeap = PTR_ExplicitControlLoaderHeap(targetLoaderHeap); + pLoaderHeap->EnumPageRegions(TrackMemoryRangeHelper, TO_TADDR(rangeAcummulator)); + break; + } + + case CODEHEAP_HOST: + { + LOG((LF_CORDB, LL_INFO10000, + "DDBII::EMRFJCH: HostCodeHeap 0x%x\n", + PTR_HOST_TO_TADDR(pHeap))); + rangeAcummulator->Push({ + CLRDATA_ADDRESS_TO_TADDR(jitCodeHeapInfo.HostData.baseAddr), + CLRDATA_ADDRESS_TO_TADDR(jitCodeHeapInfo.HostData.currentAddr) + }); + break; + } + + default: + { + LOG((LF_CORDB, LL_INFO10000, "DDBII::EMRFJCH: unknown heap type at 0x%x\n\n", pHeap)); + _ASSERTE("Unknown heap type enumerating code ranges."); + break; + } + } + + pHeapList = pHeapList->GetNext(); + } +} + +HRESULT DacDbiInterfaceImpl::GetLoaderHeapMemoryRanges(DacDbiArrayList *pRanges) +{ + LOG((LF_CORDB, LL_INFO10000, "DDBII::GLHMR\n")); + DD_ENTER_MAY_THROW; + + HRESULT hr = S_OK; + + EX_TRY + { + CQuickArrayList memoryRanges; + + // Anything that's loaded in the SystemDomain or into the main AppDomain's default context in .NET Core + // and after uses only one global allocator. Enumerating that one is enough for most purposes. + // This doesn't consider any uses of AssemblyLoadingContexts (Unloadable or not). Each context has + // it's own LoaderAllocator, but there's no easy way of getting a hand at them other than going through + // the heap, getting a managed LoaderAllocators, from there getting a Scout, and from there getting a native + // pointer to the LoaderAllocator tos enumerate. + PTR_LoaderAllocator pGlobalAllocator = SystemDomain::System()->GetLoaderAllocator(); + _ASSERTE(pGlobalAllocator); + EnumerateMemRangesForLoaderAllocator(pGlobalAllocator, &memoryRanges); + + EnumerateMemRangesForJitCodeHeaps(&memoryRanges); + + // This code doesn't enumerate module thunk heaps to support IJW. + // It's a fairly rare scenario and requires to enumerate all modules. + // The return for such added time is minimal. + + _ASSERTE(memoryRanges.Size() < INT_MAX); + pRanges->Init(memoryRanges.Ptr(), (UINT) memoryRanges.Size()); + } + EX_CATCH_HRESULT(hr); + + return hr; +} + void DacDbiInterfaceImpl::GetStackFramesFromException(VMPTR_Object vmObject, DacDbiArrayList& dacStackFrames) { DD_ENTER_MAY_THROW; diff --git a/src/coreclr/src/debug/daccess/dacdbiimpl.h b/src/coreclr/src/debug/daccess/dacdbiimpl.h index 1856e1949616..9178e7173626 100644 --- a/src/coreclr/src/debug/daccess/dacdbiimpl.h +++ b/src/coreclr/src/debug/daccess/dacdbiimpl.h @@ -361,6 +361,8 @@ class DacDbiInterfaceImpl : OUT VMPTR_Object *ppTargetObj, OUT VMPTR_AppDomain *ppTargetAppDomain); + HRESULT GetLoaderHeapMemoryRanges(OUT DacDbiArrayList * pRanges); + // retrieves the list of COM interfaces implemented by vmObject, as it is known at // the time of the call (the list may change as new interface types become available // in the runtime) @@ -394,6 +396,14 @@ class DacDbiInterfaceImpl : OUT DacDbiArrayList * pTypes); private: + // Helper to enumerate all possible memory ranges help by a loader allocator. + void EnumerateMemRangesForLoaderAllocator( + PTR_LoaderAllocator pLoaderAllocator, + CQuickArrayList *rangeAcummulator); + + void EnumerateMemRangesForJitCodeHeaps( + CQuickArrayList *rangeAcummulator); + // Given a pointer to a managed function, obtain the method desc for it. // Equivalent to GetMethodDescPtrFromIp, except if the method isn't jitted // it will look for it in code stubs. diff --git a/src/coreclr/src/debug/daccess/dacfn.cpp b/src/coreclr/src/debug/daccess/dacfn.cpp index 4e6989c118a2..2aad5dcdfdfc 100644 --- a/src/coreclr/src/debug/daccess/dacfn.cpp +++ b/src/coreclr/src/debug/daccess/dacfn.cpp @@ -268,7 +268,7 @@ DacVirtualUnwind(ULONG32 threadId, PT_CONTEXT context, PT_KNONVOLATILE_CONTEXT_P memset(contextPointers, 0, sizeof(T_KNONVOLATILE_CONTEXT_POINTERS)); } - HRESULT hr = S_OK; + HRESULT hr = E_NOINTERFACE; #ifdef FEATURE_DATATARGET4 ReleaseHolder dt; @@ -277,9 +277,12 @@ DacVirtualUnwind(ULONG32 threadId, PT_CONTEXT context, PT_KNONVOLATILE_CONTEXT_P { hr = dt->VirtualUnwind(threadId, sizeof(CONTEXT), (BYTE*)context); } - else #endif + + if (hr == E_NOINTERFACE || hr == E_NOTIMPL) { + hr = S_OK; + SIZE_T baseAddress = DacGlobalBase(); if (baseAddress == 0 || !PAL_VirtualUnwindOutOfProc(context, contextPointers, baseAddress, DacReadAllAdapter)) { diff --git a/src/coreclr/src/debug/daccess/dacimpl.h b/src/coreclr/src/debug/daccess/dacimpl.h index 9e20184e0549..efbd19da6f1a 100644 --- a/src/coreclr/src/debug/daccess/dacimpl.h +++ b/src/coreclr/src/debug/daccess/dacimpl.h @@ -1455,8 +1455,12 @@ class ClrDataAccess private: #endif -#ifdef FEATURE_COMINTEROP protected: + // Populates a DacpJitCodeHeapInfo with proper information about the + // code heap type and the information needed to locate it. + DacpJitCodeHeapInfo DACGetHeapInfoForCodeHeap(CodeHeap *heapAddr); + +#ifdef FEATURE_COMINTEROP // Returns CCW pointer based on a target address. PTR_ComCallWrapper DACGetCCWFromAddress(CLRDATA_ADDRESS addr); diff --git a/src/coreclr/src/debug/daccess/request.cpp b/src/coreclr/src/debug/daccess/request.cpp index 072eba0e55ac..b9a589fd609f 100644 --- a/src/coreclr/src/debug/daccess/request.cpp +++ b/src/coreclr/src/debug/daccess/request.cpp @@ -499,27 +499,8 @@ ClrDataAccess::GetCodeHeapList(CLRDATA_ADDRESS jitManager, unsigned int count, s unsigned int i = 0; while ((heapList != NULL) && (i < count)) { - // What type of CodeHeap pointer do we have? CodeHeap *codeHeap = heapList->pHeap; - TADDR ourVTablePtr = VPTR_HOST_VTABLE_TO_TADDR(*(LPVOID*)codeHeap); - if (ourVTablePtr == LoaderCodeHeap::VPtrTargetVTable()) - { - LoaderCodeHeap *loaderCodeHeap = PTR_LoaderCodeHeap(PTR_HOST_TO_TADDR(codeHeap)); - codeHeaps[i].codeHeapType = CODEHEAP_LOADER; - codeHeaps[i].LoaderHeap = - TO_CDADDR(PTR_HOST_MEMBER_TADDR(LoaderCodeHeap, loaderCodeHeap, m_LoaderHeap)); - } - else if (ourVTablePtr == HostCodeHeap::VPtrTargetVTable()) - { - HostCodeHeap *hostCodeHeap = PTR_HostCodeHeap(PTR_HOST_TO_TADDR(codeHeap)); - codeHeaps[i].codeHeapType = CODEHEAP_HOST; - codeHeaps[i].HostData.baseAddr = PTR_CDADDR(hostCodeHeap->m_pBaseAddr); - codeHeaps[i].HostData.currentAddr = PTR_CDADDR(hostCodeHeap->m_pLastAvailableCommittedAddr); - } - else - { - codeHeaps[i].codeHeapType = CODEHEAP_UNKNOWN; - } + codeHeaps[i] = DACGetHeapInfoForCodeHeap(codeHeap); heapList = heapList->hpNext; i++; } @@ -547,6 +528,33 @@ ClrDataAccess::GetCodeHeapList(CLRDATA_ADDRESS jitManager, unsigned int count, s return hr; } +DacpJitCodeHeapInfo ClrDataAccess::DACGetHeapInfoForCodeHeap(CodeHeap *heapAddr) +{ + DacpJitCodeHeapInfo jitCodeHeapInfo; + + TADDR targetVtblPtrForHeapType = VPTR_HOST_VTABLE_TO_TADDR(*(LPVOID*)heapAddr); + if (targetVtblPtrForHeapType == LoaderCodeHeap::VPtrTargetVTable()) + { + LoaderCodeHeap *loaderCodeHeap = PTR_LoaderCodeHeap(PTR_HOST_TO_TADDR(heapAddr)); + jitCodeHeapInfo.codeHeapType = CODEHEAP_LOADER; + jitCodeHeapInfo.LoaderHeap = + TO_CDADDR(PTR_HOST_MEMBER_TADDR(LoaderCodeHeap, loaderCodeHeap, m_LoaderHeap)); + } + else if (targetVtblPtrForHeapType == HostCodeHeap::VPtrTargetVTable()) + { + HostCodeHeap *hostCodeHeap = PTR_HostCodeHeap(PTR_HOST_TO_TADDR(heapAddr)); + jitCodeHeapInfo.codeHeapType = CODEHEAP_HOST; + jitCodeHeapInfo.HostData.baseAddr = PTR_CDADDR(hostCodeHeap->m_pBaseAddr); + jitCodeHeapInfo.HostData.currentAddr = PTR_CDADDR(hostCodeHeap->m_pLastAvailableCommittedAddr); + } + else + { + jitCodeHeapInfo.codeHeapType = CODEHEAP_UNKNOWN; + } + + return jitCodeHeapInfo; +} + HRESULT ClrDataAccess::GetStackLimits(CLRDATA_ADDRESS threadPtr, CLRDATA_ADDRESS *lower, CLRDATA_ADDRESS *upper, CLRDATA_ADDRESS *fp) diff --git a/src/coreclr/src/debug/di/process.cpp b/src/coreclr/src/debug/di/process.cpp index 1b76753efcbe..bb09213c5553 100644 --- a/src/coreclr/src/debug/di/process.cpp +++ b/src/coreclr/src/debug/di/process.cpp @@ -2173,6 +2173,10 @@ HRESULT CordbProcess::QueryInterface(REFIID id, void **pInterface) { *pInterface = static_cast(this); } + else if (id == IID_ICorDebugProcess11) + { + *pInterface = static_cast(this); + } else if (id == IID_IUnknown) { *pInterface = static_cast(static_cast(this)); @@ -2531,6 +2535,35 @@ COM_METHOD CordbProcess::EnableGCNotificationEvents(BOOL fEnable) return hr; } +//----------------------------------------------------------- +// ICorDebugProcess11 +//----------------------------------------------------------- +COM_METHOD CordbProcess::EnumerateLoaderHeapMemoryRegions(ICorDebugMemoryRangeEnum **ppRanges) +{ + VALIDATE_POINTER_TO_OBJECT(ppRanges, ICorDebugMemoryRangeEnum **); + FAIL_IF_NEUTERED(this); + + HRESULT hr = S_OK; + + PUBLIC_API_BEGIN(this); + { + DacDbiArrayList heapRanges; + + hr = GetDAC()->GetLoaderHeapMemoryRanges(&heapRanges); + + if (SUCCEEDED(hr)) + { + RSInitHolder heapSegmentEnumerator( + new CordbMemoryRangeEnumerator(this, &heapRanges[0], (DWORD)heapRanges.Count())); + + GetContinueNeuterList()->Add(this, heapSegmentEnumerator); + heapSegmentEnumerator.TransferOwnershipExternal(ppRanges); + } + } + PUBLIC_API_END(hr); + return hr; +} + HRESULT CordbProcess::GetTypeForObject(CORDB_ADDRESS addr, CordbAppDomain* pAppDomainOverride, CordbType **ppType, CordbAppDomain **pAppDomain) { VMPTR_AppDomain appDomain; diff --git a/src/coreclr/src/debug/di/rspriv.h b/src/coreclr/src/debug/di/rspriv.h index 2831db5b86fe..1bb48df2356c 100644 --- a/src/coreclr/src/debug/di/rspriv.h +++ b/src/coreclr/src/debug/di/rspriv.h @@ -1668,6 +1668,11 @@ typedef CordbEnumerator > CordbHeapSegmentEnumerator; +typedef CordbEnumerator > CordbMemoryRangeEnumerator; + typedef CordbEnumerator *pRanges) = 0; + // The following tag tells the DD-marshalling tool to stop scanning. // END_MARSHAL diff --git a/src/coreclr/src/dlls/mscordac/CMakeLists.txt b/src/coreclr/src/dlls/mscordac/CMakeLists.txt index 94b61b52692f..7a3e19525f2a 100644 --- a/src/coreclr/src/dlls/mscordac/CMakeLists.txt +++ b/src/coreclr/src/dlls/mscordac/CMakeLists.txt @@ -179,6 +179,12 @@ if(CLR_CMAKE_HOST_WIN32 AND CLR_CMAKE_TARGET_UNIX) ) endif(CLR_CMAKE_HOST_WIN32 AND CLR_CMAKE_TARGET_UNIX) +if(CLR_CMAKE_HOST_OSX) + list(APPEND COREDAC_LIBRARIES + coreclrpal_dac + ) +endif(CLR_CMAKE_HOST_OSX) + target_link_libraries(mscordaccore PRIVATE ${COREDAC_LIBRARIES}) # Create the DAC module index header file containing the DAC build id diff --git a/src/coreclr/src/gc/CMakeLists.txt b/src/coreclr/src/gc/CMakeLists.txt index f94140e2241c..c46f46fdfbae 100644 --- a/src/coreclr/src/gc/CMakeLists.txt +++ b/src/coreclr/src/gc/CMakeLists.txt @@ -39,6 +39,20 @@ else() windows/gcenv.windows.cpp) endif(CLR_CMAKE_HOST_UNIX) +if (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32) + set ( GC_SOURCES + ${GC_SOURCES} + vxsort/isa_detection_dummy.cpp + vxsort/do_vxsort_avx2.cpp + vxsort/do_vxsort_avx512.cpp + vxsort/machine_traits.avx2.cpp + vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp + vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp + vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp + vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp +) +endif (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32) + if (CLR_CMAKE_TARGET_WIN32) set(GC_HEADERS env/common.h @@ -74,7 +88,8 @@ if (CLR_CMAKE_TARGET_WIN32) handletable.inl handletablepriv.h objecthandle.h - softwarewritewatch.h) + softwarewritewatch.h + vxsort/do_vxsort.h) endif(CLR_CMAKE_TARGET_WIN32) if(CLR_CMAKE_HOST_WIN32) diff --git a/src/coreclr/src/gc/gc.cpp b/src/coreclr/src/gc/gc.cpp index 57e525843dfe..6bf8e51a6bce 100644 --- a/src/coreclr/src/gc/gc.cpp +++ b/src/coreclr/src/gc/gc.cpp @@ -18,7 +18,11 @@ #include "gcpriv.h" +#if defined(TARGET_AMD64) && defined(TARGET_WINDOWS) +#define USE_VXSORT +#else #define USE_INTROSORT +#endif // We just needed a simple random number generator for testing. class gc_rand @@ -2075,6 +2079,10 @@ uint8_t* tree_search (uint8_t* tree, uint8_t* old_address); #ifdef USE_INTROSORT #define _sort introsort::sort +#elif defined(USE_VXSORT) +// in this case we have do_vxsort which takes an additional range that +// all items to be sorted are contained in +// so do not #define _sort #else //USE_INTROSORT #define _sort qsort1 void qsort1(uint8_t** low, uint8_t** high, unsigned int depth); @@ -2096,6 +2104,7 @@ uint8_t** gc_heap::g_mark_list_copy; #endif //PARALLEL_MARK_LIST_SORT size_t gc_heap::mark_list_size; +bool gc_heap::mark_list_overflow; #endif //MARK_LIST seg_mapping* seg_mapping_table; @@ -8130,7 +8139,8 @@ void rqsort1( uint8_t* *low, uint8_t* *high) } } -#ifdef USE_INTROSORT +// vxsort uses introsort as a fallback if the AVX2 instruction set is not supported +#if defined(USE_INTROSORT) || defined(USE_VXSORT) class introsort { @@ -8254,18 +8264,109 @@ inline static void swap_elements(uint8_t** i,uint8_t** j) }; -#endif //USE_INTROSORT +#endif //defined(USE_INTROSORT) || defined(USE_VXSORT) + +#ifdef USE_VXSORT +static void do_vxsort (uint8_t** item_array, ptrdiff_t item_count, uint8_t* range_low, uint8_t* range_high) +{ + // above this threshold, using AVX2 for sorting will likely pay off + // despite possible downclocking on some devices + const size_t AVX2_THRESHOLD_SIZE = 8 * 1024; + + // above this threshold, using AVX51F for sorting will likely pay off + // despite possible downclocking on current devices + const size_t AVX512F_THRESHOLD_SIZE = 128 * 1024; + + if (item_count <= 1) + return; + + if (IsSupportedInstructionSet (InstructionSet::AVX2) && (item_count > AVX2_THRESHOLD_SIZE)) + { + // is the range small enough for a 32-bit sort? + // the 32-bit sort is almost twice as fast + ptrdiff_t range = range_high - range_low; + assert(sizeof(uint8_t*) == (1 << 3)); + ptrdiff_t scaled_range = range >> 3; + if ((uint32_t)scaled_range == scaled_range) + { + dprintf (3, ("Sorting mark lists as 32-bit offsets")); + + do_pack_avx2 (item_array, item_count, range_low); + + int32_t* item_array_32 = (int32_t*)item_array; + + // use AVX512F only if the list is large enough to pay for downclocking impact + if (IsSupportedInstructionSet (InstructionSet::AVX512F) && (item_count > AVX512F_THRESHOLD_SIZE)) + { + do_vxsort_avx512 (item_array_32, &item_array_32[item_count - 1]); + } + else + { + do_vxsort_avx2 (item_array_32, &item_array_32[item_count - 1]); + } + + do_unpack_avx2 (item_array_32, item_count, range_low); + } + else + { + dprintf(3, ("Sorting mark lists")); + + // use AVX512F only if the list is large enough to pay for downclocking impact + if (IsSupportedInstructionSet (InstructionSet::AVX512F) && (item_count > AVX512F_THRESHOLD_SIZE)) + { + do_vxsort_avx512 (item_array, &item_array[item_count - 1]); + } + else + { + do_vxsort_avx2 (item_array, &item_array[item_count - 1]); + } + } + } + else + { + dprintf (3, ("Sorting mark lists")); + introsort::sort (item_array, &item_array[item_count - 1], 0); + } +#ifdef _DEBUG + // check the array is sorted + for (ptrdiff_t i = 0; i < item_count - 1; i++) + { + assert (item_array[i] <= item_array[i + 1]); + } + // check that the ends of the array are indeed in range + // together with the above this implies all elements are in range + assert ((range_low <= item_array[0]) && (item_array[item_count - 1] <= range_high)); +#endif +} +#endif //USE_VXSORT #ifdef MULTIPLE_HEAPS #ifdef PARALLEL_MARK_LIST_SORT +NOINLINE void gc_heap::sort_mark_list() { + if (settings.condemned_generation >= max_generation) + { + return; + } + // if this heap had a mark list overflow, we don't do anything if (mark_list_index > mark_list_end) { // printf("sort_mark_list: overflow on heap %d\n", heap_number); + mark_list_overflow = true; + return; + } + +#ifdef BACKGROUND_GC + // we are not going to use the mark list if background GC is running + // so let's not waste time sorting it + if (gc_heap::background_running_p()) + { + mark_list_index = mark_list_end + 1; return; } +#endif //BACKGROUND_GC // if any other heap had a mark list overflow, we fake one too, // so we don't use an incomplete mark list by mistake @@ -8281,9 +8382,98 @@ void gc_heap::sort_mark_list() // unsigned long start = GetCycleCount32(); + // compute total mark list size and total ephemeral size + size_t total_mark_list_size = 0; + size_t total_ephemeral_size = 0; + uint8_t* low = (uint8_t*)~0; + uint8_t* high = 0; + for (int i = 0; i < n_heaps; i++) + { + gc_heap* hp = g_heaps[i]; + size_t ephemeral_size = heap_segment_allocated (hp->ephemeral_heap_segment) - hp->gc_low; + total_ephemeral_size += ephemeral_size; + total_mark_list_size += (hp->mark_list_index - hp->mark_list); + low = min (low, hp->gc_low); + high = max (high, heap_segment_allocated (hp->ephemeral_heap_segment)); + } + + // give up if this is not an ephemeral GC or the mark list size is unreasonably large + if (total_mark_list_size > (total_ephemeral_size / 256)) + { + mark_list_index = mark_list_end + 1; + // let's not count this as a mark list overflow + mark_list_overflow = false; + return; + } + +#ifdef USE_VXSORT + ptrdiff_t item_count = mark_list_index - mark_list; +//#define WRITE_SORT_DATA +#if defined(_DEBUG) || defined(WRITE_SORT_DATA) + // in debug, make a copy of the mark list + // for checking and debugging purposes + uint8_t** mark_list_copy = &g_mark_list_copy[heap_number * mark_list_size]; + uint8_t** mark_list_copy_index = &mark_list_copy[item_count]; + for (ptrdiff_t i = 0; i < item_count; i++) + { + uint8_t* item = mark_list[i]; + mark_list_copy[i] = item; + } +#endif // defined(_DEBUG) || defined(WRITE_SORT_DATA) + + ptrdiff_t start = get_cycle_count(); + + do_vxsort (mark_list, item_count, low, high); + + ptrdiff_t elapsed_cycles = get_cycle_count() - start; + +#ifdef WRITE_SORT_DATA + char file_name[256]; + sprintf_s (file_name, _countof(file_name), "sort_data_gc%d_heap%d", settings.gc_index, heap_number); + + FILE* f; + errno_t err = fopen_s (&f, file_name, "wb"); + + if (err == 0) + { + size_t magic = 'SDAT'; + if (fwrite (&magic, sizeof(magic), 1, f) != 1) + dprintf (3, ("fwrite failed\n")); + if (fwrite (&elapsed_cycles, sizeof(elapsed_cycles), 1, f) != 1) + dprintf (3, ("fwrite failed\n")); + if (fwrite (&low, sizeof(low), 1, f) != 1) + dprintf (3, ("fwrite failed\n")); + if (fwrite (&item_count, sizeof(item_count), 1, f) != 1) + dprintf (3, ("fwrite failed\n")); + if (fwrite (mark_list_copy, sizeof(mark_list_copy[0]), item_count, f) != item_count) + dprintf (3, ("fwrite failed\n")); + if (fwrite (&magic, sizeof(magic), 1, f) != 1) + dprintf (3, ("fwrite failed\n")); + if (fclose (f) != 0) + dprintf (3, ("fclose failed\n")); + } +#endif + +#ifdef _DEBUG + // in debug, sort the copy as well using the proven sort, so we can check we got the right result + if (mark_list_copy_index > mark_list_copy) + { + introsort::sort (mark_list_copy, mark_list_copy_index - 1, 0); + } + for (ptrdiff_t i = 0; i < item_count; i++) + { + uint8_t* item = mark_list[i]; + assert (mark_list_copy[i] == item); + } +#endif //_DEBUG + +#else //USE_VXSORT dprintf (3, ("Sorting mark lists")); if (mark_list_index > mark_list) - _sort (mark_list, mark_list_index - 1, 0); + { + introsort::sort (mark_list, mark_list_index - 1, 0); + } +#endif // printf("first phase of sort_mark_list for heap %d took %u cycles to sort %u entries\n", this->heap_number, GetCycleCount32() - start, mark_list_index - mark_list); // start = GetCycleCount32(); @@ -8614,6 +8804,67 @@ void gc_heap::combine_mark_lists() } #endif // PARALLEL_MARK_LIST_SORT #endif //MULTIPLE_HEAPS + +void gc_heap::grow_mark_list () +{ + // with vectorized sorting, we can use bigger mark lists +#ifdef USE_VXSORT +#ifdef MULTIPLE_HEAPS + const size_t MAX_MARK_LIST_SIZE = IsSupportedInstructionSet (InstructionSet::AVX2) ? 1000 * 1024 : 200 * 1024; +#else //MULTIPLE_HEAPS + const size_t MAX_MARK_LIST_SIZE = IsSupportedInstructionSet (InstructionSet::AVX2) ? 32 * 1024 : 16 * 1024; +#endif //MULTIPLE_HEAPS +#else +#ifdef MULTIPLE_HEAPS + const size_t MAX_MARK_LIST_SIZE = 200 * 1024; +#else //MULTIPLE_HEAPS + const size_t MAX_MARK_LIST_SIZE = 16 * 1024; +#endif //MULTIPLE_HEAPS +#endif + + size_t new_mark_list_size = min (mark_list_size * 2, MAX_MARK_LIST_SIZE); + if (new_mark_list_size == mark_list_size) + return; + +#ifdef MULTIPLE_HEAPS + uint8_t** new_mark_list = make_mark_list (new_mark_list_size * n_heaps); + +#ifdef PARALLEL_MARK_LIST_SORT + uint8_t** new_mark_list_copy = make_mark_list (new_mark_list_size * n_heaps); +#endif //PARALLEL_MARK_LIST_SORT + + if (new_mark_list != nullptr +#ifdef PARALLEL_MARK_LIST_SORT + && new_mark_list_copy != nullptr +#endif //PARALLEL_MARK_LIST_SORT + ) + { + delete[] g_mark_list; + g_mark_list = new_mark_list; +#ifdef PARALLEL_MARK_LIST_SORT + delete[] g_mark_list_copy; + g_mark_list_copy = new_mark_list_copy; +#endif //PARALLEL_MARK_LIST_SORT + mark_list_size = new_mark_list_size; + } + else + { + delete[] new_mark_list; +#ifdef PARALLEL_MARK_LIST_SORT + delete[] new_mark_list_copy; +#endif //PARALLEL_MARK_LIST_SORT + } + +#else //MULTIPLE_HEAPS + uint8_t** new_mark_list = make_mark_list (new_mark_list_size); + if (new_mark_list != nullptr) + { + delete[] mark_list; + g_mark_list = new_mark_list; + mark_list_size = new_mark_list_size; + } +#endif //MULTIPLE_HEAPS +} #endif //MARK_LIST class seg_free_spaces @@ -10098,6 +10349,10 @@ HRESULT gc_heap::initialize_gc (size_t soh_segment_size, static_cast(GCEventStatus::GetEnabledKeywords(GCEventProvider_Private))); #endif // __linux__ +#ifdef USE_VXSORT + InitSupportedInstructionSet ((int32_t)GCConfig::GetGCEnabledInstructionSets()); +#endif + if (!init_semi_shared()) { hres = E_FAIL; @@ -10125,7 +10380,7 @@ gc_heap::init_semi_shared() #ifdef MARK_LIST #ifdef MULTIPLE_HEAPS - mark_list_size = min (150*1024, max (8192, soh_segment_size/(2*10*32))); + mark_list_size = min (100*1024, max (8192, soh_segment_size/(2*10*32))); g_mark_list = make_mark_list (mark_list_size*n_heaps); min_balance_threshold = alloc_quantum_balance_units * CLR_SIZE * 2; @@ -22032,7 +22287,12 @@ void gc_heap::plan_phase (int condemned_gen_number) (mark_list_index - &mark_list[0]), ((mark_list_end - &mark_list[0])))); if (mark_list_index >= (mark_list_end + 1)) + { mark_list_index = mark_list_end + 1; +#ifndef MULTIPLE_HEAPS // in Server GC, we check for mark list overflow in sort_mark_list + mark_list_overflow = true; +#endif + } #else dprintf (3, ("mark_list length: %Id", (mark_list_index - &mark_list[0]))); @@ -22046,7 +22306,12 @@ void gc_heap::plan_phase (int condemned_gen_number) ) { #ifndef MULTIPLE_HEAPS - _sort (&mark_list[0], mark_list_index-1, 0); +#ifdef USE_VXSORT + do_vxsort (mark_list, mark_list_index - mark_list, slow, shigh); +#else //USE_VXSORT + _sort (&mark_list[0], mark_list_index - 1, 0); +#endif //USE_VXSORT + //printf ("using mark list at GC #%d", dd_collection_count (dynamic_data_of (0))); //verify_qsort_array (&mark_list[0], mark_list_index-1); #endif //!MULTIPLE_HEAPS @@ -37045,6 +37310,12 @@ void gc_heap::do_post_gc() #else record_interesting_info_per_heap(); #endif //MULTIPLE_HEAPS + if (mark_list_overflow) + { + grow_mark_list(); + mark_list_overflow = false; + } + record_global_mechanisms(); #endif //GC_CONFIG_DRIVEN } diff --git a/src/coreclr/src/gc/gcconfig.h b/src/coreclr/src/gc/gcconfig.h index 3ff7a1dc2926..085562f56dd4 100644 --- a/src/coreclr/src/gc/gcconfig.h +++ b/src/coreclr/src/gc/gcconfig.h @@ -128,6 +128,7 @@ class GCConfigStringHolder INT_CONFIG (GCHeapHardLimitSOHPercent, "GCHeapHardLimitSOHPercent", NULL, 0, "Specifies the GC heap SOH usage as a percentage of the total memory") \ INT_CONFIG (GCHeapHardLimitLOHPercent, "GCHeapHardLimitLOHPercent", NULL, 0, "Specifies the GC heap LOH usage as a percentage of the total memory") \ INT_CONFIG (GCHeapHardLimitPOHPercent, "GCHeapHardLimitPOHPercent", NULL, 0, "Specifies the GC heap POH usage as a percentage of the total memory") \ + INT_CONFIG (GCEnabledInstructionSets, "GCEnabledInstructionSets", NULL, -1, "Specifies whether GC can use AVX2 or AVX512F - 0 for neither, 1 for AVX2, 3 for AVX512F")\ // This class is responsible for retreiving configuration information // for how the GC should operate. diff --git a/src/coreclr/src/gc/gcpriv.h b/src/coreclr/src/gc/gcpriv.h index 62844b74eb50..0606b57d7279 100644 --- a/src/coreclr/src/gc/gcpriv.h +++ b/src/coreclr/src/gc/gcpriv.h @@ -1,15 +1,9 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -// -// -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -// -// optimize for speed - +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. #ifndef _DEBUG #ifdef _MSC_VER +// optimize for speed #pragma optimize( "t", on ) #endif #endif @@ -2936,6 +2930,11 @@ class gc_heap #endif #endif //MULTIPLE_HEAPS +#ifdef MARK_LIST + PER_HEAP_ISOLATED + void grow_mark_list(); +#endif //MARK_LIST + #ifdef BACKGROUND_GC PER_HEAP @@ -3843,6 +3842,9 @@ class gc_heap PER_HEAP_ISOLATED size_t mark_list_size; + PER_HEAP_ISOLATED + bool mark_list_overflow; + PER_HEAP uint8_t** mark_list_end; diff --git a/src/coreclr/src/gc/gcsvr.cpp b/src/coreclr/src/gc/gcsvr.cpp index 15ec076c6c5d..9e4a78473530 100644 --- a/src/coreclr/src/gc/gcsvr.cpp +++ b/src/coreclr/src/gc/gcsvr.cpp @@ -20,6 +20,10 @@ #define SERVER_GC 1 +#if defined(TARGET_AMD64) && defined(TARGET_WINDOWS) +#include "vxsort/do_vxsort.h" +#endif + namespace SVR { #include "gcimpl.h" #include "gc.cpp" diff --git a/src/coreclr/src/gc/gcwks.cpp b/src/coreclr/src/gc/gcwks.cpp index 3977c5141b1b..7d599e8d8e51 100644 --- a/src/coreclr/src/gc/gcwks.cpp +++ b/src/coreclr/src/gc/gcwks.cpp @@ -20,6 +20,10 @@ #undef SERVER_GC #endif +#if defined(TARGET_AMD64) && defined(TARGET_WINDOWS) +#include "vxsort/do_vxsort.h" +#endif + namespace WKS { #include "gcimpl.h" #include "gc.cpp" diff --git a/src/coreclr/src/gc/sample/CMakeLists.txt b/src/coreclr/src/gc/sample/CMakeLists.txt index 059c5e768b2b..40bb0b5dcd54 100644 --- a/src/coreclr/src/gc/sample/CMakeLists.txt +++ b/src/coreclr/src/gc/sample/CMakeLists.txt @@ -24,6 +24,20 @@ set(SOURCES ../softwarewritewatch.cpp ) +if (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32) + set ( SOURCES + ${SOURCES} + ../vxsort/isa_detection_dummy.cpp + ../vxsort/do_vxsort_avx2.cpp + ../vxsort/do_vxsort_avx512.cpp + ../vxsort/machine_traits.avx2.cpp + ../vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp + ../vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp + ../vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp + ../vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp +) +endif (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32) + if(CLR_CMAKE_TARGET_WIN32) set (GC_LINK_LIBRARIES ${STATIC_MT_CRT_LIB} diff --git a/src/coreclr/src/gc/vxsort/alignment.h b/src/coreclr/src/gc/vxsort/alignment.h new file mode 100644 index 000000000000..df61c3a30f41 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/alignment.h @@ -0,0 +1,39 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef VXSORT_ALIGNNMENT_H +#define VXSORT_ALIGNNMENT_H + +//#include + +namespace vxsort { + +using namespace std; + +template +struct alignment_hint { + public: + static const size_t ALIGN = N; + static const int8_t REALIGN = 0x66; + + alignment_hint() : left_align(REALIGN), right_align(REALIGN) {} + alignment_hint realign_left() { + alignment_hint copy = *this; + copy.left_align = REALIGN; + return copy; + } + + alignment_hint realign_right() { + alignment_hint copy = *this; + copy.right_align = REALIGN; + return copy; + } + + static bool is_aligned(void* p) { return (size_t)p % ALIGN == 0; } + + int left_align : 8; + int right_align : 8; +}; + +} +#endif // VXSORT_ALIGNNMENT_H diff --git a/src/coreclr/src/gc/vxsort/defs.h b/src/coreclr/src/gc/vxsort/defs.h new file mode 100644 index 000000000000..628315e5110a --- /dev/null +++ b/src/coreclr/src/gc/vxsort/defs.h @@ -0,0 +1,48 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef VXSORT_DEFS_H +#define VXSORT_DEFS_H + +#if _MSC_VER +#ifdef _M_X86 +#define ARCH_X86 +#endif +#ifdef _M_X64 +#define ARCH_X64 +#endif +#ifdef _M_ARM64 +#define ARCH_ARM +#endif +#else +#ifdef __i386__ +#define ARCH_X86 +#endif +#ifdef __amd64__ +#define ARCH_X64 +#endif +#ifdef __arm__ +#define ARCH_ARM +#endif +#endif + +#ifdef _MSC_VER +#ifdef __clang__ +#define mess_up_cmov() +#define INLINE __attribute__((always_inline)) +#define NOINLINE __attribute__((noinline)) +#else +// MSVC +#include +#define mess_up_cmov() _ReadBarrier(); +#define INLINE __forceinline +#define NOINLINE __declspec(noinline) +#endif +#else +// GCC + Clang +#define mess_up_cmov() +#define INLINE __attribute__((always_inline)) +#define NOINLINE __attribute__((noinline)) +#endif + +#endif // VXSORT_DEFS_H diff --git a/src/coreclr/src/gc/vxsort/do_vxsort.h b/src/coreclr/src/gc/vxsort/do_vxsort.h new file mode 100644 index 000000000000..50a5e1ef77a7 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/do_vxsort.h @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// Enum for the IsSupportedInstructionSet method +enum class InstructionSet +{ + AVX2 = 0, + AVX512F = 1, +}; + +void InitSupportedInstructionSet (int32_t configSetting); +bool IsSupportedInstructionSet (InstructionSet instructionSet); + +void do_vxsort_avx2 (uint8_t** low, uint8_t** high); +void do_vxsort_avx2 (int32_t* low, int32_t* high); + +void do_pack_avx2 (uint8_t** mem, size_t len, uint8_t* base); +void do_unpack_avx2 (int32_t* mem, size_t len, uint8_t* base); + +void do_vxsort_avx512 (uint8_t** low, uint8_t** high); +void do_vxsort_avx512 (int32_t* low, int32_t* high); + +void do_pack_avx512 (uint8_t** mem, size_t len, uint8_t* base); +void do_unpack_avx512 (int32_t* mem, size_t len, uint8_t* base); diff --git a/src/coreclr/src/gc/vxsort/do_vxsort_avx2.cpp b/src/coreclr/src/gc/vxsort/do_vxsort_avx2.cpp new file mode 100644 index 000000000000..3e4fd10d15f4 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/do_vxsort_avx2.cpp @@ -0,0 +1,86 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "common.h" + +#include "vxsort_targets_enable_avx2.h" + +namespace std +{ + template + class numeric_limits + { + public: + static _Ty Max() + { + return _Ty(); + } + static _Ty Min() + { + return _Ty(); + } + }; + template <> + class numeric_limits + { + public: + static int32_t Max() + { + return 0x7fffffff; + } + static int32_t Min() + { + return -0x7fffffff-1; + } + }; + template <> + class numeric_limits + { + public: + static int64_t Max() + { + return 0x7fffffffffffffffi64; + } + + static int64_t Min() + { + return -0x7fffffffffffffffi64-1; + } + }; +} + +#ifndef max +template +T max (T a, T b) +{ + if (a > b) return a; else return b; +} +#endif +#include "vxsort.h" +#include "machine_traits.avx2.h" +#include "packer.h" + +void do_vxsort_avx2 (uint8_t** low, uint8_t** high) +{ + auto sorter = vxsort::vxsort(); + sorter.sort ((int64_t*)low, (int64_t*)high); +} + +void do_vxsort_avx2 (int32_t* low, int32_t* high) +{ + auto sorter = vxsort::vxsort(); + sorter.sort (low, high); +} + +void do_pack_avx2 (uint8_t** mem, size_t len, uint8_t* base) +{ + auto packer = vxsort::packer(); + packer.pack ((int64_t*)mem, len, (int64_t)base); +} + +void do_unpack_avx2 (int32_t* mem, size_t len, uint8_t* base) +{ + auto packer = vxsort::packer(); + packer.unpack (mem, len, (int64_t)base); +} +#include "vxsort_targets_disable.h" diff --git a/src/coreclr/src/gc/vxsort/do_vxsort_avx512.cpp b/src/coreclr/src/gc/vxsort/do_vxsort_avx512.cpp new file mode 100644 index 000000000000..aa0a8f99442e --- /dev/null +++ b/src/coreclr/src/gc/vxsort/do_vxsort_avx512.cpp @@ -0,0 +1,75 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "common.h" + +#include "vxsort_targets_enable_avx512.h" + +namespace std +{ + template + class numeric_limits + { + public: + static _Ty Max() + { + return _Ty(); + } + static _Ty Min() + { + return _Ty(); + } + }; + template <> + class numeric_limits + { + public: + static int32_t Max() + { + return 0x7fffffff; + } + static int32_t Min() + { + return -0x7fffffff - 1; + } + }; + template <> + class numeric_limits + { + public: + static int64_t Max() + { + return 0x7fffffffffffffffi64; + } + + static int64_t Min() + { + return -0x7fffffffffffffffi64 - 1; + } + }; +} + +#ifndef max +template +T max (T a, T b) +{ + if (a > b) return a; else return b; +} +#endif + +#include "vxsort.h" +#include "machine_traits.avx512.h" + +void do_vxsort_avx512 (uint8_t** low, uint8_t** high) +{ + auto sorter = vxsort::vxsort(); + sorter.sort ((int64_t*)low, (int64_t*)high); +} + +void do_vxsort_avx512 (int32_t* low, int32_t* high) +{ + auto sorter = vxsort::vxsort(); + sorter.sort (low, high); +} + +#include "vxsort_targets_disable.h" diff --git a/src/coreclr/src/gc/vxsort/isa_detection.cpp b/src/coreclr/src/gc/vxsort/isa_detection.cpp new file mode 100644 index 000000000000..ac469a615dde --- /dev/null +++ b/src/coreclr/src/gc/vxsort/isa_detection.cpp @@ -0,0 +1,140 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "common.h" +#include + +#include "do_vxsort.h" + +enum class SupportedISA +{ + None = 0, + AVX2 = 1 << (int)InstructionSet::AVX2, + AVX512F = 1 << (int)InstructionSet::AVX512F +}; + +#if defined(TARGET_AMD64) && defined(TARGET_WINDOWS) + +static DWORD64 GetEnabledXStateFeaturesHelper() +{ + LIMITED_METHOD_CONTRACT; + + // On Windows we have an api(GetEnabledXStateFeatures) to check if AVX is supported + typedef DWORD64(WINAPI* PGETENABLEDXSTATEFEATURES)(); + PGETENABLEDXSTATEFEATURES pfnGetEnabledXStateFeatures = NULL; + + HMODULE hMod = WszLoadLibraryEx(WINDOWS_KERNEL32_DLLNAME_W, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32); + if (hMod == NULL) + return 0; + + pfnGetEnabledXStateFeatures = (PGETENABLEDXSTATEFEATURES)GetProcAddress(hMod, "GetEnabledXStateFeatures"); + + if (pfnGetEnabledXStateFeatures == NULL) + { + return 0; + } + + DWORD64 FeatureMask = pfnGetEnabledXStateFeatures(); + + return FeatureMask; +} + +SupportedISA DetermineSupportedISA() +{ + // register definitions to make the following code more readable + enum reg + { + EAX = 0, + EBX = 1, + ECX = 2, + EDX = 3, + COUNT = 4 + }; + + // bit definitions to make code more readable + enum bits + { + OCXSAVE = 1<<27, + AVX = 1<<28, + AVX2 = 1<<5, + AVX512F=1<<16, + }; + int reg[COUNT]; + + __cpuid(reg, 0); + if (reg[EAX] < 7) + return SupportedISA::None; + + __cpuid(reg, 1); + + // both AVX and OCXSAVE feature flags must be enabled + if ((reg[ECX] & (OCXSAVE|AVX)) != (OCXSAVE | AVX)) + return SupportedISA::None; + + // get xcr0 register + DWORD64 xcr0 = _xgetbv(0); + + // get OS XState info + DWORD64 FeatureMask = GetEnabledXStateFeaturesHelper(); + + // get processor extended feature flag info + __cpuid(reg, 7); + + // check if both AVX2 and AVX512F are supported by both processor and OS + if ((reg[EBX] & (AVX2 | AVX512F)) == (AVX2 | AVX512F) && + (xcr0 & 0xe6) == 0xe6 && + (FeatureMask & (XSTATE_MASK_AVX | XSTATE_MASK_AVX512)) == (XSTATE_MASK_AVX | XSTATE_MASK_AVX512)) + { + return (SupportedISA)((int)SupportedISA::AVX2 | (int)SupportedISA::AVX512F); + } + + // check if AVX2 is supported by both processor and OS + if ((reg[EBX] & AVX2) && + (xcr0 & 0x06) == 0x06 && + (FeatureMask & XSTATE_MASK_AVX) == XSTATE_MASK_AVX) + { + return SupportedISA::AVX2; + } + + return SupportedISA::None; +} + +#elif defined(TARGET_UNIX) + +SupportedISA DetermineSupportedISA() +{ + __builtin_cpu_init(); + if (__builtin_cpu_supports("avx2")) + { + if (__builtin_cpu_supports("avx512f")) + return (SupportedISA)((int)SupportedISA::AVX2 | (int)SupportedISA::AVX512F); + else + return SupportedISA::AVX2; + } + else + { + return SupportedISA::None; + } +} + +#endif // defined(TARGET_UNIX) + +static bool s_initialized; +static SupportedISA s_supportedISA; + +bool IsSupportedInstructionSet (InstructionSet instructionSet) +{ + assert(s_initialized); + assert(instructionSet == InstructionSet::AVX2 || instructionSet == InstructionSet::AVX512F); + return ((int)s_supportedISA & (1 << (int)instructionSet)) != 0; +} + +void InitSupportedInstructionSet (int32_t configSetting) +{ + s_supportedISA = (SupportedISA)((int)DetermineSupportedISA() & configSetting); + // we are assuming that AVX2 can be used if AVX512F can, + // so if AVX2 is disabled, we need to disable AVX512F as well + if (!((int)s_supportedISA & (int)SupportedISA::AVX2)) + s_supportedISA = SupportedISA::None; + s_initialized = true; +} diff --git a/src/coreclr/src/gc/vxsort/isa_detection_dummy.cpp b/src/coreclr/src/gc/vxsort/isa_detection_dummy.cpp new file mode 100644 index 000000000000..e277a7675a9a --- /dev/null +++ b/src/coreclr/src/gc/vxsort/isa_detection_dummy.cpp @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "common.h" + +#include "do_vxsort.h" + +#if defined(TARGET_AMD64) && defined(TARGET_WINDOWS) + +void InitSupportedInstructionSet (int32_t) +{ +} + +bool IsSupportedInstructionSet (InstructionSet) +{ + return false; +} +#endif // defined(TARGET_AMD64) && defined(TARGET_WINDOWS) + diff --git a/src/coreclr/src/gc/vxsort/machine_traits.avx2.cpp b/src/coreclr/src/gc/vxsort/machine_traits.avx2.cpp new file mode 100644 index 000000000000..d693d08ea414 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/machine_traits.avx2.cpp @@ -0,0 +1,290 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "common.h" +//#include + +#include "machine_traits.avx2.h" + +namespace vxsort { + +alignas(128) const int8_t perm_table_64[128] = { + 0, 1, 2, 3, 4, 5, 6, 7, // 0b0000 (0) + 2, 3, 4, 5, 6, 7, 0, 1, // 0b0001 (1) + 0, 1, 4, 5, 6, 7, 2, 3, // 0b0010 (2) + 4, 5, 6, 7, 0, 1, 2, 3, // 0b0011 (3) + 0, 1, 2, 3, 6, 7, 4, 5, // 0b0100 (4) + 2, 3, 6, 7, 0, 1, 4, 5, // 0b0101 (5) + 0, 1, 6, 7, 2, 3, 4, 5, // 0b0110 (6) + 6, 7, 0, 1, 2, 3, 4, 5, // 0b0111 (7) + 0, 1, 2, 3, 4, 5, 6, 7, // 0b1000 (8) + 2, 3, 4, 5, 0, 1, 6, 7, // 0b1001 (9) + 0, 1, 4, 5, 2, 3, 6, 7, // 0b1010 (10) + 4, 5, 0, 1, 2, 3, 6, 7, // 0b1011 (11) + 0, 1, 2, 3, 4, 5, 6, 7, // 0b1100 (12) + 2, 3, 0, 1, 4, 5, 6, 7, // 0b1101 (13) + 0, 1, 2, 3, 4, 5, 6, 7, // 0b1110 (14) + 0, 1, 2, 3, 4, 5, 6, 7, // 0b1111 (15) +}; + +alignas(2048) const int8_t perm_table_32[2048] = { + 0, 1, 2, 3, 4, 5, 6, 7, // 0b00000000 (0) + 1, 2, 3, 4, 5, 6, 7, 0, // 0b00000001 (1) + 0, 2, 3, 4, 5, 6, 7, 1, // 0b00000010 (2) + 2, 3, 4, 5, 6, 7, 0, 1, // 0b00000011 (3) + 0, 1, 3, 4, 5, 6, 7, 2, // 0b00000100 (4) + 1, 3, 4, 5, 6, 7, 0, 2, // 0b00000101 (5) + 0, 3, 4, 5, 6, 7, 1, 2, // 0b00000110 (6) + 3, 4, 5, 6, 7, 0, 1, 2, // 0b00000111 (7) + 0, 1, 2, 4, 5, 6, 7, 3, // 0b00001000 (8) + 1, 2, 4, 5, 6, 7, 0, 3, // 0b00001001 (9) + 0, 2, 4, 5, 6, 7, 1, 3, // 0b00001010 (10) + 2, 4, 5, 6, 7, 0, 1, 3, // 0b00001011 (11) + 0, 1, 4, 5, 6, 7, 2, 3, // 0b00001100 (12) + 1, 4, 5, 6, 7, 0, 2, 3, // 0b00001101 (13) + 0, 4, 5, 6, 7, 1, 2, 3, // 0b00001110 (14) + 4, 5, 6, 7, 0, 1, 2, 3, // 0b00001111 (15) + 0, 1, 2, 3, 5, 6, 7, 4, // 0b00010000 (16) + 1, 2, 3, 5, 6, 7, 0, 4, // 0b00010001 (17) + 0, 2, 3, 5, 6, 7, 1, 4, // 0b00010010 (18) + 2, 3, 5, 6, 7, 0, 1, 4, // 0b00010011 (19) + 0, 1, 3, 5, 6, 7, 2, 4, // 0b00010100 (20) + 1, 3, 5, 6, 7, 0, 2, 4, // 0b00010101 (21) + 0, 3, 5, 6, 7, 1, 2, 4, // 0b00010110 (22) + 3, 5, 6, 7, 0, 1, 2, 4, // 0b00010111 (23) + 0, 1, 2, 5, 6, 7, 3, 4, // 0b00011000 (24) + 1, 2, 5, 6, 7, 0, 3, 4, // 0b00011001 (25) + 0, 2, 5, 6, 7, 1, 3, 4, // 0b00011010 (26) + 2, 5, 6, 7, 0, 1, 3, 4, // 0b00011011 (27) + 0, 1, 5, 6, 7, 2, 3, 4, // 0b00011100 (28) + 1, 5, 6, 7, 0, 2, 3, 4, // 0b00011101 (29) + 0, 5, 6, 7, 1, 2, 3, 4, // 0b00011110 (30) + 5, 6, 7, 0, 1, 2, 3, 4, // 0b00011111 (31) + 0, 1, 2, 3, 4, 6, 7, 5, // 0b00100000 (32) + 1, 2, 3, 4, 6, 7, 0, 5, // 0b00100001 (33) + 0, 2, 3, 4, 6, 7, 1, 5, // 0b00100010 (34) + 2, 3, 4, 6, 7, 0, 1, 5, // 0b00100011 (35) + 0, 1, 3, 4, 6, 7, 2, 5, // 0b00100100 (36) + 1, 3, 4, 6, 7, 0, 2, 5, // 0b00100101 (37) + 0, 3, 4, 6, 7, 1, 2, 5, // 0b00100110 (38) + 3, 4, 6, 7, 0, 1, 2, 5, // 0b00100111 (39) + 0, 1, 2, 4, 6, 7, 3, 5, // 0b00101000 (40) + 1, 2, 4, 6, 7, 0, 3, 5, // 0b00101001 (41) + 0, 2, 4, 6, 7, 1, 3, 5, // 0b00101010 (42) + 2, 4, 6, 7, 0, 1, 3, 5, // 0b00101011 (43) + 0, 1, 4, 6, 7, 2, 3, 5, // 0b00101100 (44) + 1, 4, 6, 7, 0, 2, 3, 5, // 0b00101101 (45) + 0, 4, 6, 7, 1, 2, 3, 5, // 0b00101110 (46) + 4, 6, 7, 0, 1, 2, 3, 5, // 0b00101111 (47) + 0, 1, 2, 3, 6, 7, 4, 5, // 0b00110000 (48) + 1, 2, 3, 6, 7, 0, 4, 5, // 0b00110001 (49) + 0, 2, 3, 6, 7, 1, 4, 5, // 0b00110010 (50) + 2, 3, 6, 7, 0, 1, 4, 5, // 0b00110011 (51) + 0, 1, 3, 6, 7, 2, 4, 5, // 0b00110100 (52) + 1, 3, 6, 7, 0, 2, 4, 5, // 0b00110101 (53) + 0, 3, 6, 7, 1, 2, 4, 5, // 0b00110110 (54) + 3, 6, 7, 0, 1, 2, 4, 5, // 0b00110111 (55) + 0, 1, 2, 6, 7, 3, 4, 5, // 0b00111000 (56) + 1, 2, 6, 7, 0, 3, 4, 5, // 0b00111001 (57) + 0, 2, 6, 7, 1, 3, 4, 5, // 0b00111010 (58) + 2, 6, 7, 0, 1, 3, 4, 5, // 0b00111011 (59) + 0, 1, 6, 7, 2, 3, 4, 5, // 0b00111100 (60) + 1, 6, 7, 0, 2, 3, 4, 5, // 0b00111101 (61) + 0, 6, 7, 1, 2, 3, 4, 5, // 0b00111110 (62) + 6, 7, 0, 1, 2, 3, 4, 5, // 0b00111111 (63) + 0, 1, 2, 3, 4, 5, 7, 6, // 0b01000000 (64) + 1, 2, 3, 4, 5, 7, 0, 6, // 0b01000001 (65) + 0, 2, 3, 4, 5, 7, 1, 6, // 0b01000010 (66) + 2, 3, 4, 5, 7, 0, 1, 6, // 0b01000011 (67) + 0, 1, 3, 4, 5, 7, 2, 6, // 0b01000100 (68) + 1, 3, 4, 5, 7, 0, 2, 6, // 0b01000101 (69) + 0, 3, 4, 5, 7, 1, 2, 6, // 0b01000110 (70) + 3, 4, 5, 7, 0, 1, 2, 6, // 0b01000111 (71) + 0, 1, 2, 4, 5, 7, 3, 6, // 0b01001000 (72) + 1, 2, 4, 5, 7, 0, 3, 6, // 0b01001001 (73) + 0, 2, 4, 5, 7, 1, 3, 6, // 0b01001010 (74) + 2, 4, 5, 7, 0, 1, 3, 6, // 0b01001011 (75) + 0, 1, 4, 5, 7, 2, 3, 6, // 0b01001100 (76) + 1, 4, 5, 7, 0, 2, 3, 6, // 0b01001101 (77) + 0, 4, 5, 7, 1, 2, 3, 6, // 0b01001110 (78) + 4, 5, 7, 0, 1, 2, 3, 6, // 0b01001111 (79) + 0, 1, 2, 3, 5, 7, 4, 6, // 0b01010000 (80) + 1, 2, 3, 5, 7, 0, 4, 6, // 0b01010001 (81) + 0, 2, 3, 5, 7, 1, 4, 6, // 0b01010010 (82) + 2, 3, 5, 7, 0, 1, 4, 6, // 0b01010011 (83) + 0, 1, 3, 5, 7, 2, 4, 6, // 0b01010100 (84) + 1, 3, 5, 7, 0, 2, 4, 6, // 0b01010101 (85) + 0, 3, 5, 7, 1, 2, 4, 6, // 0b01010110 (86) + 3, 5, 7, 0, 1, 2, 4, 6, // 0b01010111 (87) + 0, 1, 2, 5, 7, 3, 4, 6, // 0b01011000 (88) + 1, 2, 5, 7, 0, 3, 4, 6, // 0b01011001 (89) + 0, 2, 5, 7, 1, 3, 4, 6, // 0b01011010 (90) + 2, 5, 7, 0, 1, 3, 4, 6, // 0b01011011 (91) + 0, 1, 5, 7, 2, 3, 4, 6, // 0b01011100 (92) + 1, 5, 7, 0, 2, 3, 4, 6, // 0b01011101 (93) + 0, 5, 7, 1, 2, 3, 4, 6, // 0b01011110 (94) + 5, 7, 0, 1, 2, 3, 4, 6, // 0b01011111 (95) + 0, 1, 2, 3, 4, 7, 5, 6, // 0b01100000 (96) + 1, 2, 3, 4, 7, 0, 5, 6, // 0b01100001 (97) + 0, 2, 3, 4, 7, 1, 5, 6, // 0b01100010 (98) + 2, 3, 4, 7, 0, 1, 5, 6, // 0b01100011 (99) + 0, 1, 3, 4, 7, 2, 5, 6, // 0b01100100 (100) + 1, 3, 4, 7, 0, 2, 5, 6, // 0b01100101 (101) + 0, 3, 4, 7, 1, 2, 5, 6, // 0b01100110 (102) + 3, 4, 7, 0, 1, 2, 5, 6, // 0b01100111 (103) + 0, 1, 2, 4, 7, 3, 5, 6, // 0b01101000 (104) + 1, 2, 4, 7, 0, 3, 5, 6, // 0b01101001 (105) + 0, 2, 4, 7, 1, 3, 5, 6, // 0b01101010 (106) + 2, 4, 7, 0, 1, 3, 5, 6, // 0b01101011 (107) + 0, 1, 4, 7, 2, 3, 5, 6, // 0b01101100 (108) + 1, 4, 7, 0, 2, 3, 5, 6, // 0b01101101 (109) + 0, 4, 7, 1, 2, 3, 5, 6, // 0b01101110 (110) + 4, 7, 0, 1, 2, 3, 5, 6, // 0b01101111 (111) + 0, 1, 2, 3, 7, 4, 5, 6, // 0b01110000 (112) + 1, 2, 3, 7, 0, 4, 5, 6, // 0b01110001 (113) + 0, 2, 3, 7, 1, 4, 5, 6, // 0b01110010 (114) + 2, 3, 7, 0, 1, 4, 5, 6, // 0b01110011 (115) + 0, 1, 3, 7, 2, 4, 5, 6, // 0b01110100 (116) + 1, 3, 7, 0, 2, 4, 5, 6, // 0b01110101 (117) + 0, 3, 7, 1, 2, 4, 5, 6, // 0b01110110 (118) + 3, 7, 0, 1, 2, 4, 5, 6, // 0b01110111 (119) + 0, 1, 2, 7, 3, 4, 5, 6, // 0b01111000 (120) + 1, 2, 7, 0, 3, 4, 5, 6, // 0b01111001 (121) + 0, 2, 7, 1, 3, 4, 5, 6, // 0b01111010 (122) + 2, 7, 0, 1, 3, 4, 5, 6, // 0b01111011 (123) + 0, 1, 7, 2, 3, 4, 5, 6, // 0b01111100 (124) + 1, 7, 0, 2, 3, 4, 5, 6, // 0b01111101 (125) + 0, 7, 1, 2, 3, 4, 5, 6, // 0b01111110 (126) + 7, 0, 1, 2, 3, 4, 5, 6, // 0b01111111 (127) + 0, 1, 2, 3, 4, 5, 6, 7, // 0b10000000 (128) + 1, 2, 3, 4, 5, 6, 0, 7, // 0b10000001 (129) + 0, 2, 3, 4, 5, 6, 1, 7, // 0b10000010 (130) + 2, 3, 4, 5, 6, 0, 1, 7, // 0b10000011 (131) + 0, 1, 3, 4, 5, 6, 2, 7, // 0b10000100 (132) + 1, 3, 4, 5, 6, 0, 2, 7, // 0b10000101 (133) + 0, 3, 4, 5, 6, 1, 2, 7, // 0b10000110 (134) + 3, 4, 5, 6, 0, 1, 2, 7, // 0b10000111 (135) + 0, 1, 2, 4, 5, 6, 3, 7, // 0b10001000 (136) + 1, 2, 4, 5, 6, 0, 3, 7, // 0b10001001 (137) + 0, 2, 4, 5, 6, 1, 3, 7, // 0b10001010 (138) + 2, 4, 5, 6, 0, 1, 3, 7, // 0b10001011 (139) + 0, 1, 4, 5, 6, 2, 3, 7, // 0b10001100 (140) + 1, 4, 5, 6, 0, 2, 3, 7, // 0b10001101 (141) + 0, 4, 5, 6, 1, 2, 3, 7, // 0b10001110 (142) + 4, 5, 6, 0, 1, 2, 3, 7, // 0b10001111 (143) + 0, 1, 2, 3, 5, 6, 4, 7, // 0b10010000 (144) + 1, 2, 3, 5, 6, 0, 4, 7, // 0b10010001 (145) + 0, 2, 3, 5, 6, 1, 4, 7, // 0b10010010 (146) + 2, 3, 5, 6, 0, 1, 4, 7, // 0b10010011 (147) + 0, 1, 3, 5, 6, 2, 4, 7, // 0b10010100 (148) + 1, 3, 5, 6, 0, 2, 4, 7, // 0b10010101 (149) + 0, 3, 5, 6, 1, 2, 4, 7, // 0b10010110 (150) + 3, 5, 6, 0, 1, 2, 4, 7, // 0b10010111 (151) + 0, 1, 2, 5, 6, 3, 4, 7, // 0b10011000 (152) + 1, 2, 5, 6, 0, 3, 4, 7, // 0b10011001 (153) + 0, 2, 5, 6, 1, 3, 4, 7, // 0b10011010 (154) + 2, 5, 6, 0, 1, 3, 4, 7, // 0b10011011 (155) + 0, 1, 5, 6, 2, 3, 4, 7, // 0b10011100 (156) + 1, 5, 6, 0, 2, 3, 4, 7, // 0b10011101 (157) + 0, 5, 6, 1, 2, 3, 4, 7, // 0b10011110 (158) + 5, 6, 0, 1, 2, 3, 4, 7, // 0b10011111 (159) + 0, 1, 2, 3, 4, 6, 5, 7, // 0b10100000 (160) + 1, 2, 3, 4, 6, 0, 5, 7, // 0b10100001 (161) + 0, 2, 3, 4, 6, 1, 5, 7, // 0b10100010 (162) + 2, 3, 4, 6, 0, 1, 5, 7, // 0b10100011 (163) + 0, 1, 3, 4, 6, 2, 5, 7, // 0b10100100 (164) + 1, 3, 4, 6, 0, 2, 5, 7, // 0b10100101 (165) + 0, 3, 4, 6, 1, 2, 5, 7, // 0b10100110 (166) + 3, 4, 6, 0, 1, 2, 5, 7, // 0b10100111 (167) + 0, 1, 2, 4, 6, 3, 5, 7, // 0b10101000 (168) + 1, 2, 4, 6, 0, 3, 5, 7, // 0b10101001 (169) + 0, 2, 4, 6, 1, 3, 5, 7, // 0b10101010 (170) + 2, 4, 6, 0, 1, 3, 5, 7, // 0b10101011 (171) + 0, 1, 4, 6, 2, 3, 5, 7, // 0b10101100 (172) + 1, 4, 6, 0, 2, 3, 5, 7, // 0b10101101 (173) + 0, 4, 6, 1, 2, 3, 5, 7, // 0b10101110 (174) + 4, 6, 0, 1, 2, 3, 5, 7, // 0b10101111 (175) + 0, 1, 2, 3, 6, 4, 5, 7, // 0b10110000 (176) + 1, 2, 3, 6, 0, 4, 5, 7, // 0b10110001 (177) + 0, 2, 3, 6, 1, 4, 5, 7, // 0b10110010 (178) + 2, 3, 6, 0, 1, 4, 5, 7, // 0b10110011 (179) + 0, 1, 3, 6, 2, 4, 5, 7, // 0b10110100 (180) + 1, 3, 6, 0, 2, 4, 5, 7, // 0b10110101 (181) + 0, 3, 6, 1, 2, 4, 5, 7, // 0b10110110 (182) + 3, 6, 0, 1, 2, 4, 5, 7, // 0b10110111 (183) + 0, 1, 2, 6, 3, 4, 5, 7, // 0b10111000 (184) + 1, 2, 6, 0, 3, 4, 5, 7, // 0b10111001 (185) + 0, 2, 6, 1, 3, 4, 5, 7, // 0b10111010 (186) + 2, 6, 0, 1, 3, 4, 5, 7, // 0b10111011 (187) + 0, 1, 6, 2, 3, 4, 5, 7, // 0b10111100 (188) + 1, 6, 0, 2, 3, 4, 5, 7, // 0b10111101 (189) + 0, 6, 1, 2, 3, 4, 5, 7, // 0b10111110 (190) + 6, 0, 1, 2, 3, 4, 5, 7, // 0b10111111 (191) + 0, 1, 2, 3, 4, 5, 6, 7, // 0b11000000 (192) + 1, 2, 3, 4, 5, 0, 6, 7, // 0b11000001 (193) + 0, 2, 3, 4, 5, 1, 6, 7, // 0b11000010 (194) + 2, 3, 4, 5, 0, 1, 6, 7, // 0b11000011 (195) + 0, 1, 3, 4, 5, 2, 6, 7, // 0b11000100 (196) + 1, 3, 4, 5, 0, 2, 6, 7, // 0b11000101 (197) + 0, 3, 4, 5, 1, 2, 6, 7, // 0b11000110 (198) + 3, 4, 5, 0, 1, 2, 6, 7, // 0b11000111 (199) + 0, 1, 2, 4, 5, 3, 6, 7, // 0b11001000 (200) + 1, 2, 4, 5, 0, 3, 6, 7, // 0b11001001 (201) + 0, 2, 4, 5, 1, 3, 6, 7, // 0b11001010 (202) + 2, 4, 5, 0, 1, 3, 6, 7, // 0b11001011 (203) + 0, 1, 4, 5, 2, 3, 6, 7, // 0b11001100 (204) + 1, 4, 5, 0, 2, 3, 6, 7, // 0b11001101 (205) + 0, 4, 5, 1, 2, 3, 6, 7, // 0b11001110 (206) + 4, 5, 0, 1, 2, 3, 6, 7, // 0b11001111 (207) + 0, 1, 2, 3, 5, 4, 6, 7, // 0b11010000 (208) + 1, 2, 3, 5, 0, 4, 6, 7, // 0b11010001 (209) + 0, 2, 3, 5, 1, 4, 6, 7, // 0b11010010 (210) + 2, 3, 5, 0, 1, 4, 6, 7, // 0b11010011 (211) + 0, 1, 3, 5, 2, 4, 6, 7, // 0b11010100 (212) + 1, 3, 5, 0, 2, 4, 6, 7, // 0b11010101 (213) + 0, 3, 5, 1, 2, 4, 6, 7, // 0b11010110 (214) + 3, 5, 0, 1, 2, 4, 6, 7, // 0b11010111 (215) + 0, 1, 2, 5, 3, 4, 6, 7, // 0b11011000 (216) + 1, 2, 5, 0, 3, 4, 6, 7, // 0b11011001 (217) + 0, 2, 5, 1, 3, 4, 6, 7, // 0b11011010 (218) + 2, 5, 0, 1, 3, 4, 6, 7, // 0b11011011 (219) + 0, 1, 5, 2, 3, 4, 6, 7, // 0b11011100 (220) + 1, 5, 0, 2, 3, 4, 6, 7, // 0b11011101 (221) + 0, 5, 1, 2, 3, 4, 6, 7, // 0b11011110 (222) + 5, 0, 1, 2, 3, 4, 6, 7, // 0b11011111 (223) + 0, 1, 2, 3, 4, 5, 6, 7, // 0b11100000 (224) + 1, 2, 3, 4, 0, 5, 6, 7, // 0b11100001 (225) + 0, 2, 3, 4, 1, 5, 6, 7, // 0b11100010 (226) + 2, 3, 4, 0, 1, 5, 6, 7, // 0b11100011 (227) + 0, 1, 3, 4, 2, 5, 6, 7, // 0b11100100 (228) + 1, 3, 4, 0, 2, 5, 6, 7, // 0b11100101 (229) + 0, 3, 4, 1, 2, 5, 6, 7, // 0b11100110 (230) + 3, 4, 0, 1, 2, 5, 6, 7, // 0b11100111 (231) + 0, 1, 2, 4, 3, 5, 6, 7, // 0b11101000 (232) + 1, 2, 4, 0, 3, 5, 6, 7, // 0b11101001 (233) + 0, 2, 4, 1, 3, 5, 6, 7, // 0b11101010 (234) + 2, 4, 0, 1, 3, 5, 6, 7, // 0b11101011 (235) + 0, 1, 4, 2, 3, 5, 6, 7, // 0b11101100 (236) + 1, 4, 0, 2, 3, 5, 6, 7, // 0b11101101 (237) + 0, 4, 1, 2, 3, 5, 6, 7, // 0b11101110 (238) + 4, 0, 1, 2, 3, 5, 6, 7, // 0b11101111 (239) + 0, 1, 2, 3, 4, 5, 6, 7, // 0b11110000 (240) + 1, 2, 3, 0, 4, 5, 6, 7, // 0b11110001 (241) + 0, 2, 3, 1, 4, 5, 6, 7, // 0b11110010 (242) + 2, 3, 0, 1, 4, 5, 6, 7, // 0b11110011 (243) + 0, 1, 3, 2, 4, 5, 6, 7, // 0b11110100 (244) + 1, 3, 0, 2, 4, 5, 6, 7, // 0b11110101 (245) + 0, 3, 1, 2, 4, 5, 6, 7, // 0b11110110 (246) + 3, 0, 1, 2, 4, 5, 6, 7, // 0b11110111 (247) + 0, 1, 2, 3, 4, 5, 6, 7, // 0b11111000 (248) + 1, 2, 0, 3, 4, 5, 6, 7, // 0b11111001 (249) + 0, 2, 1, 3, 4, 5, 6, 7, // 0b11111010 (250) + 2, 0, 1, 3, 4, 5, 6, 7, // 0b11111011 (251) + 0, 1, 2, 3, 4, 5, 6, 7, // 0b11111100 (252) + 1, 0, 2, 3, 4, 5, 6, 7, // 0b11111101 (253) + 0, 1, 2, 3, 4, 5, 6, 7, // 0b11111110 (254) + 0, 1, 2, 3, 4, 5, 6, 7, // 0b11111111 (255) +}; + +} + diff --git a/src/coreclr/src/gc/vxsort/machine_traits.avx2.h b/src/coreclr/src/gc/vxsort/machine_traits.avx2.h new file mode 100644 index 000000000000..1944b57a18f1 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/machine_traits.avx2.h @@ -0,0 +1,297 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// +// Created by dans on 6/1/20. +// + +#ifndef VXSORT_MACHINE_TRAITS_AVX2_H +#define VXSORT_MACHINE_TRAITS_AVX2_H + +#include "vxsort_targets_enable_avx2.h" + +#include +//#include +#include + +#include "defs.h" +#include "machine_traits.h" + +#define i2d _mm256_castsi256_pd +#define d2i _mm256_castpd_si256 +#define i2s _mm256_castsi256_ps +#define s2i _mm256_castps_si256 +#define s2d _mm256_castps_pd +#define d2s _mm256_castpd_ps + +namespace vxsort { +extern const int8_t perm_table_64[128]; +extern const int8_t perm_table_32[2048]; + +static void not_supported() +{ + assert(!"operation is unsupported"); +} + +#ifdef _DEBUG +// in _DEBUG, we #define return to be something more complicated, +// containing a statement, so #define away constexpr for _DEBUG +#define constexpr +#endif //_DEBUG + +template <> +class vxsort_machine_traits { + public: + typedef __m256i TV; + typedef uint32_t TMASK; + + static constexpr bool supports_compress_writes() { return false; } + + static INLINE TV load_vec(TV* p) { return _mm256_lddqu_si256(p); } + + static INLINE void store_vec(TV* ptr, TV v) { _mm256_storeu_si256(ptr, v); } + + static void store_compress_vec(TV* ptr, TV v, TMASK mask) { not_supported(); } + + static INLINE TV partition_vector(TV v, int mask) { + assert(mask >= 0); + assert(mask <= 255); + return s2i(_mm256_permutevar8x32_ps(i2s(v), _mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)(perm_table_32 + mask * 8))))); + } + + static INLINE TV broadcast(int32_t pivot) { return _mm256_set1_epi32(pivot); } + static INLINE TMASK get_cmpgt_mask(TV a, TV b) { return _mm256_movemask_ps(i2s(_mm256_cmpgt_epi32(a, b))); } + + static TV shift_right(TV v, int i) { return _mm256_srli_epi32(v, i); } + static TV shift_left(TV v, int i) { return _mm256_slli_epi32(v, i); } + + static INLINE TV add(TV a, TV b) { return _mm256_add_epi32(a, b); } + static INLINE TV sub(TV a, TV b) { return _mm256_sub_epi32(a, b); }; +}; + +template <> +class vxsort_machine_traits { + public: + typedef __m256i TV; + typedef uint32_t TMASK; + + static constexpr bool supports_compress_writes() { return false; } + + static INLINE TV load_vec(TV* p) { return _mm256_lddqu_si256(p); } + + static INLINE void store_vec(TV* ptr, TV v) { _mm256_storeu_si256(ptr, v); } + + static void store_compress_vec(TV* ptr, TV v, TMASK mask) { not_supported(); } + + static INLINE TV partition_vector(TV v, int mask) { + assert(mask >= 0); + assert(mask <= 255); + return s2i(_mm256_permutevar8x32_ps(i2s(v), _mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)(perm_table_32 + mask * 8))))); + } + + static INLINE TV broadcast(uint32_t pivot) { return _mm256_set1_epi32(pivot); } + static INLINE TMASK get_cmpgt_mask(TV a, TV b) { + __m256i top_bit = _mm256_set1_epi32(1U << 31); + return _mm256_movemask_ps(i2s(_mm256_cmpgt_epi32(_mm256_xor_si256(top_bit, a), _mm256_xor_si256(top_bit, b)))); + } + + static TV shift_right(TV v, int i) { return _mm256_srli_epi32(v, i); } + static TV shift_left(TV v, int i) { return _mm256_slli_epi32(v, i); } + + static INLINE TV add(TV a, TV b) { return _mm256_add_epi32(a, b); } + static INLINE TV sub(TV a, TV b) { return _mm256_sub_epi32(a, b); }; +}; + +template <> +class vxsort_machine_traits { + public: + typedef __m256 TV; + typedef uint32_t TMASK; + + static constexpr bool supports_compress_writes() { return false; } + + static INLINE TV load_vec(TV* p) { return _mm256_loadu_ps((float*)p); } + + static INLINE void store_vec(TV* ptr, TV v) { _mm256_storeu_ps((float*)ptr, v); } + + static void store_compress_vec(TV* ptr, TV v, TMASK mask) { not_supported(); } + + static INLINE TV partition_vector(TV v, int mask) { + assert(mask >= 0); + assert(mask <= 255); + return _mm256_permutevar8x32_ps(v, _mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)(perm_table_32 + mask * 8)))); + } + + static INLINE TV broadcast(float pivot) { return _mm256_set1_ps(pivot); } + + static INLINE TMASK get_cmpgt_mask(TV a, TV b) { + /// 0x0E: Greater-than (ordered, signaling) \n + /// 0x1E: Greater-than (ordered, non-signaling) + return _mm256_movemask_ps(_mm256_cmp_ps(a, b, _CMP_GT_OS)); + } + + static INLINE TV add(TV a, TV b) { return _mm256_add_ps(a, b); } + static INLINE TV sub(TV a, TV b) { return _mm256_sub_ps(a, b); }; + +}; + +template <> +class vxsort_machine_traits { + public: + typedef __m256i TV; + typedef uint32_t TMASK; + + static constexpr bool supports_compress_writes() { return false; } + + static INLINE TV load_vec(TV* p) { return _mm256_lddqu_si256(p); } + + static INLINE void store_vec(TV* ptr, TV v) { _mm256_storeu_si256(ptr, v); } + + static void store_compress_vec(TV* ptr, TV v, TMASK mask) { not_supported(); } + + static INLINE TV partition_vector(TV v, int mask) { + assert(mask >= 0); + assert(mask <= 15); + return s2i(_mm256_permutevar8x32_ps(i2s(v), _mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)(perm_table_64 + mask * 8))))); + } + + static INLINE TV broadcast(int64_t pivot) { return _mm256_set1_epi64x(pivot); } + static INLINE TMASK get_cmpgt_mask(TV a, TV b) { return _mm256_movemask_pd(i2d(_mm256_cmpgt_epi64(a, b))); } + + static TV shift_right(TV v, int i) { return _mm256_srli_epi64(v, i); } + static TV shift_left(TV v, int i) { return _mm256_slli_epi64(v, i); } + + static INLINE TV add(TV a, TV b) { return _mm256_add_epi64(a, b); } + static INLINE TV sub(TV a, TV b) { return _mm256_sub_epi64(a, b); }; + + + + static INLINE TV pack_ordered(TV a, TV b) { + a = _mm256_permute4x64_epi64(_mm256_shuffle_epi32(a, _MM_PERM_DBCA), _MM_PERM_DBCA); + b = _mm256_permute4x64_epi64(_mm256_shuffle_epi32(b, _MM_PERM_DBCA), _MM_PERM_CADB); + return _mm256_blend_epi32(a, b, 0b11110000); + } + + static INLINE TV pack_unordered(TV a, TV b) { + b = _mm256_shuffle_epi32(b, _MM_PERM_CDAB); + return _mm256_blend_epi32(a, b, 0b10101010); + } + + static INLINE void unpack_ordered_signed(TV p, TV& u1, TV& u2) { + auto p01 = _mm256_extracti128_si256(p, 0); + auto p02 = _mm256_extracti128_si256(p, 1); + + u1 = _mm256_cvtepi32_epi64(p01); + u2 = _mm256_cvtepi32_epi64(p02); + + } + + static INLINE void unpack_ordered_unsigned(TV p, TV& u1, TV& u2) { + auto p01 = _mm256_extracti128_si256(p, 0); + auto p02 = _mm256_extracti128_si256(p, 1); + + u1 = _mm256_cvtepu32_epi64(p01); + u2 = _mm256_cvtepu32_epi64(p02); + + } + +/* + template<> + static INLINE TV pack_ordered(TV a, TV b) { + a = _mm256_permute4x64_epi64(_mm256_shuffle_epi32(a, _MM_PERM_DBCA), _MM_PERM_DBCA); + b = _mm256_permute4x64_epi64(_mm256_shuffle_epi32(b, _MM_PERM_DBCA), _MM_PERM_CADB); + return _mm256_blend_epi32(a, b, 0b11110000); + } + + template<> + static INLINE typename vxsort_machine_traits::TV pack_unordered(TV a, TV b) { + b = _mm256_shuffle_epi32(b, _MM_PERM_CDAB); + return _mm256_blend_epi32(a, b, 0b10101010); + } + + */ + + + +}; + +template <> +class vxsort_machine_traits { + public: + typedef __m256i TV; + typedef uint32_t TMASK; + + static constexpr bool supports_compress_writes() { return false; } + + static INLINE TV load_vec(TV* p) { return _mm256_lddqu_si256(p); } + + static INLINE void store_vec(TV* ptr, TV v) { _mm256_storeu_si256(ptr, v); } + + static void store_compress_vec(TV* ptr, TV v, TMASK mask) { not_supported(); } + + static INLINE TV partition_vector(TV v, int mask) { + assert(mask >= 0); + assert(mask <= 15); + return s2i(_mm256_permutevar8x32_ps(i2s(v), _mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)(perm_table_64 + mask * 8))))); + } + static INLINE TV broadcast(int64_t pivot) { return _mm256_set1_epi64x(pivot); } + static INLINE TMASK get_cmpgt_mask(TV a, TV b) { + __m256i top_bit = _mm256_set1_epi64x(1LLU << 63); + return _mm256_movemask_pd(i2d(_mm256_cmpgt_epi64(_mm256_xor_si256(top_bit, a), _mm256_xor_si256(top_bit, b)))); + } + + static INLINE TV shift_right(TV v, int i) { return _mm256_srli_epi64(v, i); } + static INLINE TV shift_left(TV v, int i) { return _mm256_slli_epi64(v, i); } + + static INLINE TV add(TV a, TV b) { return _mm256_add_epi64(a, b); } + static INLINE TV sub(TV a, TV b) { return _mm256_sub_epi64(a, b); }; +}; + +template <> +class vxsort_machine_traits { + public: + typedef __m256d TV; + typedef uint32_t TMASK; + + static constexpr bool supports_compress_writes() { return false; } + + static INLINE TV load_vec(TV* p) { return _mm256_loadu_pd((double*)p); } + + static INLINE void store_vec(TV* ptr, TV v) { _mm256_storeu_pd((double*)ptr, v); } + + static void store_compress_vec(TV* ptr, TV v, TMASK mask) { not_supported(); } + + static INLINE TV partition_vector(TV v, int mask) { + assert(mask >= 0); + assert(mask <= 15); + return s2d(_mm256_permutevar8x32_ps(d2s(v), _mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)(perm_table_64 + mask * 8))))); + } + + static INLINE TV broadcast(double pivot) { return _mm256_set1_pd(pivot); } + static INLINE TMASK get_cmpgt_mask(TV a, TV b) { + /// 0x0E: Greater-than (ordered, signaling) \n + /// 0x1E: Greater-than (ordered, non-signaling) + return _mm256_movemask_pd(_mm256_cmp_pd(a, b, _CMP_GT_OS)); + } + + static INLINE TV add(TV a, TV b) { return _mm256_add_pd(a, b); } + static INLINE TV sub(TV a, TV b) { return _mm256_sub_pd(a, b); }; +}; + +} + +#undef i2d +#undef d2i +#undef i2s +#undef s2i +#undef s2d +#undef d2s + +#ifdef _DEBUG +#undef constexpr +#endif //_DEBUG + +#include "vxsort_targets_disable.h" + + +#endif // VXSORT_VXSORT_AVX2_H diff --git a/src/coreclr/src/gc/vxsort/machine_traits.avx512.h b/src/coreclr/src/gc/vxsort/machine_traits.avx512.h new file mode 100644 index 000000000000..443654a39b60 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/machine_traits.avx512.h @@ -0,0 +1,230 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// +// Created by dans on 6/1/20. +// + +#ifndef VXSORT_MACHINE_TRAITS_AVX512_H +#define VXSORT_MACHINE_TRAITS_AVX512_H + +#include "vxsort_targets_enable_avx512.h" + +#include +#include "defs.h" +#include "machine_traits.h" + +#ifdef _DEBUG +// in _DEBUG, we #define return to be something more complicated, +// containing a statement, so #define away constexpr for _DEBUG +#define constexpr +#endif //_DEBUG + +namespace vxsort { +template <> +class vxsort_machine_traits { + public: + typedef __m512i TV; + typedef __mmask16 TMASK; + + static constexpr bool supports_compress_writes() { return true; } + + static INLINE TV load_vec(TV* p) { + return _mm512_loadu_si512(p); + } + + static INLINE void store_vec(TV* ptr, TV v) { + _mm512_storeu_si512(ptr, v); + } + + // Will never be called + static INLINE TV partition_vector(TV v, int mask) { return v; } + + + static void store_compress_vec(TV *ptr, TV v, TMASK mask) { + _mm512_mask_compressstoreu_epi32(ptr, mask, v); + } + + static INLINE TV broadcast(int32_t pivot) { + return _mm512_set1_epi32(pivot); + } + + static INLINE TMASK get_cmpgt_mask(TV a, TV b) { + return _mm512_cmp_epi32_mask(a, b, _MM_CMPINT_GT); + } +}; + +template <> +class vxsort_machine_traits { + public: + typedef __m512i TV; + typedef __mmask16 TMASK; + + static constexpr bool supports_compress_writes() { return true; } + + static INLINE TV load_vec(TV* p) { + return _mm512_loadu_si512(p); + } + + static INLINE void store_vec(TV* ptr, TV v) { + _mm512_storeu_si512(ptr, v); + } + + // Will never be called + static INLINE TV partition_vector(TV v, int mask) { return v; } + + + static void store_compress_vec(TV *ptr, TV v, TMASK mask) { + _mm512_mask_compressstoreu_epi32(ptr, mask, v); + } + + static INLINE TV broadcast(uint32_t pivot) { + return _mm512_set1_epi32(pivot); + } + + static INLINE TMASK get_cmpgt_mask(TV a, TV b) { + return _mm512_cmp_epu32_mask(a, b, _MM_CMPINT_GT); + } +}; + +template <> +class vxsort_machine_traits { + public: + typedef __m512 TV; + typedef __mmask16 TMASK; + + static constexpr bool supports_compress_writes() { return true; } + + static INLINE TV load_vec(TV* p) { + return _mm512_loadu_ps(p); + } + + static INLINE void store_vec(TV* ptr, TV v) { + _mm512_storeu_ps(ptr, v); + } + + // Will never be called + static INLINE TV partition_vector(TV v, int mask) { return v; } + + + static void store_compress_vec(TV *ptr, TV v, TMASK mask) { + _mm512_mask_compressstoreu_ps(ptr, mask, v); + } + + static INLINE TV broadcast(float pivot) { + return _mm512_set1_ps(pivot); + } + + static INLINE TMASK get_cmpgt_mask(TV a, TV b) { + return _mm512_cmp_ps_mask(a, b, _CMP_GT_OS); + } +}; + +template <> +class vxsort_machine_traits { + public: + typedef __m512i TV; + typedef __mmask8 TMASK; + + static bool supports_compress_writes() { return true; } + + static INLINE TV load_vec(TV* p) { + return _mm512_loadu_si512(p); + } + + static INLINE void store_vec(TV* ptr, TV v) { + _mm512_storeu_si512(ptr, v); + } + + // Will never be called + static INLINE TV partition_vector(TV v, int mask) { return v; } + + + static void store_compress_vec(TV *ptr, TV v, TMASK mask) { + _mm512_mask_compressstoreu_epi64(ptr, mask, v); + } + + static INLINE TV broadcast(int64_t pivot) { + return _mm512_set1_epi64(pivot); + } + + static INLINE TMASK get_cmpgt_mask(TV a, TV b) { + return _mm512_cmp_epi64_mask(a, b, _MM_CMPINT_GT); + } +}; + +template <> +class vxsort_machine_traits { + public: + typedef __m512i TV; + typedef __mmask8 TMASK; + + static constexpr bool supports_compress_writes() { return true; } + + static INLINE TV load_vec(TV* p) { + return _mm512_loadu_si512(p); + } + + static INLINE void store_vec(TV* ptr, TV v) { + _mm512_storeu_si512(ptr, v); + } + + // Will never be called + static INLINE TV partition_vector(TV v, int mask) { return v; } + + + static void store_compress_vec(TV *ptr, TV v, TMASK mask) { + _mm512_mask_compressstoreu_epi64(ptr, mask, v); + } + + static INLINE TV broadcast(uint64_t pivot) { + return _mm512_set1_epi64(pivot); + } + + static INLINE TMASK get_cmpgt_mask(TV a, TV b) { + return _mm512_cmp_epu64_mask(a, b, _MM_CMPINT_GT); + } +}; + +template <> +class vxsort_machine_traits { + public: + typedef __m512d TV; + typedef __mmask8 TMASK; + + static constexpr bool supports_compress_writes() { return true; } + + static INLINE TV load_vec(TV* p) { + return _mm512_loadu_pd(p); + } + + static INLINE void store_vec(TV* ptr, TV v) { + _mm512_storeu_pd(ptr, v); + } + + // Will never be called + static INLINE TV partition_vector(TV v, int mask) { return v; } + + + static void store_compress_vec(TV *ptr, TV v, TMASK mask) { + _mm512_mask_compressstoreu_pd(ptr, mask, v); + } + + static INLINE TV broadcast(double pivot) { + return _mm512_set1_pd(pivot); + } + + static INLINE TMASK get_cmpgt_mask(TV a, TV b) { + return _mm512_cmp_pd_mask(a, b, _CMP_GT_OS); + } +}; + +} + +#ifdef _DEBUG +#undef constexpr +#endif //_DEBUG + +#include "vxsort_targets_disable.h" + +#endif // VXSORT_VXSORT_AVX512_H diff --git a/src/coreclr/src/gc/vxsort/machine_traits.h b/src/coreclr/src/gc/vxsort/machine_traits.h new file mode 100644 index 000000000000..cd31ed365777 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/machine_traits.h @@ -0,0 +1,53 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// +// Created by dans on 6/1/20. +// + +#ifndef VXSORT_MACHINE_TRAITS_H +#define VXSORT_MACHINE_TRAITS_H + +//#include + +namespace vxsort { + +enum vector_machine { + NONE, + AVX2, + AVX512, + SVE, +}; + +template +struct vxsort_machine_traits { + public: + typedef int TV; + typedef int TMASK; + + static constexpr bool supports_compress_writes(); + + static TV load_vec(TV* ptr); + static void store_vec(TV* ptr, TV v); + static void store_compress_vec(TV* ptr, TV v, TMASK mask); + static TV partition_vector(TV v, int mask); + static TV broadcast(T pivot); + static TMASK get_cmpgt_mask(TV a, TV b); + + static TV shift_right(TV v, int i); + static TV shift_left(TV v, int i); + + static TV add(TV a, TV b); + static TV sub(TV a, TV b); + + static TV pack_ordered(TV a, TV b); + static TV pack_unordered(TV a, TV b); + + static void unpack_ordered_signed(TV p, TV& u1, TV& u2); + static void unpack_ordered_unsigned(TV p, TV& u1, TV& u2); + + +}; +} + +#endif // VXSORT_MACHINE_TRAITS_H diff --git a/src/coreclr/src/gc/vxsort/packer.h b/src/coreclr/src/gc/vxsort/packer.h new file mode 100644 index 000000000000..4c7257a58f17 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/packer.h @@ -0,0 +1,199 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef VXSORT_PACKER_H +#define VXSORT_PACKER_H + +#include "vxsort_targets_enable_avx2.h" + +//#include +//#include +//#include +#//include +#include "alignment.h" +#include "machine_traits.h" +#include "machine_traits.avx2.h" +#include "machine_traits.avx512.h" + +#include +//#include + +namespace vxsort { + +template +class packer { + static_assert(Shift <= 31, "Shift must be in the range 0..31"); + using MT = vxsort_machine_traits; + typedef typename MT::TV TV; + typedef typename std::make_unsigned::type TU; + static const int N = sizeof(TV) / sizeof(TFrom); + typedef alignment_hint AH; + + static const size_t ALIGN = AH::ALIGN; + static const size_t ALIGN_MASK = ALIGN - 1; + + static INLINE void pack_scalar(const TFrom offset, TFrom*& mem_read, TTo*& mem_write) { + auto d = *(mem_read++); + if (Shift > 0) + d >>= Shift; + d -= offset; + *(mem_write++) = (TTo) d; + } + + static INLINE void unpack_scalar(const TFrom offset, TTo*& mem_read, TFrom*& mem_write) { + TFrom d = *(--mem_read); + + d += offset; + + if (Shift > 0) + d = (TFrom) (((TU) d) << Shift); + + *(--mem_write) = d; + } + + public: + + static void pack(TFrom *mem, size_t len, TFrom base) { + TFrom offset = (base >> Shift) - std::numeric_limits::Min(); + auto baseVec = MT::broadcast(offset); + + auto pre_aligned_mem = reinterpret_cast(reinterpret_cast(mem) & ~ALIGN_MASK); + + auto mem_read = mem; + auto mem_write = (TTo *) mem; + + // Include a "special" pass to handle very short scalar + // passes + if (MinLength < N && len < N) { + while (len--) { + pack_scalar(offset, mem_read, mem_write); + } + return; + } + + // We have at least + // one vector worth of data to handle + // Let's try to align to vector size first + + if (pre_aligned_mem < mem) { + const auto alignment_point = pre_aligned_mem + N; + len -= (alignment_point - mem_read); + while (mem_read < alignment_point) { + pack_scalar(offset, mem_read, mem_write); + } + } + + assert(AH::is_aligned(mem_read)); + + auto memv_read = (TV *) mem_read; + auto memv_write = (TV *) mem_write; + + auto lenv = len / N; + len -= (lenv * N); + + while (lenv >= 2) { + assert(memv_read >= memv_write); + + auto d01 = MT::load_vec(memv_read); + auto d02 = MT::load_vec(memv_read + 1); + if (Shift > 0) { // This is statically compiled in/out + d01 = MT::shift_right(d01, Shift); + d02 = MT::shift_right(d02, Shift); + } + d01 = MT::sub(d01, baseVec); + d02 = MT::sub(d02, baseVec); + + auto packed_data = RespectPackingOrder ? + MT::pack_ordered(d01, d02) : + MT::pack_unordered(d01, d02); + + MT::store_vec(memv_write, packed_data); + + memv_read += 2; + memv_write++; + lenv -= 2; + } + + len += lenv * N; + + mem_read = (TFrom *) memv_read; + mem_write = (TTo *) memv_write; + + while (len-- > 0) { + pack_scalar(offset, mem_read, mem_write); + } + } + + static void unpack(TTo *mem, size_t len, TFrom base) { + TFrom offset = (base >> Shift) - std::numeric_limits::Min(); + auto baseVec = MT::broadcast(offset); + + auto mem_read = mem + len; + auto mem_write = ((TFrom *) mem) + len; + + + // Include a "special" pass to handle very short scalar + // passers + if (MinLength < 2*N && len < 2*N) { + while (len--) { + unpack_scalar(offset, mem_read, mem_write); + } + return; + } + + auto pre_aligned_mem = reinterpret_cast(reinterpret_cast(mem_read) & ~ALIGN_MASK); + + if (pre_aligned_mem < mem_read) { + len -= (mem_read - pre_aligned_mem); + while (mem_read > pre_aligned_mem) { + unpack_scalar(offset, mem_read, mem_write); + } + } + + assert(AH::is_aligned(mem_read)); + + auto lenv = len / (N*2); + auto memv_read = ((TV *) mem_read) - 1; + auto memv_write = ((TV *) mem_write) - 2; + len -= lenv * N * 2; + + while (lenv > 0) { + assert(memv_read <= memv_write); + TV d01, d02; + + if (std::numeric_limits::Min() < 0) + MT::unpack_ordered_signed(MT::load_vec(memv_read), d01, d02); + else + MT::unpack_ordered_unsigned(MT::load_vec(memv_read), d01, d02); + + d01 = MT::add(d01, baseVec); + d02 = MT::add(d02, baseVec); + + if (Shift > 0) { // This is statically compiled in/out + d01 = MT::shift_left(d01, Shift); + d02 = MT::shift_left(d02, Shift); + } + + MT::store_vec(memv_write, d01); + MT::store_vec(memv_write + 1, d02); + + memv_read -= 1; + memv_write -= 2; + lenv--; + } + + mem_read = (TTo *) (memv_read + 1); + mem_write = (TFrom *) (memv_write + 2); + + while (len-- > 0) { + unpack_scalar(offset, mem_read, mem_write); + } + } + +}; + +} + +#include "vxsort_targets_disable.h" + +#endif // VXSORT_PACKER_H diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp new file mode 100644 index 000000000000..17ddcd815057 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp @@ -0,0 +1,30 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "common.h" +#include "bitonic_sort.AVX2.int32_t.generated.h" + +using namespace vxsort; + +void vxsort::smallsort::bitonic::sort(int32_t *ptr, size_t length) { + const int N = 8; + + switch(length / N) { + case 1: sort_01v(ptr); break; + case 2: sort_02v(ptr); break; + case 3: sort_03v(ptr); break; + case 4: sort_04v(ptr); break; + case 5: sort_05v(ptr); break; + case 6: sort_06v(ptr); break; + case 7: sort_07v(ptr); break; + case 8: sort_08v(ptr); break; + case 9: sort_09v(ptr); break; + case 10: sort_10v(ptr); break; + case 11: sort_11v(ptr); break; + case 12: sort_12v(ptr); break; + case 13: sort_13v(ptr); break; + case 14: sort_14v(ptr); break; + case 15: sort_15v(ptr); break; + case 16: sort_16v(ptr); break; + } +} diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.h b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.h new file mode 100644 index 000000000000..79bdbcc870d4 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.h @@ -0,0 +1,1530 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +///////////////////////////////////////////////////////////////////////////// +//// +// This file was auto-generated by a tool at 2020-06-22 05:27:48 +// +// It is recommended you DO NOT directly edit this file but instead edit +// the code-generator that generated this source file instead. +///////////////////////////////////////////////////////////////////////////// + +#ifndef BITONIC_SORT_AVX2_INT32_T_H +#define BITONIC_SORT_AVX2_INT32_T_H + +#ifdef __GNUC__ +#ifdef __clang__ +#pragma clang attribute push (__attribute__((target("avx2"))), apply_to = any(function)) +#else +#pragma GCC push_options +#pragma GCC target("avx2") +#endif +#endif + +#include +#include "bitonic_sort.h" + +#define i2d _mm256_castsi256_pd +#define d2i _mm256_castpd_si256 +#define i2s _mm256_castsi256_ps +#define s2i _mm256_castps_si256 +#define s2d _mm256_castps_pd +#define d2s _mm256_castpd_ps + +namespace vxsort { +namespace smallsort { +template<> struct bitonic { +public: + + static INLINE void sort_01v_ascending(__m256i& d01) { + __m256i min, max, s; + + s = _mm256_shuffle_epi32(d01, 0xB1); + + min = _mm256_min_epi32(s, d01); + max = _mm256_max_epi32(s, d01); + d01 = _mm256_blend_epi32(min, max, 0xAA); + + s = _mm256_shuffle_epi32(d01, 0x1B); + + min = _mm256_min_epi32(s, d01); + max = _mm256_max_epi32(s, d01); + d01 = _mm256_blend_epi32(min, max, 0xCC); + + s = _mm256_shuffle_epi32(d01, 0xB1); + + min = _mm256_min_epi32(s, d01); + max = _mm256_max_epi32(s, d01); + d01 = _mm256_blend_epi32(min, max, 0xAA); + + s = d2i(_mm256_permute4x64_pd(i2d(_mm256_shuffle_epi32(d01, 0x1B)), 0x4E)); + min = _mm256_min_epi32(s, d01); + max = _mm256_max_epi32(s, d01); + d01 = _mm256_blend_epi32(min, max, 0xF0); + + s = _mm256_shuffle_epi32(d01, 0x4E); + min = _mm256_min_epi32(s, d01); + max = _mm256_max_epi32(s, d01); + d01 = _mm256_blend_epi32(min, max, 0xCC); + + s = _mm256_shuffle_epi32(d01, 0xB1); + min = _mm256_min_epi32(s, d01); + max = _mm256_max_epi32(s, d01); + d01 = _mm256_blend_epi32(min, max, 0xAA); +} + static INLINE void sort_01v_merge_ascending(__m256i& d01) { + __m256i min, max, s; + + s = d2i(_mm256_permute4x64_pd(i2d(d01), 0x4E)); + min = _mm256_min_epi32(s, d01); + max = _mm256_max_epi32(s, d01); + d01 = _mm256_blend_epi32(min, max, 0xF0); + + s = _mm256_shuffle_epi32(d01, 0x4E); + + min = _mm256_min_epi32(s, d01); + max = _mm256_max_epi32(s, d01); + d01 = _mm256_blend_epi32(min, max, 0xCC); + + s = _mm256_shuffle_epi32(d01, 0xB1); + + min = _mm256_min_epi32(s, d01); + max = _mm256_max_epi32(s, d01); + d01 = _mm256_blend_epi32(min, max, 0xAA); + } + static INLINE void sort_01v_descending(__m256i& d01) { + __m256i min, max, s; + + s = _mm256_shuffle_epi32(d01, 0xB1); + + min = _mm256_min_epi32(s, d01); + max = _mm256_max_epi32(s, d01); + d01 = _mm256_blend_epi32(max, min, 0xAA); + + s = _mm256_shuffle_epi32(d01, 0x1B); + + min = _mm256_min_epi32(s, d01); + max = _mm256_max_epi32(s, d01); + d01 = _mm256_blend_epi32(max, min, 0xCC); + + s = _mm256_shuffle_epi32(d01, 0xB1); + + min = _mm256_min_epi32(s, d01); + max = _mm256_max_epi32(s, d01); + d01 = _mm256_blend_epi32(max, min, 0xAA); + + s = d2i(_mm256_permute4x64_pd(i2d(_mm256_shuffle_epi32(d01, 0x1B)), 0x4E)); + min = _mm256_min_epi32(s, d01); + max = _mm256_max_epi32(s, d01); + d01 = _mm256_blend_epi32(max, min, 0xF0); + + s = _mm256_shuffle_epi32(d01, 0x4E); + min = _mm256_min_epi32(s, d01); + max = _mm256_max_epi32(s, d01); + d01 = _mm256_blend_epi32(max, min, 0xCC); + + s = _mm256_shuffle_epi32(d01, 0xB1); + min = _mm256_min_epi32(s, d01); + max = _mm256_max_epi32(s, d01); + d01 = _mm256_blend_epi32(max, min, 0xAA); +} + static INLINE void sort_01v_merge_descending(__m256i& d01) { + __m256i min, max, s; + + s = d2i(_mm256_permute4x64_pd(i2d(d01), 0x4E)); + min = _mm256_min_epi32(s, d01); + max = _mm256_max_epi32(s, d01); + d01 = _mm256_blend_epi32(max, min, 0xF0); + + s = _mm256_shuffle_epi32(d01, 0x4E); + + min = _mm256_min_epi32(s, d01); + max = _mm256_max_epi32(s, d01); + d01 = _mm256_blend_epi32(max, min, 0xCC); + + s = _mm256_shuffle_epi32(d01, 0xB1); + + min = _mm256_min_epi32(s, d01); + max = _mm256_max_epi32(s, d01); + d01 = _mm256_blend_epi32(max, min, 0xAA); + } + static INLINE void sort_02v_ascending(__m256i& d01, __m256i& d02) { + __m256i tmp; + + sort_01v_ascending(d01); + sort_01v_descending(d02); + + tmp = d02; + + d02 = _mm256_max_epi32(d01, d02); + d01 = _mm256_min_epi32(d01, tmp); + + sort_01v_merge_ascending(d01); + sort_01v_merge_ascending(d02); + } + static INLINE void sort_02v_descending(__m256i& d01, __m256i& d02) { + __m256i tmp; + + sort_01v_descending(d01); + sort_01v_ascending(d02); + + tmp = d02; + + d02 = _mm256_max_epi32(d01, d02); + d01 = _mm256_min_epi32(d01, tmp); + + sort_01v_merge_descending(d01); + sort_01v_merge_descending(d02); + } + static INLINE void sort_02v_merge_ascending(__m256i& d01, __m256i& d02) { + __m256i tmp; + + tmp = d01; + + d01 = _mm256_min_epi32(d02, d01); + + d02 = _mm256_max_epi32(d02, tmp); + + sort_01v_merge_ascending(d01); + sort_01v_merge_ascending(d02); + } + static INLINE void sort_02v_merge_descending(__m256i& d01, __m256i& d02) { + __m256i tmp; + + tmp = d01; + + d01 = _mm256_min_epi32(d02, d01); + + d02 = _mm256_max_epi32(d02, tmp); + + sort_01v_merge_descending(d01); + sort_01v_merge_descending(d02); + } + static INLINE void sort_03v_ascending(__m256i& d01, __m256i& d02, __m256i& d03) { + __m256i tmp; + + sort_02v_ascending(d01, d02); + sort_01v_descending(d03); + + tmp = d03; + + d03 = _mm256_max_epi32(d02, d03); + d02 = _mm256_min_epi32(d02, tmp); + + sort_02v_merge_ascending(d01, d02); + sort_01v_merge_ascending(d03); + } + static INLINE void sort_03v_descending(__m256i& d01, __m256i& d02, __m256i& d03) { + __m256i tmp; + + sort_02v_descending(d01, d02); + sort_01v_ascending(d03); + + tmp = d03; + + d03 = _mm256_max_epi32(d02, d03); + d02 = _mm256_min_epi32(d02, tmp); + + sort_02v_merge_descending(d01, d02); + sort_01v_merge_descending(d03); + } + static INLINE void sort_03v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03) { + __m256i tmp; + + tmp = d01; + + d01 = _mm256_min_epi32(d03, d01); + + d03 = _mm256_max_epi32(d03, tmp); + + sort_02v_merge_ascending(d01, d02); + sort_01v_merge_ascending(d03); + } + static INLINE void sort_03v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03) { + __m256i tmp; + + tmp = d01; + + d01 = _mm256_min_epi32(d03, d01); + + d03 = _mm256_max_epi32(d03, tmp); + + sort_02v_merge_descending(d01, d02); + sort_01v_merge_descending(d03); + } + static INLINE void sort_04v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { + __m256i tmp; + + sort_02v_ascending(d01, d02); + sort_02v_descending(d03, d04); + + tmp = d03; + + d03 = _mm256_max_epi32(d02, d03); + d02 = _mm256_min_epi32(d02, tmp); + + tmp = d04; + + d04 = _mm256_max_epi32(d01, d04); + d01 = _mm256_min_epi32(d01, tmp); + + sort_02v_merge_ascending(d01, d02); + sort_02v_merge_ascending(d03, d04); + } + static INLINE void sort_04v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { + __m256i tmp; + + sort_02v_descending(d01, d02); + sort_02v_ascending(d03, d04); + + tmp = d03; + + d03 = _mm256_max_epi32(d02, d03); + d02 = _mm256_min_epi32(d02, tmp); + + tmp = d04; + + d04 = _mm256_max_epi32(d01, d04); + d01 = _mm256_min_epi32(d01, tmp); + + sort_02v_merge_descending(d01, d02); + sort_02v_merge_descending(d03, d04); + } + static INLINE void sort_04v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { + __m256i tmp; + + tmp = d01; + + d01 = _mm256_min_epi32(d03, d01); + + d03 = _mm256_max_epi32(d03, tmp); + + tmp = d02; + + d02 = _mm256_min_epi32(d04, d02); + + d04 = _mm256_max_epi32(d04, tmp); + + sort_02v_merge_ascending(d01, d02); + sort_02v_merge_ascending(d03, d04); + } + static INLINE void sort_04v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { + __m256i tmp; + + tmp = d01; + + d01 = _mm256_min_epi32(d03, d01); + + d03 = _mm256_max_epi32(d03, tmp); + + tmp = d02; + + d02 = _mm256_min_epi32(d04, d02); + + d04 = _mm256_max_epi32(d04, tmp); + + sort_02v_merge_descending(d01, d02); + sort_02v_merge_descending(d03, d04); + } + static INLINE void sort_05v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05) { + __m256i tmp; + + sort_04v_ascending(d01, d02, d03, d04); + sort_01v_descending(d05); + + tmp = d05; + + d05 = _mm256_max_epi32(d04, d05); + d04 = _mm256_min_epi32(d04, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_01v_merge_ascending(d05); + } + static INLINE void sort_05v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05) { + __m256i tmp; + + sort_04v_descending(d01, d02, d03, d04); + sort_01v_ascending(d05); + + tmp = d05; + + d05 = _mm256_max_epi32(d04, d05); + d04 = _mm256_min_epi32(d04, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_01v_merge_descending(d05); + } + static INLINE void sort_05v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05) { + __m256i tmp; + + tmp = d01; + + d01 = _mm256_min_epi32(d05, d01); + + d05 = _mm256_max_epi32(d05, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_01v_merge_ascending(d05); + } + static INLINE void sort_05v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05) { + __m256i tmp; + + tmp = d01; + + d01 = _mm256_min_epi32(d05, d01); + + d05 = _mm256_max_epi32(d05, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_01v_merge_descending(d05); + } + static INLINE void sort_06v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06) { + __m256i tmp; + + sort_04v_ascending(d01, d02, d03, d04); + sort_02v_descending(d05, d06); + + tmp = d05; + + d05 = _mm256_max_epi32(d04, d05); + d04 = _mm256_min_epi32(d04, tmp); + + tmp = d06; + + d06 = _mm256_max_epi32(d03, d06); + d03 = _mm256_min_epi32(d03, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_02v_merge_ascending(d05, d06); + } + static INLINE void sort_06v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06) { + __m256i tmp; + + sort_04v_descending(d01, d02, d03, d04); + sort_02v_ascending(d05, d06); + + tmp = d05; + + d05 = _mm256_max_epi32(d04, d05); + d04 = _mm256_min_epi32(d04, tmp); + + tmp = d06; + + d06 = _mm256_max_epi32(d03, d06); + d03 = _mm256_min_epi32(d03, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_02v_merge_descending(d05, d06); + } + static INLINE void sort_06v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06) { + __m256i tmp; + + tmp = d01; + + d01 = _mm256_min_epi32(d05, d01); + + d05 = _mm256_max_epi32(d05, tmp); + + tmp = d02; + + d02 = _mm256_min_epi32(d06, d02); + + d06 = _mm256_max_epi32(d06, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_02v_merge_ascending(d05, d06); + } + static INLINE void sort_06v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06) { + __m256i tmp; + + tmp = d01; + + d01 = _mm256_min_epi32(d05, d01); + + d05 = _mm256_max_epi32(d05, tmp); + + tmp = d02; + + d02 = _mm256_min_epi32(d06, d02); + + d06 = _mm256_max_epi32(d06, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_02v_merge_descending(d05, d06); + } + static INLINE void sort_07v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07) { + __m256i tmp; + + sort_04v_ascending(d01, d02, d03, d04); + sort_03v_descending(d05, d06, d07); + + tmp = d05; + + d05 = _mm256_max_epi32(d04, d05); + d04 = _mm256_min_epi32(d04, tmp); + + tmp = d06; + + d06 = _mm256_max_epi32(d03, d06); + d03 = _mm256_min_epi32(d03, tmp); + + tmp = d07; + + d07 = _mm256_max_epi32(d02, d07); + d02 = _mm256_min_epi32(d02, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_03v_merge_ascending(d05, d06, d07); + } + static INLINE void sort_07v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07) { + __m256i tmp; + + sort_04v_descending(d01, d02, d03, d04); + sort_03v_ascending(d05, d06, d07); + + tmp = d05; + + d05 = _mm256_max_epi32(d04, d05); + d04 = _mm256_min_epi32(d04, tmp); + + tmp = d06; + + d06 = _mm256_max_epi32(d03, d06); + d03 = _mm256_min_epi32(d03, tmp); + + tmp = d07; + + d07 = _mm256_max_epi32(d02, d07); + d02 = _mm256_min_epi32(d02, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_03v_merge_descending(d05, d06, d07); + } + static INLINE void sort_07v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07) { + __m256i tmp; + + tmp = d01; + + d01 = _mm256_min_epi32(d05, d01); + + d05 = _mm256_max_epi32(d05, tmp); + + tmp = d02; + + d02 = _mm256_min_epi32(d06, d02); + + d06 = _mm256_max_epi32(d06, tmp); + + tmp = d03; + + d03 = _mm256_min_epi32(d07, d03); + + d07 = _mm256_max_epi32(d07, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_03v_merge_ascending(d05, d06, d07); + } + static INLINE void sort_07v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07) { + __m256i tmp; + + tmp = d01; + + d01 = _mm256_min_epi32(d05, d01); + + d05 = _mm256_max_epi32(d05, tmp); + + tmp = d02; + + d02 = _mm256_min_epi32(d06, d02); + + d06 = _mm256_max_epi32(d06, tmp); + + tmp = d03; + + d03 = _mm256_min_epi32(d07, d03); + + d07 = _mm256_max_epi32(d07, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_03v_merge_descending(d05, d06, d07); + } + static INLINE void sort_08v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { + __m256i tmp; + + sort_04v_ascending(d01, d02, d03, d04); + sort_04v_descending(d05, d06, d07, d08); + + tmp = d05; + + d05 = _mm256_max_epi32(d04, d05); + d04 = _mm256_min_epi32(d04, tmp); + + tmp = d06; + + d06 = _mm256_max_epi32(d03, d06); + d03 = _mm256_min_epi32(d03, tmp); + + tmp = d07; + + d07 = _mm256_max_epi32(d02, d07); + d02 = _mm256_min_epi32(d02, tmp); + + tmp = d08; + + d08 = _mm256_max_epi32(d01, d08); + d01 = _mm256_min_epi32(d01, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_04v_merge_ascending(d05, d06, d07, d08); + } + static INLINE void sort_08v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { + __m256i tmp; + + sort_04v_descending(d01, d02, d03, d04); + sort_04v_ascending(d05, d06, d07, d08); + + tmp = d05; + + d05 = _mm256_max_epi32(d04, d05); + d04 = _mm256_min_epi32(d04, tmp); + + tmp = d06; + + d06 = _mm256_max_epi32(d03, d06); + d03 = _mm256_min_epi32(d03, tmp); + + tmp = d07; + + d07 = _mm256_max_epi32(d02, d07); + d02 = _mm256_min_epi32(d02, tmp); + + tmp = d08; + + d08 = _mm256_max_epi32(d01, d08); + d01 = _mm256_min_epi32(d01, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_04v_merge_descending(d05, d06, d07, d08); + } + static INLINE void sort_08v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { + __m256i tmp; + + tmp = d01; + + d01 = _mm256_min_epi32(d05, d01); + + d05 = _mm256_max_epi32(d05, tmp); + + tmp = d02; + + d02 = _mm256_min_epi32(d06, d02); + + d06 = _mm256_max_epi32(d06, tmp); + + tmp = d03; + + d03 = _mm256_min_epi32(d07, d03); + + d07 = _mm256_max_epi32(d07, tmp); + + tmp = d04; + + d04 = _mm256_min_epi32(d08, d04); + + d08 = _mm256_max_epi32(d08, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_04v_merge_ascending(d05, d06, d07, d08); + } + static INLINE void sort_08v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { + __m256i tmp; + + tmp = d01; + + d01 = _mm256_min_epi32(d05, d01); + + d05 = _mm256_max_epi32(d05, tmp); + + tmp = d02; + + d02 = _mm256_min_epi32(d06, d02); + + d06 = _mm256_max_epi32(d06, tmp); + + tmp = d03; + + d03 = _mm256_min_epi32(d07, d03); + + d07 = _mm256_max_epi32(d07, tmp); + + tmp = d04; + + d04 = _mm256_min_epi32(d08, d04); + + d08 = _mm256_max_epi32(d08, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_04v_merge_descending(d05, d06, d07, d08); + } + static INLINE void sort_09v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09) { + __m256i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_01v_descending(d09); + + tmp = d09; + + d09 = _mm256_max_epi32(d08, d09); + d08 = _mm256_min_epi32(d08, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_01v_merge_ascending(d09); + } + static INLINE void sort_09v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09) { + __m256i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_01v_ascending(d09); + + tmp = d09; + + d09 = _mm256_max_epi32(d08, d09); + d08 = _mm256_min_epi32(d08, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_01v_merge_descending(d09); + } + static INLINE void sort_10v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10) { + __m256i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_02v_descending(d09, d10); + + tmp = d09; + + d09 = _mm256_max_epi32(d08, d09); + d08 = _mm256_min_epi32(d08, tmp); + + tmp = d10; + + d10 = _mm256_max_epi32(d07, d10); + d07 = _mm256_min_epi32(d07, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_02v_merge_ascending(d09, d10); + } + static INLINE void sort_10v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10) { + __m256i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_02v_ascending(d09, d10); + + tmp = d09; + + d09 = _mm256_max_epi32(d08, d09); + d08 = _mm256_min_epi32(d08, tmp); + + tmp = d10; + + d10 = _mm256_max_epi32(d07, d10); + d07 = _mm256_min_epi32(d07, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_02v_merge_descending(d09, d10); + } + static INLINE void sort_11v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11) { + __m256i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_03v_descending(d09, d10, d11); + + tmp = d09; + + d09 = _mm256_max_epi32(d08, d09); + d08 = _mm256_min_epi32(d08, tmp); + + tmp = d10; + + d10 = _mm256_max_epi32(d07, d10); + d07 = _mm256_min_epi32(d07, tmp); + + tmp = d11; + + d11 = _mm256_max_epi32(d06, d11); + d06 = _mm256_min_epi32(d06, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_03v_merge_ascending(d09, d10, d11); + } + static INLINE void sort_11v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11) { + __m256i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_03v_ascending(d09, d10, d11); + + tmp = d09; + + d09 = _mm256_max_epi32(d08, d09); + d08 = _mm256_min_epi32(d08, tmp); + + tmp = d10; + + d10 = _mm256_max_epi32(d07, d10); + d07 = _mm256_min_epi32(d07, tmp); + + tmp = d11; + + d11 = _mm256_max_epi32(d06, d11); + d06 = _mm256_min_epi32(d06, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_03v_merge_descending(d09, d10, d11); + } + static INLINE void sort_12v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12) { + __m256i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_04v_descending(d09, d10, d11, d12); + + tmp = d09; + + d09 = _mm256_max_epi32(d08, d09); + d08 = _mm256_min_epi32(d08, tmp); + + tmp = d10; + + d10 = _mm256_max_epi32(d07, d10); + d07 = _mm256_min_epi32(d07, tmp); + + tmp = d11; + + d11 = _mm256_max_epi32(d06, d11); + d06 = _mm256_min_epi32(d06, tmp); + + tmp = d12; + + d12 = _mm256_max_epi32(d05, d12); + d05 = _mm256_min_epi32(d05, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_04v_merge_ascending(d09, d10, d11, d12); + } + static INLINE void sort_12v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12) { + __m256i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_04v_ascending(d09, d10, d11, d12); + + tmp = d09; + + d09 = _mm256_max_epi32(d08, d09); + d08 = _mm256_min_epi32(d08, tmp); + + tmp = d10; + + d10 = _mm256_max_epi32(d07, d10); + d07 = _mm256_min_epi32(d07, tmp); + + tmp = d11; + + d11 = _mm256_max_epi32(d06, d11); + d06 = _mm256_min_epi32(d06, tmp); + + tmp = d12; + + d12 = _mm256_max_epi32(d05, d12); + d05 = _mm256_min_epi32(d05, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_04v_merge_descending(d09, d10, d11, d12); + } + static INLINE void sort_13v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13) { + __m256i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_05v_descending(d09, d10, d11, d12, d13); + + tmp = d09; + + d09 = _mm256_max_epi32(d08, d09); + d08 = _mm256_min_epi32(d08, tmp); + + tmp = d10; + + d10 = _mm256_max_epi32(d07, d10); + d07 = _mm256_min_epi32(d07, tmp); + + tmp = d11; + + d11 = _mm256_max_epi32(d06, d11); + d06 = _mm256_min_epi32(d06, tmp); + + tmp = d12; + + d12 = _mm256_max_epi32(d05, d12); + d05 = _mm256_min_epi32(d05, tmp); + + tmp = d13; + + d13 = _mm256_max_epi32(d04, d13); + d04 = _mm256_min_epi32(d04, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_05v_merge_ascending(d09, d10, d11, d12, d13); + } + static INLINE void sort_13v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13) { + __m256i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_05v_ascending(d09, d10, d11, d12, d13); + + tmp = d09; + + d09 = _mm256_max_epi32(d08, d09); + d08 = _mm256_min_epi32(d08, tmp); + + tmp = d10; + + d10 = _mm256_max_epi32(d07, d10); + d07 = _mm256_min_epi32(d07, tmp); + + tmp = d11; + + d11 = _mm256_max_epi32(d06, d11); + d06 = _mm256_min_epi32(d06, tmp); + + tmp = d12; + + d12 = _mm256_max_epi32(d05, d12); + d05 = _mm256_min_epi32(d05, tmp); + + tmp = d13; + + d13 = _mm256_max_epi32(d04, d13); + d04 = _mm256_min_epi32(d04, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_05v_merge_descending(d09, d10, d11, d12, d13); + } + static INLINE void sort_14v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14) { + __m256i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_06v_descending(d09, d10, d11, d12, d13, d14); + + tmp = d09; + + d09 = _mm256_max_epi32(d08, d09); + d08 = _mm256_min_epi32(d08, tmp); + + tmp = d10; + + d10 = _mm256_max_epi32(d07, d10); + d07 = _mm256_min_epi32(d07, tmp); + + tmp = d11; + + d11 = _mm256_max_epi32(d06, d11); + d06 = _mm256_min_epi32(d06, tmp); + + tmp = d12; + + d12 = _mm256_max_epi32(d05, d12); + d05 = _mm256_min_epi32(d05, tmp); + + tmp = d13; + + d13 = _mm256_max_epi32(d04, d13); + d04 = _mm256_min_epi32(d04, tmp); + + tmp = d14; + + d14 = _mm256_max_epi32(d03, d14); + d03 = _mm256_min_epi32(d03, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_06v_merge_ascending(d09, d10, d11, d12, d13, d14); + } + static INLINE void sort_14v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14) { + __m256i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_06v_ascending(d09, d10, d11, d12, d13, d14); + + tmp = d09; + + d09 = _mm256_max_epi32(d08, d09); + d08 = _mm256_min_epi32(d08, tmp); + + tmp = d10; + + d10 = _mm256_max_epi32(d07, d10); + d07 = _mm256_min_epi32(d07, tmp); + + tmp = d11; + + d11 = _mm256_max_epi32(d06, d11); + d06 = _mm256_min_epi32(d06, tmp); + + tmp = d12; + + d12 = _mm256_max_epi32(d05, d12); + d05 = _mm256_min_epi32(d05, tmp); + + tmp = d13; + + d13 = _mm256_max_epi32(d04, d13); + d04 = _mm256_min_epi32(d04, tmp); + + tmp = d14; + + d14 = _mm256_max_epi32(d03, d14); + d03 = _mm256_min_epi32(d03, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_06v_merge_descending(d09, d10, d11, d12, d13, d14); + } + static INLINE void sort_15v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15) { + __m256i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_07v_descending(d09, d10, d11, d12, d13, d14, d15); + + tmp = d09; + + d09 = _mm256_max_epi32(d08, d09); + d08 = _mm256_min_epi32(d08, tmp); + + tmp = d10; + + d10 = _mm256_max_epi32(d07, d10); + d07 = _mm256_min_epi32(d07, tmp); + + tmp = d11; + + d11 = _mm256_max_epi32(d06, d11); + d06 = _mm256_min_epi32(d06, tmp); + + tmp = d12; + + d12 = _mm256_max_epi32(d05, d12); + d05 = _mm256_min_epi32(d05, tmp); + + tmp = d13; + + d13 = _mm256_max_epi32(d04, d13); + d04 = _mm256_min_epi32(d04, tmp); + + tmp = d14; + + d14 = _mm256_max_epi32(d03, d14); + d03 = _mm256_min_epi32(d03, tmp); + + tmp = d15; + + d15 = _mm256_max_epi32(d02, d15); + d02 = _mm256_min_epi32(d02, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_07v_merge_ascending(d09, d10, d11, d12, d13, d14, d15); + } + static INLINE void sort_15v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15) { + __m256i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_07v_ascending(d09, d10, d11, d12, d13, d14, d15); + + tmp = d09; + + d09 = _mm256_max_epi32(d08, d09); + d08 = _mm256_min_epi32(d08, tmp); + + tmp = d10; + + d10 = _mm256_max_epi32(d07, d10); + d07 = _mm256_min_epi32(d07, tmp); + + tmp = d11; + + d11 = _mm256_max_epi32(d06, d11); + d06 = _mm256_min_epi32(d06, tmp); + + tmp = d12; + + d12 = _mm256_max_epi32(d05, d12); + d05 = _mm256_min_epi32(d05, tmp); + + tmp = d13; + + d13 = _mm256_max_epi32(d04, d13); + d04 = _mm256_min_epi32(d04, tmp); + + tmp = d14; + + d14 = _mm256_max_epi32(d03, d14); + d03 = _mm256_min_epi32(d03, tmp); + + tmp = d15; + + d15 = _mm256_max_epi32(d02, d15); + d02 = _mm256_min_epi32(d02, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_07v_merge_descending(d09, d10, d11, d12, d13, d14, d15); + } + static INLINE void sort_16v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15, __m256i& d16) { + __m256i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_08v_descending(d09, d10, d11, d12, d13, d14, d15, d16); + + tmp = d09; + + d09 = _mm256_max_epi32(d08, d09); + d08 = _mm256_min_epi32(d08, tmp); + + tmp = d10; + + d10 = _mm256_max_epi32(d07, d10); + d07 = _mm256_min_epi32(d07, tmp); + + tmp = d11; + + d11 = _mm256_max_epi32(d06, d11); + d06 = _mm256_min_epi32(d06, tmp); + + tmp = d12; + + d12 = _mm256_max_epi32(d05, d12); + d05 = _mm256_min_epi32(d05, tmp); + + tmp = d13; + + d13 = _mm256_max_epi32(d04, d13); + d04 = _mm256_min_epi32(d04, tmp); + + tmp = d14; + + d14 = _mm256_max_epi32(d03, d14); + d03 = _mm256_min_epi32(d03, tmp); + + tmp = d15; + + d15 = _mm256_max_epi32(d02, d15); + d02 = _mm256_min_epi32(d02, tmp); + + tmp = d16; + + d16 = _mm256_max_epi32(d01, d16); + d01 = _mm256_min_epi32(d01, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_08v_merge_ascending(d09, d10, d11, d12, d13, d14, d15, d16); + } + static INLINE void sort_16v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15, __m256i& d16) { + __m256i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_08v_ascending(d09, d10, d11, d12, d13, d14, d15, d16); + + tmp = d09; + + d09 = _mm256_max_epi32(d08, d09); + d08 = _mm256_min_epi32(d08, tmp); + + tmp = d10; + + d10 = _mm256_max_epi32(d07, d10); + d07 = _mm256_min_epi32(d07, tmp); + + tmp = d11; + + d11 = _mm256_max_epi32(d06, d11); + d06 = _mm256_min_epi32(d06, tmp); + + tmp = d12; + + d12 = _mm256_max_epi32(d05, d12); + d05 = _mm256_min_epi32(d05, tmp); + + tmp = d13; + + d13 = _mm256_max_epi32(d04, d13); + d04 = _mm256_min_epi32(d04, tmp); + + tmp = d14; + + d14 = _mm256_max_epi32(d03, d14); + d03 = _mm256_min_epi32(d03, tmp); + + tmp = d15; + + d15 = _mm256_max_epi32(d02, d15); + d02 = _mm256_min_epi32(d02, tmp); + + tmp = d16; + + d16 = _mm256_max_epi32(d01, d16); + d01 = _mm256_min_epi32(d01, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_08v_merge_descending(d09, d10, d11, d12, d13, d14, d15, d16); + } + + static NOINLINE void sort_01v(int32_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + sort_01v_ascending(d01); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); +} + + static NOINLINE void sort_02v(int32_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + sort_02v_ascending(d01, d02); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); +} + + static NOINLINE void sort_03v(int32_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + sort_03v_ascending(d01, d02, d03); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); +} + + static NOINLINE void sort_04v(int32_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + sort_04v_ascending(d01, d02, d03, d04); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); +} + + static NOINLINE void sort_05v(int32_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + sort_05v_ascending(d01, d02, d03, d04, d05); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); +} + + static NOINLINE void sort_06v(int32_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + sort_06v_ascending(d01, d02, d03, d04, d05, d06); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); +} + + static NOINLINE void sort_07v(int32_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + sort_07v_ascending(d01, d02, d03, d04, d05, d06, d07); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); +} + + static NOINLINE void sort_08v(int32_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); + _mm256_storeu_si256((__m256i *) ptr + 7, d08); +} + + static NOINLINE void sort_09v(int32_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; + sort_09v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); + _mm256_storeu_si256((__m256i *) ptr + 7, d08); + _mm256_storeu_si256((__m256i *) ptr + 8, d09); +} + + static NOINLINE void sort_10v(int32_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; + __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; + sort_10v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); + _mm256_storeu_si256((__m256i *) ptr + 7, d08); + _mm256_storeu_si256((__m256i *) ptr + 8, d09); + _mm256_storeu_si256((__m256i *) ptr + 9, d10); +} + + static NOINLINE void sort_11v(int32_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; + __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; + __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; + sort_11v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); + _mm256_storeu_si256((__m256i *) ptr + 7, d08); + _mm256_storeu_si256((__m256i *) ptr + 8, d09); + _mm256_storeu_si256((__m256i *) ptr + 9, d10); + _mm256_storeu_si256((__m256i *) ptr + 10, d11); +} + + static NOINLINE void sort_12v(int32_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; + __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; + __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; + __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);; + sort_12v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); + _mm256_storeu_si256((__m256i *) ptr + 7, d08); + _mm256_storeu_si256((__m256i *) ptr + 8, d09); + _mm256_storeu_si256((__m256i *) ptr + 9, d10); + _mm256_storeu_si256((__m256i *) ptr + 10, d11); + _mm256_storeu_si256((__m256i *) ptr + 11, d12); +} + + static NOINLINE void sort_13v(int32_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; + __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; + __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; + __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);; + __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);; + sort_13v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); + _mm256_storeu_si256((__m256i *) ptr + 7, d08); + _mm256_storeu_si256((__m256i *) ptr + 8, d09); + _mm256_storeu_si256((__m256i *) ptr + 9, d10); + _mm256_storeu_si256((__m256i *) ptr + 10, d11); + _mm256_storeu_si256((__m256i *) ptr + 11, d12); + _mm256_storeu_si256((__m256i *) ptr + 12, d13); +} + + static NOINLINE void sort_14v(int32_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; + __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; + __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; + __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);; + __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);; + __m256i d14 = _mm256_lddqu_si256((__m256i const *) ptr + 13);; + sort_14v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); + _mm256_storeu_si256((__m256i *) ptr + 7, d08); + _mm256_storeu_si256((__m256i *) ptr + 8, d09); + _mm256_storeu_si256((__m256i *) ptr + 9, d10); + _mm256_storeu_si256((__m256i *) ptr + 10, d11); + _mm256_storeu_si256((__m256i *) ptr + 11, d12); + _mm256_storeu_si256((__m256i *) ptr + 12, d13); + _mm256_storeu_si256((__m256i *) ptr + 13, d14); +} + + static NOINLINE void sort_15v(int32_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; + __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; + __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; + __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);; + __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);; + __m256i d14 = _mm256_lddqu_si256((__m256i const *) ptr + 13);; + __m256i d15 = _mm256_lddqu_si256((__m256i const *) ptr + 14);; + sort_15v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); + _mm256_storeu_si256((__m256i *) ptr + 7, d08); + _mm256_storeu_si256((__m256i *) ptr + 8, d09); + _mm256_storeu_si256((__m256i *) ptr + 9, d10); + _mm256_storeu_si256((__m256i *) ptr + 10, d11); + _mm256_storeu_si256((__m256i *) ptr + 11, d12); + _mm256_storeu_si256((__m256i *) ptr + 12, d13); + _mm256_storeu_si256((__m256i *) ptr + 13, d14); + _mm256_storeu_si256((__m256i *) ptr + 14, d15); +} + + static NOINLINE void sort_16v(int32_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; + __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; + __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; + __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);; + __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);; + __m256i d14 = _mm256_lddqu_si256((__m256i const *) ptr + 13);; + __m256i d15 = _mm256_lddqu_si256((__m256i const *) ptr + 14);; + __m256i d16 = _mm256_lddqu_si256((__m256i const *) ptr + 15);; + sort_16v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15, d16); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); + _mm256_storeu_si256((__m256i *) ptr + 7, d08); + _mm256_storeu_si256((__m256i *) ptr + 8, d09); + _mm256_storeu_si256((__m256i *) ptr + 9, d10); + _mm256_storeu_si256((__m256i *) ptr + 10, d11); + _mm256_storeu_si256((__m256i *) ptr + 11, d12); + _mm256_storeu_si256((__m256i *) ptr + 12, d13); + _mm256_storeu_si256((__m256i *) ptr + 13, d14); + _mm256_storeu_si256((__m256i *) ptr + 14, d15); + _mm256_storeu_si256((__m256i *) ptr + 15, d16); +} + static void sort(int32_t *ptr, size_t length); + +}; +} +} + +#undef i2d +#undef d2i +#undef i2s +#undef s2i +#undef s2d +#undef d2s + +#ifdef __GNUC__ +#ifdef __clang__ +#pragma clang attribute pop +#else +#pragma GCC pop_options +#endif +#endif +#endif + diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp new file mode 100644 index 000000000000..00360ae70f0c --- /dev/null +++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp @@ -0,0 +1,30 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "common.h" +#include "bitonic_sort.AVX2.int64_t.generated.h" + +using namespace vxsort; + +void vxsort::smallsort::bitonic::sort(int64_t *ptr, size_t length) { + const int N = 4; + + switch(length / N) { + case 1: sort_01v(ptr); break; + case 2: sort_02v(ptr); break; + case 3: sort_03v(ptr); break; + case 4: sort_04v(ptr); break; + case 5: sort_05v(ptr); break; + case 6: sort_06v(ptr); break; + case 7: sort_07v(ptr); break; + case 8: sort_08v(ptr); break; + case 9: sort_09v(ptr); break; + case 10: sort_10v(ptr); break; + case 11: sort_11v(ptr); break; + case 12: sort_12v(ptr); break; + case 13: sort_13v(ptr); break; + case 14: sort_14v(ptr); break; + case 15: sort_15v(ptr); break; + case 16: sort_16v(ptr); break; + } +} diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.h b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.h new file mode 100644 index 000000000000..5e9d2fea0dcf --- /dev/null +++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.h @@ -0,0 +1,1490 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +///////////////////////////////////////////////////////////////////////////// +//// +// This file was auto-generated by a tool at 2020-06-22 05:27:48 +// +// It is recommended you DO NOT directly edit this file but instead edit +// the code-generator that generated this source file instead. +///////////////////////////////////////////////////////////////////////////// + +#ifndef BITONIC_SORT_AVX2_INT64_T_H +#define BITONIC_SORT_AVX2_INT64_T_H + +#ifdef __GNUC__ +#ifdef __clang__ +#pragma clang attribute push (__attribute__((target("avx2"))), apply_to = any(function)) +#else +#pragma GCC push_options +#pragma GCC target("avx2") +#endif +#endif + +#include +#include "bitonic_sort.h" + +#define i2d _mm256_castsi256_pd +#define d2i _mm256_castpd_si256 +#define i2s _mm256_castsi256_ps +#define s2i _mm256_castps_si256 +#define s2d _mm256_castps_pd +#define d2s _mm256_castpd_ps + +namespace vxsort { +namespace smallsort { +template<> struct bitonic { +public: + + static INLINE void sort_01v_ascending(__m256i& d01) { + __m256i min, max, s, cmp; + + s = d2i(_mm256_shuffle_pd(i2d(d01), i2d(d01), 0x5)); + cmp = _mm256_cmpgt_epi64(s, d01); + min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp))); + max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp))); + d01 = d2i(_mm256_blend_pd(i2d(min), i2d(max), 0xA)); + + s = d2i(_mm256_permute4x64_pd(i2d(d01), 0x1B)); + cmp = _mm256_cmpgt_epi64(s, d01); + min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp))); + max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp))); + d01 = d2i(_mm256_blend_pd(i2d(min), i2d(max), 0xC)); + + s = d2i(_mm256_shuffle_pd(i2d(d01), i2d(d01), 0x5)); + cmp = _mm256_cmpgt_epi64(s, d01); + min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp))); + max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp))); + d01 = d2i(_mm256_blend_pd(i2d(min), i2d(max), 0xA)); +} + static INLINE void sort_01v_merge_ascending(__m256i& d01) { + __m256i min, max, s, cmp; + + s = d2i(_mm256_permute4x64_pd(i2d(d01), 0x4E)); + cmp = _mm256_cmpgt_epi64(s, d01); + min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp))); + max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp))); + d01 = d2i(_mm256_blend_pd(i2d(min), i2d(max), 0xC)); + + s = d2i(_mm256_shuffle_pd(i2d(d01), i2d(d01), 0x5)); + cmp = _mm256_cmpgt_epi64(s, d01); + min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp))); + max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp))); + d01 = d2i(_mm256_blend_pd(i2d(min), i2d(max), 0xA)); + } + static INLINE void sort_01v_descending(__m256i& d01) { + __m256i min, max, s, cmp; + + s = d2i(_mm256_shuffle_pd(i2d(d01), i2d(d01), 0x5)); + cmp = _mm256_cmpgt_epi64(s, d01); + min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp))); + max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp))); + d01 = d2i(_mm256_blend_pd(i2d(max), i2d(min), 0xA)); + + s = d2i(_mm256_permute4x64_pd(i2d(d01), 0x1B)); + cmp = _mm256_cmpgt_epi64(s, d01); + min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp))); + max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp))); + d01 = d2i(_mm256_blend_pd(i2d(max), i2d(min), 0xC)); + + s = d2i(_mm256_shuffle_pd(i2d(d01), i2d(d01), 0x5)); + cmp = _mm256_cmpgt_epi64(s, d01); + min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp))); + max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp))); + d01 = d2i(_mm256_blend_pd(i2d(max), i2d(min), 0xA)); +} + static INLINE void sort_01v_merge_descending(__m256i& d01) { + __m256i min, max, s, cmp; + + s = d2i(_mm256_permute4x64_pd(i2d(d01), 0x4E)); + cmp = _mm256_cmpgt_epi64(s, d01); + min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp))); + max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp))); + d01 = d2i(_mm256_blend_pd(i2d(max), i2d(min), 0xC)); + + s = d2i(_mm256_shuffle_pd(i2d(d01), i2d(d01), 0x5)); + cmp = _mm256_cmpgt_epi64(s, d01); + min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp))); + max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp))); + d01 = d2i(_mm256_blend_pd(i2d(max), i2d(min), 0xA)); + } + static INLINE void sort_02v_ascending(__m256i& d01, __m256i& d02) { + __m256i tmp, cmp; + + sort_01v_ascending(d01); + sort_01v_descending(d02); + + tmp = d02; + cmp = _mm256_cmpgt_epi64(d01, d02); + d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(d01), i2d(cmp))); + d01 = d2i(_mm256_blendv_pd(i2d(d01), i2d(tmp), i2d(cmp))); + + sort_01v_merge_ascending(d01); + sort_01v_merge_ascending(d02); + } + static INLINE void sort_02v_descending(__m256i& d01, __m256i& d02) { + __m256i tmp, cmp; + + sort_01v_descending(d01); + sort_01v_ascending(d02); + + tmp = d02; + cmp = _mm256_cmpgt_epi64(d01, d02); + d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(d01), i2d(cmp))); + d01 = d2i(_mm256_blendv_pd(i2d(d01), i2d(tmp), i2d(cmp))); + + sort_01v_merge_descending(d01); + sort_01v_merge_descending(d02); + } + static INLINE void sort_02v_merge_ascending(__m256i& d01, __m256i& d02) { + __m256i tmp, cmp; + + tmp = d01; + cmp = _mm256_cmpgt_epi64(d02, d01); + d01 = d2i(_mm256_blendv_pd(i2d(d02), i2d(d01), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d02, tmp); + d02 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d02), i2d(cmp))); + + sort_01v_merge_ascending(d01); + sort_01v_merge_ascending(d02); + } + static INLINE void sort_02v_merge_descending(__m256i& d01, __m256i& d02) { + __m256i tmp, cmp; + + tmp = d01; + cmp = _mm256_cmpgt_epi64(d02, d01); + d01 = d2i(_mm256_blendv_pd(i2d(d02), i2d(d01), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d02, tmp); + d02 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d02), i2d(cmp))); + + sort_01v_merge_descending(d01); + sort_01v_merge_descending(d02); + } + static INLINE void sort_03v_ascending(__m256i& d01, __m256i& d02, __m256i& d03) { + __m256i tmp, cmp; + + sort_02v_ascending(d01, d02); + sort_01v_descending(d03); + + tmp = d03; + cmp = _mm256_cmpgt_epi64(d02, d03); + d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(d02), i2d(cmp))); + d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp))); + + sort_02v_merge_ascending(d01, d02); + sort_01v_merge_ascending(d03); + } + static INLINE void sort_03v_descending(__m256i& d01, __m256i& d02, __m256i& d03) { + __m256i tmp, cmp; + + sort_02v_descending(d01, d02); + sort_01v_ascending(d03); + + tmp = d03; + cmp = _mm256_cmpgt_epi64(d02, d03); + d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(d02), i2d(cmp))); + d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp))); + + sort_02v_merge_descending(d01, d02); + sort_01v_merge_descending(d03); + } + static INLINE void sort_03v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03) { + __m256i tmp, cmp; + + tmp = d01; + cmp = _mm256_cmpgt_epi64(d03, d01); + d01 = d2i(_mm256_blendv_pd(i2d(d03), i2d(d01), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d03, tmp); + d03 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d03), i2d(cmp))); + + sort_02v_merge_ascending(d01, d02); + sort_01v_merge_ascending(d03); + } + static INLINE void sort_03v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03) { + __m256i tmp, cmp; + + tmp = d01; + cmp = _mm256_cmpgt_epi64(d03, d01); + d01 = d2i(_mm256_blendv_pd(i2d(d03), i2d(d01), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d03, tmp); + d03 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d03), i2d(cmp))); + + sort_02v_merge_descending(d01, d02); + sort_01v_merge_descending(d03); + } + static INLINE void sort_04v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { + __m256i tmp, cmp; + + sort_02v_ascending(d01, d02); + sort_02v_descending(d03, d04); + + tmp = d03; + cmp = _mm256_cmpgt_epi64(d02, d03); + d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(d02), i2d(cmp))); + d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp))); + + tmp = d04; + cmp = _mm256_cmpgt_epi64(d01, d04); + d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(d01), i2d(cmp))); + d01 = d2i(_mm256_blendv_pd(i2d(d01), i2d(tmp), i2d(cmp))); + + sort_02v_merge_ascending(d01, d02); + sort_02v_merge_ascending(d03, d04); + } + static INLINE void sort_04v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { + __m256i tmp, cmp; + + sort_02v_descending(d01, d02); + sort_02v_ascending(d03, d04); + + tmp = d03; + cmp = _mm256_cmpgt_epi64(d02, d03); + d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(d02), i2d(cmp))); + d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp))); + + tmp = d04; + cmp = _mm256_cmpgt_epi64(d01, d04); + d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(d01), i2d(cmp))); + d01 = d2i(_mm256_blendv_pd(i2d(d01), i2d(tmp), i2d(cmp))); + + sort_02v_merge_descending(d01, d02); + sort_02v_merge_descending(d03, d04); + } + static INLINE void sort_04v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { + __m256i tmp, cmp; + + tmp = d01; + cmp = _mm256_cmpgt_epi64(d03, d01); + d01 = d2i(_mm256_blendv_pd(i2d(d03), i2d(d01), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d03, tmp); + d03 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d03), i2d(cmp))); + + tmp = d02; + cmp = _mm256_cmpgt_epi64(d04, d02); + d02 = d2i(_mm256_blendv_pd(i2d(d04), i2d(d02), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d04, tmp); + d04 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d04), i2d(cmp))); + + sort_02v_merge_ascending(d01, d02); + sort_02v_merge_ascending(d03, d04); + } + static INLINE void sort_04v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { + __m256i tmp, cmp; + + tmp = d01; + cmp = _mm256_cmpgt_epi64(d03, d01); + d01 = d2i(_mm256_blendv_pd(i2d(d03), i2d(d01), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d03, tmp); + d03 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d03), i2d(cmp))); + + tmp = d02; + cmp = _mm256_cmpgt_epi64(d04, d02); + d02 = d2i(_mm256_blendv_pd(i2d(d04), i2d(d02), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d04, tmp); + d04 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d04), i2d(cmp))); + + sort_02v_merge_descending(d01, d02); + sort_02v_merge_descending(d03, d04); + } + static INLINE void sort_05v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05) { + __m256i tmp, cmp; + + sort_04v_ascending(d01, d02, d03, d04); + sort_01v_descending(d05); + + tmp = d05; + cmp = _mm256_cmpgt_epi64(d04, d05); + d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d04), i2d(cmp))); + d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp))); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_01v_merge_ascending(d05); + } + static INLINE void sort_05v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05) { + __m256i tmp, cmp; + + sort_04v_descending(d01, d02, d03, d04); + sort_01v_ascending(d05); + + tmp = d05; + cmp = _mm256_cmpgt_epi64(d04, d05); + d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d04), i2d(cmp))); + d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp))); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_01v_merge_descending(d05); + } + static INLINE void sort_05v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05) { + __m256i tmp, cmp; + + tmp = d01; + cmp = _mm256_cmpgt_epi64(d05, d01); + d01 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d01), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d05, tmp); + d05 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d05), i2d(cmp))); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_01v_merge_ascending(d05); + } + static INLINE void sort_05v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05) { + __m256i tmp, cmp; + + tmp = d01; + cmp = _mm256_cmpgt_epi64(d05, d01); + d01 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d01), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d05, tmp); + d05 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d05), i2d(cmp))); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_01v_merge_descending(d05); + } + static INLINE void sort_06v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06) { + __m256i tmp, cmp; + + sort_04v_ascending(d01, d02, d03, d04); + sort_02v_descending(d05, d06); + + tmp = d05; + cmp = _mm256_cmpgt_epi64(d04, d05); + d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d04), i2d(cmp))); + d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp))); + + tmp = d06; + cmp = _mm256_cmpgt_epi64(d03, d06); + d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d03), i2d(cmp))); + d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp))); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_02v_merge_ascending(d05, d06); + } + static INLINE void sort_06v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06) { + __m256i tmp, cmp; + + sort_04v_descending(d01, d02, d03, d04); + sort_02v_ascending(d05, d06); + + tmp = d05; + cmp = _mm256_cmpgt_epi64(d04, d05); + d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d04), i2d(cmp))); + d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp))); + + tmp = d06; + cmp = _mm256_cmpgt_epi64(d03, d06); + d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d03), i2d(cmp))); + d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp))); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_02v_merge_descending(d05, d06); + } + static INLINE void sort_06v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06) { + __m256i tmp, cmp; + + tmp = d01; + cmp = _mm256_cmpgt_epi64(d05, d01); + d01 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d01), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d05, tmp); + d05 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d05), i2d(cmp))); + + tmp = d02; + cmp = _mm256_cmpgt_epi64(d06, d02); + d02 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d02), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d06, tmp); + d06 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d06), i2d(cmp))); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_02v_merge_ascending(d05, d06); + } + static INLINE void sort_06v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06) { + __m256i tmp, cmp; + + tmp = d01; + cmp = _mm256_cmpgt_epi64(d05, d01); + d01 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d01), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d05, tmp); + d05 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d05), i2d(cmp))); + + tmp = d02; + cmp = _mm256_cmpgt_epi64(d06, d02); + d02 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d02), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d06, tmp); + d06 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d06), i2d(cmp))); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_02v_merge_descending(d05, d06); + } + static INLINE void sort_07v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07) { + __m256i tmp, cmp; + + sort_04v_ascending(d01, d02, d03, d04); + sort_03v_descending(d05, d06, d07); + + tmp = d05; + cmp = _mm256_cmpgt_epi64(d04, d05); + d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d04), i2d(cmp))); + d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp))); + + tmp = d06; + cmp = _mm256_cmpgt_epi64(d03, d06); + d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d03), i2d(cmp))); + d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp))); + + tmp = d07; + cmp = _mm256_cmpgt_epi64(d02, d07); + d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(d02), i2d(cmp))); + d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp))); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_03v_merge_ascending(d05, d06, d07); + } + static INLINE void sort_07v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07) { + __m256i tmp, cmp; + + sort_04v_descending(d01, d02, d03, d04); + sort_03v_ascending(d05, d06, d07); + + tmp = d05; + cmp = _mm256_cmpgt_epi64(d04, d05); + d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d04), i2d(cmp))); + d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp))); + + tmp = d06; + cmp = _mm256_cmpgt_epi64(d03, d06); + d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d03), i2d(cmp))); + d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp))); + + tmp = d07; + cmp = _mm256_cmpgt_epi64(d02, d07); + d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(d02), i2d(cmp))); + d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp))); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_03v_merge_descending(d05, d06, d07); + } + static INLINE void sort_07v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07) { + __m256i tmp, cmp; + + tmp = d01; + cmp = _mm256_cmpgt_epi64(d05, d01); + d01 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d01), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d05, tmp); + d05 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d05), i2d(cmp))); + + tmp = d02; + cmp = _mm256_cmpgt_epi64(d06, d02); + d02 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d02), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d06, tmp); + d06 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d06), i2d(cmp))); + + tmp = d03; + cmp = _mm256_cmpgt_epi64(d07, d03); + d03 = d2i(_mm256_blendv_pd(i2d(d07), i2d(d03), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d07, tmp); + d07 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d07), i2d(cmp))); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_03v_merge_ascending(d05, d06, d07); + } + static INLINE void sort_07v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07) { + __m256i tmp, cmp; + + tmp = d01; + cmp = _mm256_cmpgt_epi64(d05, d01); + d01 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d01), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d05, tmp); + d05 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d05), i2d(cmp))); + + tmp = d02; + cmp = _mm256_cmpgt_epi64(d06, d02); + d02 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d02), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d06, tmp); + d06 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d06), i2d(cmp))); + + tmp = d03; + cmp = _mm256_cmpgt_epi64(d07, d03); + d03 = d2i(_mm256_blendv_pd(i2d(d07), i2d(d03), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d07, tmp); + d07 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d07), i2d(cmp))); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_03v_merge_descending(d05, d06, d07); + } + static INLINE void sort_08v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { + __m256i tmp, cmp; + + sort_04v_ascending(d01, d02, d03, d04); + sort_04v_descending(d05, d06, d07, d08); + + tmp = d05; + cmp = _mm256_cmpgt_epi64(d04, d05); + d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d04), i2d(cmp))); + d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp))); + + tmp = d06; + cmp = _mm256_cmpgt_epi64(d03, d06); + d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d03), i2d(cmp))); + d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp))); + + tmp = d07; + cmp = _mm256_cmpgt_epi64(d02, d07); + d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(d02), i2d(cmp))); + d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp))); + + tmp = d08; + cmp = _mm256_cmpgt_epi64(d01, d08); + d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(d01), i2d(cmp))); + d01 = d2i(_mm256_blendv_pd(i2d(d01), i2d(tmp), i2d(cmp))); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_04v_merge_ascending(d05, d06, d07, d08); + } + static INLINE void sort_08v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { + __m256i tmp, cmp; + + sort_04v_descending(d01, d02, d03, d04); + sort_04v_ascending(d05, d06, d07, d08); + + tmp = d05; + cmp = _mm256_cmpgt_epi64(d04, d05); + d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d04), i2d(cmp))); + d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp))); + + tmp = d06; + cmp = _mm256_cmpgt_epi64(d03, d06); + d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d03), i2d(cmp))); + d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp))); + + tmp = d07; + cmp = _mm256_cmpgt_epi64(d02, d07); + d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(d02), i2d(cmp))); + d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp))); + + tmp = d08; + cmp = _mm256_cmpgt_epi64(d01, d08); + d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(d01), i2d(cmp))); + d01 = d2i(_mm256_blendv_pd(i2d(d01), i2d(tmp), i2d(cmp))); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_04v_merge_descending(d05, d06, d07, d08); + } + static INLINE void sort_08v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { + __m256i tmp, cmp; + + tmp = d01; + cmp = _mm256_cmpgt_epi64(d05, d01); + d01 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d01), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d05, tmp); + d05 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d05), i2d(cmp))); + + tmp = d02; + cmp = _mm256_cmpgt_epi64(d06, d02); + d02 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d02), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d06, tmp); + d06 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d06), i2d(cmp))); + + tmp = d03; + cmp = _mm256_cmpgt_epi64(d07, d03); + d03 = d2i(_mm256_blendv_pd(i2d(d07), i2d(d03), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d07, tmp); + d07 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d07), i2d(cmp))); + + tmp = d04; + cmp = _mm256_cmpgt_epi64(d08, d04); + d04 = d2i(_mm256_blendv_pd(i2d(d08), i2d(d04), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d08, tmp); + d08 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d08), i2d(cmp))); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_04v_merge_ascending(d05, d06, d07, d08); + } + static INLINE void sort_08v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { + __m256i tmp, cmp; + + tmp = d01; + cmp = _mm256_cmpgt_epi64(d05, d01); + d01 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d01), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d05, tmp); + d05 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d05), i2d(cmp))); + + tmp = d02; + cmp = _mm256_cmpgt_epi64(d06, d02); + d02 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d02), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d06, tmp); + d06 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d06), i2d(cmp))); + + tmp = d03; + cmp = _mm256_cmpgt_epi64(d07, d03); + d03 = d2i(_mm256_blendv_pd(i2d(d07), i2d(d03), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d07, tmp); + d07 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d07), i2d(cmp))); + + tmp = d04; + cmp = _mm256_cmpgt_epi64(d08, d04); + d04 = d2i(_mm256_blendv_pd(i2d(d08), i2d(d04), i2d(cmp))); + cmp = _mm256_cmpgt_epi64(d08, tmp); + d08 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d08), i2d(cmp))); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_04v_merge_descending(d05, d06, d07, d08); + } + static INLINE void sort_09v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09) { + __m256i tmp, cmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_01v_descending(d09); + + tmp = d09; + cmp = _mm256_cmpgt_epi64(d08, d09); + d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp))); + d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp))); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_01v_merge_ascending(d09); + } + static INLINE void sort_09v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09) { + __m256i tmp, cmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_01v_ascending(d09); + + tmp = d09; + cmp = _mm256_cmpgt_epi64(d08, d09); + d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp))); + d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp))); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_01v_merge_descending(d09); + } + static INLINE void sort_10v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10) { + __m256i tmp, cmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_02v_descending(d09, d10); + + tmp = d09; + cmp = _mm256_cmpgt_epi64(d08, d09); + d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp))); + d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp))); + + tmp = d10; + cmp = _mm256_cmpgt_epi64(d07, d10); + d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp))); + d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp))); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_02v_merge_ascending(d09, d10); + } + static INLINE void sort_10v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10) { + __m256i tmp, cmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_02v_ascending(d09, d10); + + tmp = d09; + cmp = _mm256_cmpgt_epi64(d08, d09); + d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp))); + d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp))); + + tmp = d10; + cmp = _mm256_cmpgt_epi64(d07, d10); + d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp))); + d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp))); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_02v_merge_descending(d09, d10); + } + static INLINE void sort_11v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11) { + __m256i tmp, cmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_03v_descending(d09, d10, d11); + + tmp = d09; + cmp = _mm256_cmpgt_epi64(d08, d09); + d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp))); + d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp))); + + tmp = d10; + cmp = _mm256_cmpgt_epi64(d07, d10); + d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp))); + d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp))); + + tmp = d11; + cmp = _mm256_cmpgt_epi64(d06, d11); + d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp))); + d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp))); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_03v_merge_ascending(d09, d10, d11); + } + static INLINE void sort_11v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11) { + __m256i tmp, cmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_03v_ascending(d09, d10, d11); + + tmp = d09; + cmp = _mm256_cmpgt_epi64(d08, d09); + d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp))); + d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp))); + + tmp = d10; + cmp = _mm256_cmpgt_epi64(d07, d10); + d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp))); + d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp))); + + tmp = d11; + cmp = _mm256_cmpgt_epi64(d06, d11); + d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp))); + d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp))); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_03v_merge_descending(d09, d10, d11); + } + static INLINE void sort_12v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12) { + __m256i tmp, cmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_04v_descending(d09, d10, d11, d12); + + tmp = d09; + cmp = _mm256_cmpgt_epi64(d08, d09); + d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp))); + d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp))); + + tmp = d10; + cmp = _mm256_cmpgt_epi64(d07, d10); + d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp))); + d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp))); + + tmp = d11; + cmp = _mm256_cmpgt_epi64(d06, d11); + d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp))); + d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp))); + + tmp = d12; + cmp = _mm256_cmpgt_epi64(d05, d12); + d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp))); + d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp))); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_04v_merge_ascending(d09, d10, d11, d12); + } + static INLINE void sort_12v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12) { + __m256i tmp, cmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_04v_ascending(d09, d10, d11, d12); + + tmp = d09; + cmp = _mm256_cmpgt_epi64(d08, d09); + d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp))); + d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp))); + + tmp = d10; + cmp = _mm256_cmpgt_epi64(d07, d10); + d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp))); + d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp))); + + tmp = d11; + cmp = _mm256_cmpgt_epi64(d06, d11); + d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp))); + d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp))); + + tmp = d12; + cmp = _mm256_cmpgt_epi64(d05, d12); + d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp))); + d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp))); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_04v_merge_descending(d09, d10, d11, d12); + } + static INLINE void sort_13v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13) { + __m256i tmp, cmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_05v_descending(d09, d10, d11, d12, d13); + + tmp = d09; + cmp = _mm256_cmpgt_epi64(d08, d09); + d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp))); + d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp))); + + tmp = d10; + cmp = _mm256_cmpgt_epi64(d07, d10); + d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp))); + d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp))); + + tmp = d11; + cmp = _mm256_cmpgt_epi64(d06, d11); + d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp))); + d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp))); + + tmp = d12; + cmp = _mm256_cmpgt_epi64(d05, d12); + d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp))); + d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp))); + + tmp = d13; + cmp = _mm256_cmpgt_epi64(d04, d13); + d13 = d2i(_mm256_blendv_pd(i2d(d13), i2d(d04), i2d(cmp))); + d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp))); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_05v_merge_ascending(d09, d10, d11, d12, d13); + } + static INLINE void sort_13v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13) { + __m256i tmp, cmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_05v_ascending(d09, d10, d11, d12, d13); + + tmp = d09; + cmp = _mm256_cmpgt_epi64(d08, d09); + d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp))); + d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp))); + + tmp = d10; + cmp = _mm256_cmpgt_epi64(d07, d10); + d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp))); + d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp))); + + tmp = d11; + cmp = _mm256_cmpgt_epi64(d06, d11); + d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp))); + d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp))); + + tmp = d12; + cmp = _mm256_cmpgt_epi64(d05, d12); + d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp))); + d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp))); + + tmp = d13; + cmp = _mm256_cmpgt_epi64(d04, d13); + d13 = d2i(_mm256_blendv_pd(i2d(d13), i2d(d04), i2d(cmp))); + d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp))); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_05v_merge_descending(d09, d10, d11, d12, d13); + } + static INLINE void sort_14v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14) { + __m256i tmp, cmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_06v_descending(d09, d10, d11, d12, d13, d14); + + tmp = d09; + cmp = _mm256_cmpgt_epi64(d08, d09); + d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp))); + d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp))); + + tmp = d10; + cmp = _mm256_cmpgt_epi64(d07, d10); + d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp))); + d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp))); + + tmp = d11; + cmp = _mm256_cmpgt_epi64(d06, d11); + d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp))); + d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp))); + + tmp = d12; + cmp = _mm256_cmpgt_epi64(d05, d12); + d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp))); + d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp))); + + tmp = d13; + cmp = _mm256_cmpgt_epi64(d04, d13); + d13 = d2i(_mm256_blendv_pd(i2d(d13), i2d(d04), i2d(cmp))); + d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp))); + + tmp = d14; + cmp = _mm256_cmpgt_epi64(d03, d14); + d14 = d2i(_mm256_blendv_pd(i2d(d14), i2d(d03), i2d(cmp))); + d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp))); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_06v_merge_ascending(d09, d10, d11, d12, d13, d14); + } + static INLINE void sort_14v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14) { + __m256i tmp, cmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_06v_ascending(d09, d10, d11, d12, d13, d14); + + tmp = d09; + cmp = _mm256_cmpgt_epi64(d08, d09); + d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp))); + d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp))); + + tmp = d10; + cmp = _mm256_cmpgt_epi64(d07, d10); + d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp))); + d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp))); + + tmp = d11; + cmp = _mm256_cmpgt_epi64(d06, d11); + d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp))); + d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp))); + + tmp = d12; + cmp = _mm256_cmpgt_epi64(d05, d12); + d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp))); + d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp))); + + tmp = d13; + cmp = _mm256_cmpgt_epi64(d04, d13); + d13 = d2i(_mm256_blendv_pd(i2d(d13), i2d(d04), i2d(cmp))); + d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp))); + + tmp = d14; + cmp = _mm256_cmpgt_epi64(d03, d14); + d14 = d2i(_mm256_blendv_pd(i2d(d14), i2d(d03), i2d(cmp))); + d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp))); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_06v_merge_descending(d09, d10, d11, d12, d13, d14); + } + static INLINE void sort_15v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15) { + __m256i tmp, cmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_07v_descending(d09, d10, d11, d12, d13, d14, d15); + + tmp = d09; + cmp = _mm256_cmpgt_epi64(d08, d09); + d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp))); + d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp))); + + tmp = d10; + cmp = _mm256_cmpgt_epi64(d07, d10); + d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp))); + d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp))); + + tmp = d11; + cmp = _mm256_cmpgt_epi64(d06, d11); + d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp))); + d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp))); + + tmp = d12; + cmp = _mm256_cmpgt_epi64(d05, d12); + d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp))); + d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp))); + + tmp = d13; + cmp = _mm256_cmpgt_epi64(d04, d13); + d13 = d2i(_mm256_blendv_pd(i2d(d13), i2d(d04), i2d(cmp))); + d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp))); + + tmp = d14; + cmp = _mm256_cmpgt_epi64(d03, d14); + d14 = d2i(_mm256_blendv_pd(i2d(d14), i2d(d03), i2d(cmp))); + d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp))); + + tmp = d15; + cmp = _mm256_cmpgt_epi64(d02, d15); + d15 = d2i(_mm256_blendv_pd(i2d(d15), i2d(d02), i2d(cmp))); + d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp))); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_07v_merge_ascending(d09, d10, d11, d12, d13, d14, d15); + } + static INLINE void sort_15v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15) { + __m256i tmp, cmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_07v_ascending(d09, d10, d11, d12, d13, d14, d15); + + tmp = d09; + cmp = _mm256_cmpgt_epi64(d08, d09); + d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp))); + d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp))); + + tmp = d10; + cmp = _mm256_cmpgt_epi64(d07, d10); + d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp))); + d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp))); + + tmp = d11; + cmp = _mm256_cmpgt_epi64(d06, d11); + d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp))); + d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp))); + + tmp = d12; + cmp = _mm256_cmpgt_epi64(d05, d12); + d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp))); + d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp))); + + tmp = d13; + cmp = _mm256_cmpgt_epi64(d04, d13); + d13 = d2i(_mm256_blendv_pd(i2d(d13), i2d(d04), i2d(cmp))); + d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp))); + + tmp = d14; + cmp = _mm256_cmpgt_epi64(d03, d14); + d14 = d2i(_mm256_blendv_pd(i2d(d14), i2d(d03), i2d(cmp))); + d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp))); + + tmp = d15; + cmp = _mm256_cmpgt_epi64(d02, d15); + d15 = d2i(_mm256_blendv_pd(i2d(d15), i2d(d02), i2d(cmp))); + d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp))); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_07v_merge_descending(d09, d10, d11, d12, d13, d14, d15); + } + static INLINE void sort_16v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15, __m256i& d16) { + __m256i tmp, cmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_08v_descending(d09, d10, d11, d12, d13, d14, d15, d16); + + tmp = d09; + cmp = _mm256_cmpgt_epi64(d08, d09); + d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp))); + d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp))); + + tmp = d10; + cmp = _mm256_cmpgt_epi64(d07, d10); + d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp))); + d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp))); + + tmp = d11; + cmp = _mm256_cmpgt_epi64(d06, d11); + d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp))); + d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp))); + + tmp = d12; + cmp = _mm256_cmpgt_epi64(d05, d12); + d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp))); + d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp))); + + tmp = d13; + cmp = _mm256_cmpgt_epi64(d04, d13); + d13 = d2i(_mm256_blendv_pd(i2d(d13), i2d(d04), i2d(cmp))); + d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp))); + + tmp = d14; + cmp = _mm256_cmpgt_epi64(d03, d14); + d14 = d2i(_mm256_blendv_pd(i2d(d14), i2d(d03), i2d(cmp))); + d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp))); + + tmp = d15; + cmp = _mm256_cmpgt_epi64(d02, d15); + d15 = d2i(_mm256_blendv_pd(i2d(d15), i2d(d02), i2d(cmp))); + d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp))); + + tmp = d16; + cmp = _mm256_cmpgt_epi64(d01, d16); + d16 = d2i(_mm256_blendv_pd(i2d(d16), i2d(d01), i2d(cmp))); + d01 = d2i(_mm256_blendv_pd(i2d(d01), i2d(tmp), i2d(cmp))); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_08v_merge_ascending(d09, d10, d11, d12, d13, d14, d15, d16); + } + static INLINE void sort_16v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15, __m256i& d16) { + __m256i tmp, cmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_08v_ascending(d09, d10, d11, d12, d13, d14, d15, d16); + + tmp = d09; + cmp = _mm256_cmpgt_epi64(d08, d09); + d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp))); + d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp))); + + tmp = d10; + cmp = _mm256_cmpgt_epi64(d07, d10); + d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp))); + d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp))); + + tmp = d11; + cmp = _mm256_cmpgt_epi64(d06, d11); + d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp))); + d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp))); + + tmp = d12; + cmp = _mm256_cmpgt_epi64(d05, d12); + d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp))); + d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp))); + + tmp = d13; + cmp = _mm256_cmpgt_epi64(d04, d13); + d13 = d2i(_mm256_blendv_pd(i2d(d13), i2d(d04), i2d(cmp))); + d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp))); + + tmp = d14; + cmp = _mm256_cmpgt_epi64(d03, d14); + d14 = d2i(_mm256_blendv_pd(i2d(d14), i2d(d03), i2d(cmp))); + d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp))); + + tmp = d15; + cmp = _mm256_cmpgt_epi64(d02, d15); + d15 = d2i(_mm256_blendv_pd(i2d(d15), i2d(d02), i2d(cmp))); + d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp))); + + tmp = d16; + cmp = _mm256_cmpgt_epi64(d01, d16); + d16 = d2i(_mm256_blendv_pd(i2d(d16), i2d(d01), i2d(cmp))); + d01 = d2i(_mm256_blendv_pd(i2d(d01), i2d(tmp), i2d(cmp))); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_08v_merge_descending(d09, d10, d11, d12, d13, d14, d15, d16); + } + + static NOINLINE void sort_01v(int64_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + sort_01v_ascending(d01); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); +} + + static NOINLINE void sort_02v(int64_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + sort_02v_ascending(d01, d02); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); +} + + static NOINLINE void sort_03v(int64_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + sort_03v_ascending(d01, d02, d03); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); +} + + static NOINLINE void sort_04v(int64_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + sort_04v_ascending(d01, d02, d03, d04); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); +} + + static NOINLINE void sort_05v(int64_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + sort_05v_ascending(d01, d02, d03, d04, d05); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); +} + + static NOINLINE void sort_06v(int64_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + sort_06v_ascending(d01, d02, d03, d04, d05, d06); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); +} + + static NOINLINE void sort_07v(int64_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + sort_07v_ascending(d01, d02, d03, d04, d05, d06, d07); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); +} + + static NOINLINE void sort_08v(int64_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); + _mm256_storeu_si256((__m256i *) ptr + 7, d08); +} + + static NOINLINE void sort_09v(int64_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; + sort_09v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); + _mm256_storeu_si256((__m256i *) ptr + 7, d08); + _mm256_storeu_si256((__m256i *) ptr + 8, d09); +} + + static NOINLINE void sort_10v(int64_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; + __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; + sort_10v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); + _mm256_storeu_si256((__m256i *) ptr + 7, d08); + _mm256_storeu_si256((__m256i *) ptr + 8, d09); + _mm256_storeu_si256((__m256i *) ptr + 9, d10); +} + + static NOINLINE void sort_11v(int64_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; + __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; + __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; + sort_11v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); + _mm256_storeu_si256((__m256i *) ptr + 7, d08); + _mm256_storeu_si256((__m256i *) ptr + 8, d09); + _mm256_storeu_si256((__m256i *) ptr + 9, d10); + _mm256_storeu_si256((__m256i *) ptr + 10, d11); +} + + static NOINLINE void sort_12v(int64_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; + __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; + __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; + __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);; + sort_12v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); + _mm256_storeu_si256((__m256i *) ptr + 7, d08); + _mm256_storeu_si256((__m256i *) ptr + 8, d09); + _mm256_storeu_si256((__m256i *) ptr + 9, d10); + _mm256_storeu_si256((__m256i *) ptr + 10, d11); + _mm256_storeu_si256((__m256i *) ptr + 11, d12); +} + + static NOINLINE void sort_13v(int64_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; + __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; + __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; + __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);; + __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);; + sort_13v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); + _mm256_storeu_si256((__m256i *) ptr + 7, d08); + _mm256_storeu_si256((__m256i *) ptr + 8, d09); + _mm256_storeu_si256((__m256i *) ptr + 9, d10); + _mm256_storeu_si256((__m256i *) ptr + 10, d11); + _mm256_storeu_si256((__m256i *) ptr + 11, d12); + _mm256_storeu_si256((__m256i *) ptr + 12, d13); +} + + static NOINLINE void sort_14v(int64_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; + __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; + __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; + __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);; + __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);; + __m256i d14 = _mm256_lddqu_si256((__m256i const *) ptr + 13);; + sort_14v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); + _mm256_storeu_si256((__m256i *) ptr + 7, d08); + _mm256_storeu_si256((__m256i *) ptr + 8, d09); + _mm256_storeu_si256((__m256i *) ptr + 9, d10); + _mm256_storeu_si256((__m256i *) ptr + 10, d11); + _mm256_storeu_si256((__m256i *) ptr + 11, d12); + _mm256_storeu_si256((__m256i *) ptr + 12, d13); + _mm256_storeu_si256((__m256i *) ptr + 13, d14); +} + + static NOINLINE void sort_15v(int64_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; + __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; + __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; + __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);; + __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);; + __m256i d14 = _mm256_lddqu_si256((__m256i const *) ptr + 13);; + __m256i d15 = _mm256_lddqu_si256((__m256i const *) ptr + 14);; + sort_15v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); + _mm256_storeu_si256((__m256i *) ptr + 7, d08); + _mm256_storeu_si256((__m256i *) ptr + 8, d09); + _mm256_storeu_si256((__m256i *) ptr + 9, d10); + _mm256_storeu_si256((__m256i *) ptr + 10, d11); + _mm256_storeu_si256((__m256i *) ptr + 11, d12); + _mm256_storeu_si256((__m256i *) ptr + 12, d13); + _mm256_storeu_si256((__m256i *) ptr + 13, d14); + _mm256_storeu_si256((__m256i *) ptr + 14, d15); +} + + static NOINLINE void sort_16v(int64_t *ptr) { + __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; + __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; + __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; + __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);; + __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);; + __m256i d14 = _mm256_lddqu_si256((__m256i const *) ptr + 13);; + __m256i d15 = _mm256_lddqu_si256((__m256i const *) ptr + 14);; + __m256i d16 = _mm256_lddqu_si256((__m256i const *) ptr + 15);; + sort_16v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15, d16); + _mm256_storeu_si256((__m256i *) ptr + 0, d01); + _mm256_storeu_si256((__m256i *) ptr + 1, d02); + _mm256_storeu_si256((__m256i *) ptr + 2, d03); + _mm256_storeu_si256((__m256i *) ptr + 3, d04); + _mm256_storeu_si256((__m256i *) ptr + 4, d05); + _mm256_storeu_si256((__m256i *) ptr + 5, d06); + _mm256_storeu_si256((__m256i *) ptr + 6, d07); + _mm256_storeu_si256((__m256i *) ptr + 7, d08); + _mm256_storeu_si256((__m256i *) ptr + 8, d09); + _mm256_storeu_si256((__m256i *) ptr + 9, d10); + _mm256_storeu_si256((__m256i *) ptr + 10, d11); + _mm256_storeu_si256((__m256i *) ptr + 11, d12); + _mm256_storeu_si256((__m256i *) ptr + 12, d13); + _mm256_storeu_si256((__m256i *) ptr + 13, d14); + _mm256_storeu_si256((__m256i *) ptr + 14, d15); + _mm256_storeu_si256((__m256i *) ptr + 15, d16); +} + static void sort(int64_t *ptr, size_t length); + +}; +} +} + +#undef i2d +#undef d2i +#undef i2s +#undef s2i +#undef s2d +#undef d2s + +#ifdef __GNUC__ +#ifdef __clang__ +#pragma clang attribute pop +#else +#pragma GCC pop_options +#endif +#endif +#endif + diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp new file mode 100644 index 000000000000..9efdf598ea49 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp @@ -0,0 +1,30 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "common.h" +#include "bitonic_sort.AVX512.int32_t.generated.h" + +using namespace vxsort; + +void vxsort::smallsort::bitonic::sort(int32_t *ptr, size_t length) { + const int N = 16; + + switch(length / N) { + case 1: sort_01v(ptr); break; + case 2: sort_02v(ptr); break; + case 3: sort_03v(ptr); break; + case 4: sort_04v(ptr); break; + case 5: sort_05v(ptr); break; + case 6: sort_06v(ptr); break; + case 7: sort_07v(ptr); break; + case 8: sort_08v(ptr); break; + case 9: sort_09v(ptr); break; + case 10: sort_10v(ptr); break; + case 11: sort_11v(ptr); break; + case 12: sort_12v(ptr); break; + case 13: sort_13v(ptr); break; + case 14: sort_14v(ptr); break; + case 15: sort_15v(ptr); break; + case 16: sort_16v(ptr); break; + } +} diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.h b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.h new file mode 100644 index 000000000000..21c992c3e0df --- /dev/null +++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.h @@ -0,0 +1,1387 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +///////////////////////////////////////////////////////////////////////////// +//// +// This file was auto-generated by a tool at 2020-06-22 05:27:48 +// +// It is recommended you DO NOT directly edit this file but instead edit +// the code-generator that generated this source file instead. +///////////////////////////////////////////////////////////////////////////// + +#ifndef BITONIC_SORT_AVX512_INT32_T_H +#define BITONIC_SORT_AVX512_INT32_T_H + + +#ifdef __GNUC__ +#ifdef __clang__ +#pragma clang attribute push (__attribute__((target("avx512f"))), apply_to = any(function)) +#else +#pragma GCC push_options +#pragma GCC target("avx512f") +#endif +#endif + +#include +#include "bitonic_sort.h" + +#define i2d _mm512_castsi512_pd +#define d2i _mm512_castpd_si512 +#define i2s _mm512_castsi512_ps +#define s2i _mm512_castps_si512 +#define s2d _mm512_castps_pd +#define d2s _mm521_castpd_ps + +namespace vxsort { +namespace smallsort { +template<> struct bitonic { +public: + + static INLINE void sort_01v_ascending(__m512i& d01) { + __m512i min, s; + + s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0xAAAA, s, d01); + + s = _mm512_shuffle_epi32(d01, _MM_PERM_ABCD); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0xCCCC, s, d01); + + s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0xAAAA, s, d01); + + s = _mm512_permutex_epi64(_mm512_shuffle_epi32(d01, _MM_PERM_ABCD), _MM_PERM_BADC); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0xF0F0, s, d01); + + s = _mm512_shuffle_epi32(d01, _MM_PERM_BADC); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0xCCCC, s, d01); + + s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0xAAAA, s, d01); + + s = _mm512_shuffle_i64x2(_mm512_shuffle_epi32(d01, _MM_PERM_ABCD), _mm512_shuffle_epi32(d01, _MM_PERM_ABCD), _MM_PERM_ABCD); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0xFF00, s, d01); + + s = _mm512_permutex_epi64(d01, _MM_PERM_BADC); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0xF0F0, s, d01); + + s = _mm512_shuffle_epi32(d01, _MM_PERM_BADC); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0xCCCC, s, d01); + + s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0xAAAA, s, d01); + } + static INLINE void sort_01v_merge_ascending(__m512i& d01) { + __m512i min, s; + + s = _mm512_shuffle_i64x2(d01, d01, _MM_PERM_BADC); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0xFF00, s, d01); + + s = _mm512_permutex_epi64(d01, _MM_PERM_BADC); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0xF0F0, s, d01); + + s = _mm512_shuffle_epi32(d01, _MM_PERM_BADC); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0xCCCC, s, d01); + + s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0xAAAA, s, d01); + } + static INLINE void sort_01v_descending(__m512i& d01) { + __m512i min, s; + + s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0x5555, s, d01); + + s = _mm512_shuffle_epi32(d01, _MM_PERM_ABCD); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0x3333, s, d01); + + s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0x5555, s, d01); + + s = _mm512_permutex_epi64(_mm512_shuffle_epi32(d01, _MM_PERM_ABCD), _MM_PERM_BADC); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0x0F0F, s, d01); + + s = _mm512_shuffle_epi32(d01, _MM_PERM_BADC); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0x3333, s, d01); + + s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0x5555, s, d01); + + s = _mm512_shuffle_i64x2(_mm512_shuffle_epi32(d01, _MM_PERM_ABCD), _mm512_shuffle_epi32(d01, _MM_PERM_ABCD), _MM_PERM_ABCD); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0x00FF, s, d01); + + s = _mm512_permutex_epi64(d01, _MM_PERM_BADC); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0x0F0F, s, d01); + + s = _mm512_shuffle_epi32(d01, _MM_PERM_BADC); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0x3333, s, d01); + + s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0x5555, s, d01); + } + static INLINE void sort_01v_merge_descending(__m512i& d01) { + __m512i min, s; + + s = _mm512_shuffle_i64x2(d01, d01, _MM_PERM_BADC); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0x00FF, s, d01); + + s = _mm512_permutex_epi64(d01, _MM_PERM_BADC); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0x0F0F, s, d01); + + s = _mm512_shuffle_epi32(d01, _MM_PERM_BADC); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0x3333, s, d01); + + s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB); + min = _mm512_min_epi32(s, d01); + d01 = _mm512_mask_max_epi32(min, 0x5555, s, d01); + } + static INLINE void sort_02v_ascending(__m512i& d01, __m512i& d02) { + __m512i tmp; + + sort_01v_ascending(d01); + sort_01v_descending(d02); + + tmp = d02; + d02 = _mm512_max_epi32(d01, d02); + d01 = _mm512_min_epi32(d01, tmp); + + sort_01v_merge_ascending(d01); + sort_01v_merge_ascending(d02); + } + static INLINE void sort_02v_descending(__m512i& d01, __m512i& d02) { + __m512i tmp; + + sort_01v_descending(d01); + sort_01v_ascending(d02); + + tmp = d02; + d02 = _mm512_max_epi32(d01, d02); + d01 = _mm512_min_epi32(d01, tmp); + + sort_01v_merge_descending(d01); + sort_01v_merge_descending(d02); + } + static INLINE void sort_02v_merge_ascending(__m512i& d01, __m512i& d02) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi32(d02, d01); + d02 = _mm512_max_epi32(d02, tmp); + + sort_01v_merge_ascending(d01); + sort_01v_merge_ascending(d02); + } + static INLINE void sort_02v_merge_descending(__m512i& d01, __m512i& d02) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi32(d02, d01); + d02 = _mm512_max_epi32(d02, tmp); + + sort_01v_merge_descending(d01); + sort_01v_merge_descending(d02); + } + static INLINE void sort_03v_ascending(__m512i& d01, __m512i& d02, __m512i& d03) { + __m512i tmp; + + sort_02v_ascending(d01, d02); + sort_01v_descending(d03); + + tmp = d03; + d03 = _mm512_max_epi32(d02, d03); + d02 = _mm512_min_epi32(d02, tmp); + + sort_02v_merge_ascending(d01, d02); + sort_01v_merge_ascending(d03); + } + static INLINE void sort_03v_descending(__m512i& d01, __m512i& d02, __m512i& d03) { + __m512i tmp; + + sort_02v_descending(d01, d02); + sort_01v_ascending(d03); + + tmp = d03; + d03 = _mm512_max_epi32(d02, d03); + d02 = _mm512_min_epi32(d02, tmp); + + sort_02v_merge_descending(d01, d02); + sort_01v_merge_descending(d03); + } + static INLINE void sort_03v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi32(d03, d01); + d03 = _mm512_max_epi32(d03, tmp); + + sort_02v_merge_ascending(d01, d02); + sort_01v_merge_ascending(d03); + } + static INLINE void sort_03v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi32(d03, d01); + d03 = _mm512_max_epi32(d03, tmp); + + sort_02v_merge_descending(d01, d02); + sort_01v_merge_descending(d03); + } + static INLINE void sort_04v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { + __m512i tmp; + + sort_02v_ascending(d01, d02); + sort_02v_descending(d03, d04); + + tmp = d03; + d03 = _mm512_max_epi32(d02, d03); + d02 = _mm512_min_epi32(d02, tmp); + + tmp = d04; + d04 = _mm512_max_epi32(d01, d04); + d01 = _mm512_min_epi32(d01, tmp); + + sort_02v_merge_ascending(d01, d02); + sort_02v_merge_ascending(d03, d04); + } + static INLINE void sort_04v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { + __m512i tmp; + + sort_02v_descending(d01, d02); + sort_02v_ascending(d03, d04); + + tmp = d03; + d03 = _mm512_max_epi32(d02, d03); + d02 = _mm512_min_epi32(d02, tmp); + + tmp = d04; + d04 = _mm512_max_epi32(d01, d04); + d01 = _mm512_min_epi32(d01, tmp); + + sort_02v_merge_descending(d01, d02); + sort_02v_merge_descending(d03, d04); + } + static INLINE void sort_04v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi32(d03, d01); + d03 = _mm512_max_epi32(d03, tmp); + + tmp = d02; + d02 = _mm512_min_epi32(d04, d02); + d04 = _mm512_max_epi32(d04, tmp); + + sort_02v_merge_ascending(d01, d02); + sort_02v_merge_ascending(d03, d04); + } + static INLINE void sort_04v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi32(d03, d01); + d03 = _mm512_max_epi32(d03, tmp); + + tmp = d02; + d02 = _mm512_min_epi32(d04, d02); + d04 = _mm512_max_epi32(d04, tmp); + + sort_02v_merge_descending(d01, d02); + sort_02v_merge_descending(d03, d04); + } + static INLINE void sort_05v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05) { + __m512i tmp; + + sort_04v_ascending(d01, d02, d03, d04); + sort_01v_descending(d05); + + tmp = d05; + d05 = _mm512_max_epi32(d04, d05); + d04 = _mm512_min_epi32(d04, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_01v_merge_ascending(d05); + } + static INLINE void sort_05v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05) { + __m512i tmp; + + sort_04v_descending(d01, d02, d03, d04); + sort_01v_ascending(d05); + + tmp = d05; + d05 = _mm512_max_epi32(d04, d05); + d04 = _mm512_min_epi32(d04, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_01v_merge_descending(d05); + } + static INLINE void sort_05v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi32(d05, d01); + d05 = _mm512_max_epi32(d05, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_01v_merge_ascending(d05); + } + static INLINE void sort_05v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi32(d05, d01); + d05 = _mm512_max_epi32(d05, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_01v_merge_descending(d05); + } + static INLINE void sort_06v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06) { + __m512i tmp; + + sort_04v_ascending(d01, d02, d03, d04); + sort_02v_descending(d05, d06); + + tmp = d05; + d05 = _mm512_max_epi32(d04, d05); + d04 = _mm512_min_epi32(d04, tmp); + + tmp = d06; + d06 = _mm512_max_epi32(d03, d06); + d03 = _mm512_min_epi32(d03, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_02v_merge_ascending(d05, d06); + } + static INLINE void sort_06v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06) { + __m512i tmp; + + sort_04v_descending(d01, d02, d03, d04); + sort_02v_ascending(d05, d06); + + tmp = d05; + d05 = _mm512_max_epi32(d04, d05); + d04 = _mm512_min_epi32(d04, tmp); + + tmp = d06; + d06 = _mm512_max_epi32(d03, d06); + d03 = _mm512_min_epi32(d03, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_02v_merge_descending(d05, d06); + } + static INLINE void sort_06v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi32(d05, d01); + d05 = _mm512_max_epi32(d05, tmp); + + tmp = d02; + d02 = _mm512_min_epi32(d06, d02); + d06 = _mm512_max_epi32(d06, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_02v_merge_ascending(d05, d06); + } + static INLINE void sort_06v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi32(d05, d01); + d05 = _mm512_max_epi32(d05, tmp); + + tmp = d02; + d02 = _mm512_min_epi32(d06, d02); + d06 = _mm512_max_epi32(d06, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_02v_merge_descending(d05, d06); + } + static INLINE void sort_07v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07) { + __m512i tmp; + + sort_04v_ascending(d01, d02, d03, d04); + sort_03v_descending(d05, d06, d07); + + tmp = d05; + d05 = _mm512_max_epi32(d04, d05); + d04 = _mm512_min_epi32(d04, tmp); + + tmp = d06; + d06 = _mm512_max_epi32(d03, d06); + d03 = _mm512_min_epi32(d03, tmp); + + tmp = d07; + d07 = _mm512_max_epi32(d02, d07); + d02 = _mm512_min_epi32(d02, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_03v_merge_ascending(d05, d06, d07); + } + static INLINE void sort_07v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07) { + __m512i tmp; + + sort_04v_descending(d01, d02, d03, d04); + sort_03v_ascending(d05, d06, d07); + + tmp = d05; + d05 = _mm512_max_epi32(d04, d05); + d04 = _mm512_min_epi32(d04, tmp); + + tmp = d06; + d06 = _mm512_max_epi32(d03, d06); + d03 = _mm512_min_epi32(d03, tmp); + + tmp = d07; + d07 = _mm512_max_epi32(d02, d07); + d02 = _mm512_min_epi32(d02, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_03v_merge_descending(d05, d06, d07); + } + static INLINE void sort_07v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi32(d05, d01); + d05 = _mm512_max_epi32(d05, tmp); + + tmp = d02; + d02 = _mm512_min_epi32(d06, d02); + d06 = _mm512_max_epi32(d06, tmp); + + tmp = d03; + d03 = _mm512_min_epi32(d07, d03); + d07 = _mm512_max_epi32(d07, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_03v_merge_ascending(d05, d06, d07); + } + static INLINE void sort_07v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi32(d05, d01); + d05 = _mm512_max_epi32(d05, tmp); + + tmp = d02; + d02 = _mm512_min_epi32(d06, d02); + d06 = _mm512_max_epi32(d06, tmp); + + tmp = d03; + d03 = _mm512_min_epi32(d07, d03); + d07 = _mm512_max_epi32(d07, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_03v_merge_descending(d05, d06, d07); + } + static INLINE void sort_08v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { + __m512i tmp; + + sort_04v_ascending(d01, d02, d03, d04); + sort_04v_descending(d05, d06, d07, d08); + + tmp = d05; + d05 = _mm512_max_epi32(d04, d05); + d04 = _mm512_min_epi32(d04, tmp); + + tmp = d06; + d06 = _mm512_max_epi32(d03, d06); + d03 = _mm512_min_epi32(d03, tmp); + + tmp = d07; + d07 = _mm512_max_epi32(d02, d07); + d02 = _mm512_min_epi32(d02, tmp); + + tmp = d08; + d08 = _mm512_max_epi32(d01, d08); + d01 = _mm512_min_epi32(d01, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_04v_merge_ascending(d05, d06, d07, d08); + } + static INLINE void sort_08v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { + __m512i tmp; + + sort_04v_descending(d01, d02, d03, d04); + sort_04v_ascending(d05, d06, d07, d08); + + tmp = d05; + d05 = _mm512_max_epi32(d04, d05); + d04 = _mm512_min_epi32(d04, tmp); + + tmp = d06; + d06 = _mm512_max_epi32(d03, d06); + d03 = _mm512_min_epi32(d03, tmp); + + tmp = d07; + d07 = _mm512_max_epi32(d02, d07); + d02 = _mm512_min_epi32(d02, tmp); + + tmp = d08; + d08 = _mm512_max_epi32(d01, d08); + d01 = _mm512_min_epi32(d01, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_04v_merge_descending(d05, d06, d07, d08); + } + static INLINE void sort_08v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi32(d05, d01); + d05 = _mm512_max_epi32(d05, tmp); + + tmp = d02; + d02 = _mm512_min_epi32(d06, d02); + d06 = _mm512_max_epi32(d06, tmp); + + tmp = d03; + d03 = _mm512_min_epi32(d07, d03); + d07 = _mm512_max_epi32(d07, tmp); + + tmp = d04; + d04 = _mm512_min_epi32(d08, d04); + d08 = _mm512_max_epi32(d08, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_04v_merge_ascending(d05, d06, d07, d08); + } + static INLINE void sort_08v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi32(d05, d01); + d05 = _mm512_max_epi32(d05, tmp); + + tmp = d02; + d02 = _mm512_min_epi32(d06, d02); + d06 = _mm512_max_epi32(d06, tmp); + + tmp = d03; + d03 = _mm512_min_epi32(d07, d03); + d07 = _mm512_max_epi32(d07, tmp); + + tmp = d04; + d04 = _mm512_min_epi32(d08, d04); + d08 = _mm512_max_epi32(d08, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_04v_merge_descending(d05, d06, d07, d08); + } + static INLINE void sort_09v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09) { + __m512i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_01v_descending(d09); + + tmp = d09; + d09 = _mm512_max_epi32(d08, d09); + d08 = _mm512_min_epi32(d08, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_01v_merge_ascending(d09); + } + static INLINE void sort_09v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09) { + __m512i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_01v_ascending(d09); + + tmp = d09; + d09 = _mm512_max_epi32(d08, d09); + d08 = _mm512_min_epi32(d08, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_01v_merge_descending(d09); + } + static INLINE void sort_10v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10) { + __m512i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_02v_descending(d09, d10); + + tmp = d09; + d09 = _mm512_max_epi32(d08, d09); + d08 = _mm512_min_epi32(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi32(d07, d10); + d07 = _mm512_min_epi32(d07, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_02v_merge_ascending(d09, d10); + } + static INLINE void sort_10v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10) { + __m512i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_02v_ascending(d09, d10); + + tmp = d09; + d09 = _mm512_max_epi32(d08, d09); + d08 = _mm512_min_epi32(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi32(d07, d10); + d07 = _mm512_min_epi32(d07, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_02v_merge_descending(d09, d10); + } + static INLINE void sort_11v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11) { + __m512i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_03v_descending(d09, d10, d11); + + tmp = d09; + d09 = _mm512_max_epi32(d08, d09); + d08 = _mm512_min_epi32(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi32(d07, d10); + d07 = _mm512_min_epi32(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi32(d06, d11); + d06 = _mm512_min_epi32(d06, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_03v_merge_ascending(d09, d10, d11); + } + static INLINE void sort_11v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11) { + __m512i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_03v_ascending(d09, d10, d11); + + tmp = d09; + d09 = _mm512_max_epi32(d08, d09); + d08 = _mm512_min_epi32(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi32(d07, d10); + d07 = _mm512_min_epi32(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi32(d06, d11); + d06 = _mm512_min_epi32(d06, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_03v_merge_descending(d09, d10, d11); + } + static INLINE void sort_12v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12) { + __m512i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_04v_descending(d09, d10, d11, d12); + + tmp = d09; + d09 = _mm512_max_epi32(d08, d09); + d08 = _mm512_min_epi32(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi32(d07, d10); + d07 = _mm512_min_epi32(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi32(d06, d11); + d06 = _mm512_min_epi32(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi32(d05, d12); + d05 = _mm512_min_epi32(d05, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_04v_merge_ascending(d09, d10, d11, d12); + } + static INLINE void sort_12v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12) { + __m512i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_04v_ascending(d09, d10, d11, d12); + + tmp = d09; + d09 = _mm512_max_epi32(d08, d09); + d08 = _mm512_min_epi32(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi32(d07, d10); + d07 = _mm512_min_epi32(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi32(d06, d11); + d06 = _mm512_min_epi32(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi32(d05, d12); + d05 = _mm512_min_epi32(d05, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_04v_merge_descending(d09, d10, d11, d12); + } + static INLINE void sort_13v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13) { + __m512i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_05v_descending(d09, d10, d11, d12, d13); + + tmp = d09; + d09 = _mm512_max_epi32(d08, d09); + d08 = _mm512_min_epi32(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi32(d07, d10); + d07 = _mm512_min_epi32(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi32(d06, d11); + d06 = _mm512_min_epi32(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi32(d05, d12); + d05 = _mm512_min_epi32(d05, tmp); + + tmp = d13; + d13 = _mm512_max_epi32(d04, d13); + d04 = _mm512_min_epi32(d04, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_05v_merge_ascending(d09, d10, d11, d12, d13); + } + static INLINE void sort_13v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13) { + __m512i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_05v_ascending(d09, d10, d11, d12, d13); + + tmp = d09; + d09 = _mm512_max_epi32(d08, d09); + d08 = _mm512_min_epi32(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi32(d07, d10); + d07 = _mm512_min_epi32(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi32(d06, d11); + d06 = _mm512_min_epi32(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi32(d05, d12); + d05 = _mm512_min_epi32(d05, tmp); + + tmp = d13; + d13 = _mm512_max_epi32(d04, d13); + d04 = _mm512_min_epi32(d04, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_05v_merge_descending(d09, d10, d11, d12, d13); + } + static INLINE void sort_14v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14) { + __m512i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_06v_descending(d09, d10, d11, d12, d13, d14); + + tmp = d09; + d09 = _mm512_max_epi32(d08, d09); + d08 = _mm512_min_epi32(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi32(d07, d10); + d07 = _mm512_min_epi32(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi32(d06, d11); + d06 = _mm512_min_epi32(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi32(d05, d12); + d05 = _mm512_min_epi32(d05, tmp); + + tmp = d13; + d13 = _mm512_max_epi32(d04, d13); + d04 = _mm512_min_epi32(d04, tmp); + + tmp = d14; + d14 = _mm512_max_epi32(d03, d14); + d03 = _mm512_min_epi32(d03, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_06v_merge_ascending(d09, d10, d11, d12, d13, d14); + } + static INLINE void sort_14v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14) { + __m512i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_06v_ascending(d09, d10, d11, d12, d13, d14); + + tmp = d09; + d09 = _mm512_max_epi32(d08, d09); + d08 = _mm512_min_epi32(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi32(d07, d10); + d07 = _mm512_min_epi32(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi32(d06, d11); + d06 = _mm512_min_epi32(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi32(d05, d12); + d05 = _mm512_min_epi32(d05, tmp); + + tmp = d13; + d13 = _mm512_max_epi32(d04, d13); + d04 = _mm512_min_epi32(d04, tmp); + + tmp = d14; + d14 = _mm512_max_epi32(d03, d14); + d03 = _mm512_min_epi32(d03, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_06v_merge_descending(d09, d10, d11, d12, d13, d14); + } + static INLINE void sort_15v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15) { + __m512i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_07v_descending(d09, d10, d11, d12, d13, d14, d15); + + tmp = d09; + d09 = _mm512_max_epi32(d08, d09); + d08 = _mm512_min_epi32(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi32(d07, d10); + d07 = _mm512_min_epi32(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi32(d06, d11); + d06 = _mm512_min_epi32(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi32(d05, d12); + d05 = _mm512_min_epi32(d05, tmp); + + tmp = d13; + d13 = _mm512_max_epi32(d04, d13); + d04 = _mm512_min_epi32(d04, tmp); + + tmp = d14; + d14 = _mm512_max_epi32(d03, d14); + d03 = _mm512_min_epi32(d03, tmp); + + tmp = d15; + d15 = _mm512_max_epi32(d02, d15); + d02 = _mm512_min_epi32(d02, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_07v_merge_ascending(d09, d10, d11, d12, d13, d14, d15); + } + static INLINE void sort_15v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15) { + __m512i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_07v_ascending(d09, d10, d11, d12, d13, d14, d15); + + tmp = d09; + d09 = _mm512_max_epi32(d08, d09); + d08 = _mm512_min_epi32(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi32(d07, d10); + d07 = _mm512_min_epi32(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi32(d06, d11); + d06 = _mm512_min_epi32(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi32(d05, d12); + d05 = _mm512_min_epi32(d05, tmp); + + tmp = d13; + d13 = _mm512_max_epi32(d04, d13); + d04 = _mm512_min_epi32(d04, tmp); + + tmp = d14; + d14 = _mm512_max_epi32(d03, d14); + d03 = _mm512_min_epi32(d03, tmp); + + tmp = d15; + d15 = _mm512_max_epi32(d02, d15); + d02 = _mm512_min_epi32(d02, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_07v_merge_descending(d09, d10, d11, d12, d13, d14, d15); + } + static INLINE void sort_16v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15, __m512i& d16) { + __m512i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_08v_descending(d09, d10, d11, d12, d13, d14, d15, d16); + + tmp = d09; + d09 = _mm512_max_epi32(d08, d09); + d08 = _mm512_min_epi32(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi32(d07, d10); + d07 = _mm512_min_epi32(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi32(d06, d11); + d06 = _mm512_min_epi32(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi32(d05, d12); + d05 = _mm512_min_epi32(d05, tmp); + + tmp = d13; + d13 = _mm512_max_epi32(d04, d13); + d04 = _mm512_min_epi32(d04, tmp); + + tmp = d14; + d14 = _mm512_max_epi32(d03, d14); + d03 = _mm512_min_epi32(d03, tmp); + + tmp = d15; + d15 = _mm512_max_epi32(d02, d15); + d02 = _mm512_min_epi32(d02, tmp); + + tmp = d16; + d16 = _mm512_max_epi32(d01, d16); + d01 = _mm512_min_epi32(d01, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_08v_merge_ascending(d09, d10, d11, d12, d13, d14, d15, d16); + } + static INLINE void sort_16v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15, __m512i& d16) { + __m512i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_08v_ascending(d09, d10, d11, d12, d13, d14, d15, d16); + + tmp = d09; + d09 = _mm512_max_epi32(d08, d09); + d08 = _mm512_min_epi32(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi32(d07, d10); + d07 = _mm512_min_epi32(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi32(d06, d11); + d06 = _mm512_min_epi32(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi32(d05, d12); + d05 = _mm512_min_epi32(d05, tmp); + + tmp = d13; + d13 = _mm512_max_epi32(d04, d13); + d04 = _mm512_min_epi32(d04, tmp); + + tmp = d14; + d14 = _mm512_max_epi32(d03, d14); + d03 = _mm512_min_epi32(d03, tmp); + + tmp = d15; + d15 = _mm512_max_epi32(d02, d15); + d02 = _mm512_min_epi32(d02, tmp); + + tmp = d16; + d16 = _mm512_max_epi32(d01, d16); + d01 = _mm512_min_epi32(d01, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_08v_merge_descending(d09, d10, d11, d12, d13, d14, d15, d16); + } + + static NOINLINE void sort_01v(int32_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + sort_01v_ascending(d01); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); +} + + static NOINLINE void sort_02v(int32_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + sort_02v_ascending(d01, d02); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); +} + + static NOINLINE void sort_03v(int32_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + sort_03v_ascending(d01, d02, d03); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); +} + + static NOINLINE void sort_04v(int32_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + sort_04v_ascending(d01, d02, d03, d04); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); +} + + static NOINLINE void sort_05v(int32_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + sort_05v_ascending(d01, d02, d03, d04, d05); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); +} + + static NOINLINE void sort_06v(int32_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + sort_06v_ascending(d01, d02, d03, d04, d05, d06); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); +} + + static NOINLINE void sort_07v(int32_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + sort_07v_ascending(d01, d02, d03, d04, d05, d06, d07); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); +} + + static NOINLINE void sort_08v(int32_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); + _mm512_storeu_si512((__m512i *) ptr + 7, d08); +} + + static NOINLINE void sort_09v(int32_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; + sort_09v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); + _mm512_storeu_si512((__m512i *) ptr + 7, d08); + _mm512_storeu_si512((__m512i *) ptr + 8, d09); +} + + static NOINLINE void sort_10v(int32_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; + __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; + sort_10v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); + _mm512_storeu_si512((__m512i *) ptr + 7, d08); + _mm512_storeu_si512((__m512i *) ptr + 8, d09); + _mm512_storeu_si512((__m512i *) ptr + 9, d10); +} + + static NOINLINE void sort_11v(int32_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; + __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; + __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; + sort_11v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); + _mm512_storeu_si512((__m512i *) ptr + 7, d08); + _mm512_storeu_si512((__m512i *) ptr + 8, d09); + _mm512_storeu_si512((__m512i *) ptr + 9, d10); + _mm512_storeu_si512((__m512i *) ptr + 10, d11); +} + + static NOINLINE void sort_12v(int32_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; + __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; + __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; + __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);; + sort_12v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); + _mm512_storeu_si512((__m512i *) ptr + 7, d08); + _mm512_storeu_si512((__m512i *) ptr + 8, d09); + _mm512_storeu_si512((__m512i *) ptr + 9, d10); + _mm512_storeu_si512((__m512i *) ptr + 10, d11); + _mm512_storeu_si512((__m512i *) ptr + 11, d12); +} + + static NOINLINE void sort_13v(int32_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; + __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; + __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; + __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);; + __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);; + sort_13v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); + _mm512_storeu_si512((__m512i *) ptr + 7, d08); + _mm512_storeu_si512((__m512i *) ptr + 8, d09); + _mm512_storeu_si512((__m512i *) ptr + 9, d10); + _mm512_storeu_si512((__m512i *) ptr + 10, d11); + _mm512_storeu_si512((__m512i *) ptr + 11, d12); + _mm512_storeu_si512((__m512i *) ptr + 12, d13); +} + + static NOINLINE void sort_14v(int32_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; + __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; + __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; + __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);; + __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);; + __m512i d14 = _mm512_loadu_si512((__m512i const *) ptr + 13);; + sort_14v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); + _mm512_storeu_si512((__m512i *) ptr + 7, d08); + _mm512_storeu_si512((__m512i *) ptr + 8, d09); + _mm512_storeu_si512((__m512i *) ptr + 9, d10); + _mm512_storeu_si512((__m512i *) ptr + 10, d11); + _mm512_storeu_si512((__m512i *) ptr + 11, d12); + _mm512_storeu_si512((__m512i *) ptr + 12, d13); + _mm512_storeu_si512((__m512i *) ptr + 13, d14); +} + + static NOINLINE void sort_15v(int32_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; + __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; + __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; + __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);; + __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);; + __m512i d14 = _mm512_loadu_si512((__m512i const *) ptr + 13);; + __m512i d15 = _mm512_loadu_si512((__m512i const *) ptr + 14);; + sort_15v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); + _mm512_storeu_si512((__m512i *) ptr + 7, d08); + _mm512_storeu_si512((__m512i *) ptr + 8, d09); + _mm512_storeu_si512((__m512i *) ptr + 9, d10); + _mm512_storeu_si512((__m512i *) ptr + 10, d11); + _mm512_storeu_si512((__m512i *) ptr + 11, d12); + _mm512_storeu_si512((__m512i *) ptr + 12, d13); + _mm512_storeu_si512((__m512i *) ptr + 13, d14); + _mm512_storeu_si512((__m512i *) ptr + 14, d15); +} + + static NOINLINE void sort_16v(int32_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; + __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; + __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; + __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);; + __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);; + __m512i d14 = _mm512_loadu_si512((__m512i const *) ptr + 13);; + __m512i d15 = _mm512_loadu_si512((__m512i const *) ptr + 14);; + __m512i d16 = _mm512_loadu_si512((__m512i const *) ptr + 15);; + sort_16v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15, d16); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); + _mm512_storeu_si512((__m512i *) ptr + 7, d08); + _mm512_storeu_si512((__m512i *) ptr + 8, d09); + _mm512_storeu_si512((__m512i *) ptr + 9, d10); + _mm512_storeu_si512((__m512i *) ptr + 10, d11); + _mm512_storeu_si512((__m512i *) ptr + 11, d12); + _mm512_storeu_si512((__m512i *) ptr + 12, d13); + _mm512_storeu_si512((__m512i *) ptr + 13, d14); + _mm512_storeu_si512((__m512i *) ptr + 14, d15); + _mm512_storeu_si512((__m512i *) ptr + 15, d16); +} + static void sort(int32_t *ptr, size_t length); + +}; +} +} + +#undef i2d +#undef d2i +#undef i2s +#undef s2i +#undef s2d +#undef d2s + +#ifdef __GNUC__ +#ifdef __clang__ +#pragma clang attribute pop +#else +#pragma GCC pop_options +#endif +#endif +#endif + diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp new file mode 100644 index 000000000000..cf8b62809b36 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp @@ -0,0 +1,30 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "common.h" +#include "bitonic_sort.AVX512.int64_t.generated.h" + +using namespace vxsort; + +void vxsort::smallsort::bitonic::sort(int64_t *ptr, size_t length) { + const int N = 8; + + switch(length / N) { + case 1: sort_01v(ptr); break; + case 2: sort_02v(ptr); break; + case 3: sort_03v(ptr); break; + case 4: sort_04v(ptr); break; + case 5: sort_05v(ptr); break; + case 6: sort_06v(ptr); break; + case 7: sort_07v(ptr); break; + case 8: sort_08v(ptr); break; + case 9: sort_09v(ptr); break; + case 10: sort_10v(ptr); break; + case 11: sort_11v(ptr); break; + case 12: sort_12v(ptr); break; + case 13: sort_13v(ptr); break; + case 14: sort_14v(ptr); break; + case 15: sort_15v(ptr); break; + case 16: sort_16v(ptr); break; + } +} diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.h b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.h new file mode 100644 index 000000000000..483cf5a1e158 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.h @@ -0,0 +1,1347 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +///////////////////////////////////////////////////////////////////////////// +//// +// This file was auto-generated by a tool at 2020-06-22 05:27:48 +// +// It is recommended you DO NOT directly edit this file but instead edit +// the code-generator that generated this source file instead. +///////////////////////////////////////////////////////////////////////////// + +#ifndef BITONIC_SORT_AVX512_INT64_T_H +#define BITONIC_SORT_AVX512_INT64_T_H + + +#ifdef __GNUC__ +#ifdef __clang__ +#pragma clang attribute push (__attribute__((target("avx512f"))), apply_to = any(function)) +#else +#pragma GCC push_options +#pragma GCC target("avx512f") +#endif +#endif + +#include +#include "bitonic_sort.h" + +#define i2d _mm512_castsi512_pd +#define d2i _mm512_castpd_si512 +#define i2s _mm512_castsi512_ps +#define s2i _mm512_castps_si512 +#define s2d _mm512_castps_pd +#define d2s _mm521_castpd_ps + +namespace vxsort { +namespace smallsort { +template<> struct bitonic { +public: + + static INLINE void sort_01v_ascending(__m512i& d01) { + __m512i min, s; + + s = d2i(_mm512_permute_pd(i2d(d01), _MM_PERM_BBBB)); + min = _mm512_min_epi64(s, d01); + d01 = _mm512_mask_max_epi64(min, 0x00AA, s, d01); + + s = d2i(_mm512_permutex_pd(i2d(d01), _MM_PERM_ABCD)); + min = _mm512_min_epi64(s, d01); + d01 = _mm512_mask_max_epi64(min, 0x00CC, s, d01); + + s = d2i(_mm512_permute_pd(i2d(d01), _MM_PERM_BBBB)); + min = _mm512_min_epi64(s, d01); + d01 = _mm512_mask_max_epi64(min, 0x00AA, s, d01); + + s = d2i(_mm512_shuffle_f64x2(_mm512_permutex_pd(i2d(d01), _MM_PERM_ABCD), _mm512_permutex_pd(i2d(d01), _MM_PERM_ABCD), _MM_PERM_BADC)); + min = _mm512_min_epi64(s, d01); + d01 = _mm512_mask_max_epi64(min, 0x00F0, s, d01); + + s = d2i(_mm512_permutex_pd(i2d(d01), _MM_PERM_BADC)); + min = _mm512_min_epi64(s, d01); + d01 = _mm512_mask_max_epi64(min, 0x00CC, s, d01); + + s = d2i(_mm512_permute_pd(i2d(d01), _MM_PERM_BBBB)); + min = _mm512_min_epi64(s, d01); + d01 = _mm512_mask_max_epi64(min, 0x00AA, s, d01); + } + static INLINE void sort_01v_merge_ascending(__m512i& d01) { + __m512i min, s; + + s = d2i(_mm512_shuffle_f64x2(i2d(d01), i2d(d01), _MM_PERM_BADC)); + min = _mm512_min_epi64(s, d01); + d01 = _mm512_mask_max_epi64(min, 0x00F0, s, d01); + + s = d2i(_mm512_permutex_pd(i2d(d01), _MM_PERM_BADC)); + min = _mm512_min_epi64(s, d01); + d01 = _mm512_mask_max_epi64(min, 0x00CC, s, d01); + + s = d2i(_mm512_permute_pd(i2d(d01), _MM_PERM_BBBB)); + min = _mm512_min_epi64(s, d01); + d01 = _mm512_mask_max_epi64(min, 0x00AA, s, d01); + } + static INLINE void sort_01v_descending(__m512i& d01) { + __m512i min, s; + + s = d2i(_mm512_permute_pd(i2d(d01), _MM_PERM_BBBB)); + min = _mm512_min_epi64(s, d01); + d01 = _mm512_mask_max_epi64(min, 0x0055, s, d01); + + s = d2i(_mm512_permutex_pd(i2d(d01), _MM_PERM_ABCD)); + min = _mm512_min_epi64(s, d01); + d01 = _mm512_mask_max_epi64(min, 0x0033, s, d01); + + s = d2i(_mm512_permute_pd(i2d(d01), _MM_PERM_BBBB)); + min = _mm512_min_epi64(s, d01); + d01 = _mm512_mask_max_epi64(min, 0x0055, s, d01); + + s = d2i(_mm512_shuffle_f64x2(_mm512_permutex_pd(i2d(d01), _MM_PERM_ABCD), _mm512_permutex_pd(i2d(d01), _MM_PERM_ABCD), _MM_PERM_BADC)); + min = _mm512_min_epi64(s, d01); + d01 = _mm512_mask_max_epi64(min, 0x000F, s, d01); + + s = d2i(_mm512_permutex_pd(i2d(d01), _MM_PERM_BADC)); + min = _mm512_min_epi64(s, d01); + d01 = _mm512_mask_max_epi64(min, 0x0033, s, d01); + + s = d2i(_mm512_permute_pd(i2d(d01), _MM_PERM_BBBB)); + min = _mm512_min_epi64(s, d01); + d01 = _mm512_mask_max_epi64(min, 0x0055, s, d01); + } + static INLINE void sort_01v_merge_descending(__m512i& d01) { + __m512i min, s; + + s = d2i(_mm512_shuffle_f64x2(i2d(d01), i2d(d01), _MM_PERM_BADC)); + min = _mm512_min_epi64(s, d01); + d01 = _mm512_mask_max_epi64(min, 0x000F, s, d01); + + s = d2i(_mm512_permutex_pd(i2d(d01), _MM_PERM_BADC)); + min = _mm512_min_epi64(s, d01); + d01 = _mm512_mask_max_epi64(min, 0x0033, s, d01); + + s = d2i(_mm512_permute_pd(i2d(d01), _MM_PERM_BBBB)); + min = _mm512_min_epi64(s, d01); + d01 = _mm512_mask_max_epi64(min, 0x0055, s, d01); + } + static INLINE void sort_02v_ascending(__m512i& d01, __m512i& d02) { + __m512i tmp; + + sort_01v_ascending(d01); + sort_01v_descending(d02); + + tmp = d02; + d02 = _mm512_max_epi64(d01, d02); + d01 = _mm512_min_epi64(d01, tmp); + + sort_01v_merge_ascending(d01); + sort_01v_merge_ascending(d02); + } + static INLINE void sort_02v_descending(__m512i& d01, __m512i& d02) { + __m512i tmp; + + sort_01v_descending(d01); + sort_01v_ascending(d02); + + tmp = d02; + d02 = _mm512_max_epi64(d01, d02); + d01 = _mm512_min_epi64(d01, tmp); + + sort_01v_merge_descending(d01); + sort_01v_merge_descending(d02); + } + static INLINE void sort_02v_merge_ascending(__m512i& d01, __m512i& d02) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi64(d02, d01); + d02 = _mm512_max_epi64(d02, tmp); + + sort_01v_merge_ascending(d01); + sort_01v_merge_ascending(d02); + } + static INLINE void sort_02v_merge_descending(__m512i& d01, __m512i& d02) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi64(d02, d01); + d02 = _mm512_max_epi64(d02, tmp); + + sort_01v_merge_descending(d01); + sort_01v_merge_descending(d02); + } + static INLINE void sort_03v_ascending(__m512i& d01, __m512i& d02, __m512i& d03) { + __m512i tmp; + + sort_02v_ascending(d01, d02); + sort_01v_descending(d03); + + tmp = d03; + d03 = _mm512_max_epi64(d02, d03); + d02 = _mm512_min_epi64(d02, tmp); + + sort_02v_merge_ascending(d01, d02); + sort_01v_merge_ascending(d03); + } + static INLINE void sort_03v_descending(__m512i& d01, __m512i& d02, __m512i& d03) { + __m512i tmp; + + sort_02v_descending(d01, d02); + sort_01v_ascending(d03); + + tmp = d03; + d03 = _mm512_max_epi64(d02, d03); + d02 = _mm512_min_epi64(d02, tmp); + + sort_02v_merge_descending(d01, d02); + sort_01v_merge_descending(d03); + } + static INLINE void sort_03v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi64(d03, d01); + d03 = _mm512_max_epi64(d03, tmp); + + sort_02v_merge_ascending(d01, d02); + sort_01v_merge_ascending(d03); + } + static INLINE void sort_03v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi64(d03, d01); + d03 = _mm512_max_epi64(d03, tmp); + + sort_02v_merge_descending(d01, d02); + sort_01v_merge_descending(d03); + } + static INLINE void sort_04v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { + __m512i tmp; + + sort_02v_ascending(d01, d02); + sort_02v_descending(d03, d04); + + tmp = d03; + d03 = _mm512_max_epi64(d02, d03); + d02 = _mm512_min_epi64(d02, tmp); + + tmp = d04; + d04 = _mm512_max_epi64(d01, d04); + d01 = _mm512_min_epi64(d01, tmp); + + sort_02v_merge_ascending(d01, d02); + sort_02v_merge_ascending(d03, d04); + } + static INLINE void sort_04v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { + __m512i tmp; + + sort_02v_descending(d01, d02); + sort_02v_ascending(d03, d04); + + tmp = d03; + d03 = _mm512_max_epi64(d02, d03); + d02 = _mm512_min_epi64(d02, tmp); + + tmp = d04; + d04 = _mm512_max_epi64(d01, d04); + d01 = _mm512_min_epi64(d01, tmp); + + sort_02v_merge_descending(d01, d02); + sort_02v_merge_descending(d03, d04); + } + static INLINE void sort_04v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi64(d03, d01); + d03 = _mm512_max_epi64(d03, tmp); + + tmp = d02; + d02 = _mm512_min_epi64(d04, d02); + d04 = _mm512_max_epi64(d04, tmp); + + sort_02v_merge_ascending(d01, d02); + sort_02v_merge_ascending(d03, d04); + } + static INLINE void sort_04v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi64(d03, d01); + d03 = _mm512_max_epi64(d03, tmp); + + tmp = d02; + d02 = _mm512_min_epi64(d04, d02); + d04 = _mm512_max_epi64(d04, tmp); + + sort_02v_merge_descending(d01, d02); + sort_02v_merge_descending(d03, d04); + } + static INLINE void sort_05v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05) { + __m512i tmp; + + sort_04v_ascending(d01, d02, d03, d04); + sort_01v_descending(d05); + + tmp = d05; + d05 = _mm512_max_epi64(d04, d05); + d04 = _mm512_min_epi64(d04, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_01v_merge_ascending(d05); + } + static INLINE void sort_05v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05) { + __m512i tmp; + + sort_04v_descending(d01, d02, d03, d04); + sort_01v_ascending(d05); + + tmp = d05; + d05 = _mm512_max_epi64(d04, d05); + d04 = _mm512_min_epi64(d04, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_01v_merge_descending(d05); + } + static INLINE void sort_05v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi64(d05, d01); + d05 = _mm512_max_epi64(d05, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_01v_merge_ascending(d05); + } + static INLINE void sort_05v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi64(d05, d01); + d05 = _mm512_max_epi64(d05, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_01v_merge_descending(d05); + } + static INLINE void sort_06v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06) { + __m512i tmp; + + sort_04v_ascending(d01, d02, d03, d04); + sort_02v_descending(d05, d06); + + tmp = d05; + d05 = _mm512_max_epi64(d04, d05); + d04 = _mm512_min_epi64(d04, tmp); + + tmp = d06; + d06 = _mm512_max_epi64(d03, d06); + d03 = _mm512_min_epi64(d03, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_02v_merge_ascending(d05, d06); + } + static INLINE void sort_06v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06) { + __m512i tmp; + + sort_04v_descending(d01, d02, d03, d04); + sort_02v_ascending(d05, d06); + + tmp = d05; + d05 = _mm512_max_epi64(d04, d05); + d04 = _mm512_min_epi64(d04, tmp); + + tmp = d06; + d06 = _mm512_max_epi64(d03, d06); + d03 = _mm512_min_epi64(d03, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_02v_merge_descending(d05, d06); + } + static INLINE void sort_06v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi64(d05, d01); + d05 = _mm512_max_epi64(d05, tmp); + + tmp = d02; + d02 = _mm512_min_epi64(d06, d02); + d06 = _mm512_max_epi64(d06, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_02v_merge_ascending(d05, d06); + } + static INLINE void sort_06v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi64(d05, d01); + d05 = _mm512_max_epi64(d05, tmp); + + tmp = d02; + d02 = _mm512_min_epi64(d06, d02); + d06 = _mm512_max_epi64(d06, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_02v_merge_descending(d05, d06); + } + static INLINE void sort_07v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07) { + __m512i tmp; + + sort_04v_ascending(d01, d02, d03, d04); + sort_03v_descending(d05, d06, d07); + + tmp = d05; + d05 = _mm512_max_epi64(d04, d05); + d04 = _mm512_min_epi64(d04, tmp); + + tmp = d06; + d06 = _mm512_max_epi64(d03, d06); + d03 = _mm512_min_epi64(d03, tmp); + + tmp = d07; + d07 = _mm512_max_epi64(d02, d07); + d02 = _mm512_min_epi64(d02, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_03v_merge_ascending(d05, d06, d07); + } + static INLINE void sort_07v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07) { + __m512i tmp; + + sort_04v_descending(d01, d02, d03, d04); + sort_03v_ascending(d05, d06, d07); + + tmp = d05; + d05 = _mm512_max_epi64(d04, d05); + d04 = _mm512_min_epi64(d04, tmp); + + tmp = d06; + d06 = _mm512_max_epi64(d03, d06); + d03 = _mm512_min_epi64(d03, tmp); + + tmp = d07; + d07 = _mm512_max_epi64(d02, d07); + d02 = _mm512_min_epi64(d02, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_03v_merge_descending(d05, d06, d07); + } + static INLINE void sort_07v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi64(d05, d01); + d05 = _mm512_max_epi64(d05, tmp); + + tmp = d02; + d02 = _mm512_min_epi64(d06, d02); + d06 = _mm512_max_epi64(d06, tmp); + + tmp = d03; + d03 = _mm512_min_epi64(d07, d03); + d07 = _mm512_max_epi64(d07, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_03v_merge_ascending(d05, d06, d07); + } + static INLINE void sort_07v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi64(d05, d01); + d05 = _mm512_max_epi64(d05, tmp); + + tmp = d02; + d02 = _mm512_min_epi64(d06, d02); + d06 = _mm512_max_epi64(d06, tmp); + + tmp = d03; + d03 = _mm512_min_epi64(d07, d03); + d07 = _mm512_max_epi64(d07, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_03v_merge_descending(d05, d06, d07); + } + static INLINE void sort_08v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { + __m512i tmp; + + sort_04v_ascending(d01, d02, d03, d04); + sort_04v_descending(d05, d06, d07, d08); + + tmp = d05; + d05 = _mm512_max_epi64(d04, d05); + d04 = _mm512_min_epi64(d04, tmp); + + tmp = d06; + d06 = _mm512_max_epi64(d03, d06); + d03 = _mm512_min_epi64(d03, tmp); + + tmp = d07; + d07 = _mm512_max_epi64(d02, d07); + d02 = _mm512_min_epi64(d02, tmp); + + tmp = d08; + d08 = _mm512_max_epi64(d01, d08); + d01 = _mm512_min_epi64(d01, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_04v_merge_ascending(d05, d06, d07, d08); + } + static INLINE void sort_08v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { + __m512i tmp; + + sort_04v_descending(d01, d02, d03, d04); + sort_04v_ascending(d05, d06, d07, d08); + + tmp = d05; + d05 = _mm512_max_epi64(d04, d05); + d04 = _mm512_min_epi64(d04, tmp); + + tmp = d06; + d06 = _mm512_max_epi64(d03, d06); + d03 = _mm512_min_epi64(d03, tmp); + + tmp = d07; + d07 = _mm512_max_epi64(d02, d07); + d02 = _mm512_min_epi64(d02, tmp); + + tmp = d08; + d08 = _mm512_max_epi64(d01, d08); + d01 = _mm512_min_epi64(d01, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_04v_merge_descending(d05, d06, d07, d08); + } + static INLINE void sort_08v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi64(d05, d01); + d05 = _mm512_max_epi64(d05, tmp); + + tmp = d02; + d02 = _mm512_min_epi64(d06, d02); + d06 = _mm512_max_epi64(d06, tmp); + + tmp = d03; + d03 = _mm512_min_epi64(d07, d03); + d07 = _mm512_max_epi64(d07, tmp); + + tmp = d04; + d04 = _mm512_min_epi64(d08, d04); + d08 = _mm512_max_epi64(d08, tmp); + + sort_04v_merge_ascending(d01, d02, d03, d04); + sort_04v_merge_ascending(d05, d06, d07, d08); + } + static INLINE void sort_08v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { + __m512i tmp; + + tmp = d01; + d01 = _mm512_min_epi64(d05, d01); + d05 = _mm512_max_epi64(d05, tmp); + + tmp = d02; + d02 = _mm512_min_epi64(d06, d02); + d06 = _mm512_max_epi64(d06, tmp); + + tmp = d03; + d03 = _mm512_min_epi64(d07, d03); + d07 = _mm512_max_epi64(d07, tmp); + + tmp = d04; + d04 = _mm512_min_epi64(d08, d04); + d08 = _mm512_max_epi64(d08, tmp); + + sort_04v_merge_descending(d01, d02, d03, d04); + sort_04v_merge_descending(d05, d06, d07, d08); + } + static INLINE void sort_09v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09) { + __m512i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_01v_descending(d09); + + tmp = d09; + d09 = _mm512_max_epi64(d08, d09); + d08 = _mm512_min_epi64(d08, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_01v_merge_ascending(d09); + } + static INLINE void sort_09v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09) { + __m512i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_01v_ascending(d09); + + tmp = d09; + d09 = _mm512_max_epi64(d08, d09); + d08 = _mm512_min_epi64(d08, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_01v_merge_descending(d09); + } + static INLINE void sort_10v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10) { + __m512i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_02v_descending(d09, d10); + + tmp = d09; + d09 = _mm512_max_epi64(d08, d09); + d08 = _mm512_min_epi64(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi64(d07, d10); + d07 = _mm512_min_epi64(d07, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_02v_merge_ascending(d09, d10); + } + static INLINE void sort_10v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10) { + __m512i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_02v_ascending(d09, d10); + + tmp = d09; + d09 = _mm512_max_epi64(d08, d09); + d08 = _mm512_min_epi64(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi64(d07, d10); + d07 = _mm512_min_epi64(d07, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_02v_merge_descending(d09, d10); + } + static INLINE void sort_11v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11) { + __m512i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_03v_descending(d09, d10, d11); + + tmp = d09; + d09 = _mm512_max_epi64(d08, d09); + d08 = _mm512_min_epi64(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi64(d07, d10); + d07 = _mm512_min_epi64(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi64(d06, d11); + d06 = _mm512_min_epi64(d06, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_03v_merge_ascending(d09, d10, d11); + } + static INLINE void sort_11v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11) { + __m512i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_03v_ascending(d09, d10, d11); + + tmp = d09; + d09 = _mm512_max_epi64(d08, d09); + d08 = _mm512_min_epi64(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi64(d07, d10); + d07 = _mm512_min_epi64(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi64(d06, d11); + d06 = _mm512_min_epi64(d06, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_03v_merge_descending(d09, d10, d11); + } + static INLINE void sort_12v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12) { + __m512i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_04v_descending(d09, d10, d11, d12); + + tmp = d09; + d09 = _mm512_max_epi64(d08, d09); + d08 = _mm512_min_epi64(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi64(d07, d10); + d07 = _mm512_min_epi64(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi64(d06, d11); + d06 = _mm512_min_epi64(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi64(d05, d12); + d05 = _mm512_min_epi64(d05, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_04v_merge_ascending(d09, d10, d11, d12); + } + static INLINE void sort_12v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12) { + __m512i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_04v_ascending(d09, d10, d11, d12); + + tmp = d09; + d09 = _mm512_max_epi64(d08, d09); + d08 = _mm512_min_epi64(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi64(d07, d10); + d07 = _mm512_min_epi64(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi64(d06, d11); + d06 = _mm512_min_epi64(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi64(d05, d12); + d05 = _mm512_min_epi64(d05, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_04v_merge_descending(d09, d10, d11, d12); + } + static INLINE void sort_13v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13) { + __m512i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_05v_descending(d09, d10, d11, d12, d13); + + tmp = d09; + d09 = _mm512_max_epi64(d08, d09); + d08 = _mm512_min_epi64(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi64(d07, d10); + d07 = _mm512_min_epi64(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi64(d06, d11); + d06 = _mm512_min_epi64(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi64(d05, d12); + d05 = _mm512_min_epi64(d05, tmp); + + tmp = d13; + d13 = _mm512_max_epi64(d04, d13); + d04 = _mm512_min_epi64(d04, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_05v_merge_ascending(d09, d10, d11, d12, d13); + } + static INLINE void sort_13v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13) { + __m512i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_05v_ascending(d09, d10, d11, d12, d13); + + tmp = d09; + d09 = _mm512_max_epi64(d08, d09); + d08 = _mm512_min_epi64(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi64(d07, d10); + d07 = _mm512_min_epi64(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi64(d06, d11); + d06 = _mm512_min_epi64(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi64(d05, d12); + d05 = _mm512_min_epi64(d05, tmp); + + tmp = d13; + d13 = _mm512_max_epi64(d04, d13); + d04 = _mm512_min_epi64(d04, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_05v_merge_descending(d09, d10, d11, d12, d13); + } + static INLINE void sort_14v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14) { + __m512i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_06v_descending(d09, d10, d11, d12, d13, d14); + + tmp = d09; + d09 = _mm512_max_epi64(d08, d09); + d08 = _mm512_min_epi64(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi64(d07, d10); + d07 = _mm512_min_epi64(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi64(d06, d11); + d06 = _mm512_min_epi64(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi64(d05, d12); + d05 = _mm512_min_epi64(d05, tmp); + + tmp = d13; + d13 = _mm512_max_epi64(d04, d13); + d04 = _mm512_min_epi64(d04, tmp); + + tmp = d14; + d14 = _mm512_max_epi64(d03, d14); + d03 = _mm512_min_epi64(d03, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_06v_merge_ascending(d09, d10, d11, d12, d13, d14); + } + static INLINE void sort_14v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14) { + __m512i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_06v_ascending(d09, d10, d11, d12, d13, d14); + + tmp = d09; + d09 = _mm512_max_epi64(d08, d09); + d08 = _mm512_min_epi64(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi64(d07, d10); + d07 = _mm512_min_epi64(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi64(d06, d11); + d06 = _mm512_min_epi64(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi64(d05, d12); + d05 = _mm512_min_epi64(d05, tmp); + + tmp = d13; + d13 = _mm512_max_epi64(d04, d13); + d04 = _mm512_min_epi64(d04, tmp); + + tmp = d14; + d14 = _mm512_max_epi64(d03, d14); + d03 = _mm512_min_epi64(d03, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_06v_merge_descending(d09, d10, d11, d12, d13, d14); + } + static INLINE void sort_15v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15) { + __m512i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_07v_descending(d09, d10, d11, d12, d13, d14, d15); + + tmp = d09; + d09 = _mm512_max_epi64(d08, d09); + d08 = _mm512_min_epi64(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi64(d07, d10); + d07 = _mm512_min_epi64(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi64(d06, d11); + d06 = _mm512_min_epi64(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi64(d05, d12); + d05 = _mm512_min_epi64(d05, tmp); + + tmp = d13; + d13 = _mm512_max_epi64(d04, d13); + d04 = _mm512_min_epi64(d04, tmp); + + tmp = d14; + d14 = _mm512_max_epi64(d03, d14); + d03 = _mm512_min_epi64(d03, tmp); + + tmp = d15; + d15 = _mm512_max_epi64(d02, d15); + d02 = _mm512_min_epi64(d02, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_07v_merge_ascending(d09, d10, d11, d12, d13, d14, d15); + } + static INLINE void sort_15v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15) { + __m512i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_07v_ascending(d09, d10, d11, d12, d13, d14, d15); + + tmp = d09; + d09 = _mm512_max_epi64(d08, d09); + d08 = _mm512_min_epi64(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi64(d07, d10); + d07 = _mm512_min_epi64(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi64(d06, d11); + d06 = _mm512_min_epi64(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi64(d05, d12); + d05 = _mm512_min_epi64(d05, tmp); + + tmp = d13; + d13 = _mm512_max_epi64(d04, d13); + d04 = _mm512_min_epi64(d04, tmp); + + tmp = d14; + d14 = _mm512_max_epi64(d03, d14); + d03 = _mm512_min_epi64(d03, tmp); + + tmp = d15; + d15 = _mm512_max_epi64(d02, d15); + d02 = _mm512_min_epi64(d02, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_07v_merge_descending(d09, d10, d11, d12, d13, d14, d15); + } + static INLINE void sort_16v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15, __m512i& d16) { + __m512i tmp; + + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_08v_descending(d09, d10, d11, d12, d13, d14, d15, d16); + + tmp = d09; + d09 = _mm512_max_epi64(d08, d09); + d08 = _mm512_min_epi64(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi64(d07, d10); + d07 = _mm512_min_epi64(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi64(d06, d11); + d06 = _mm512_min_epi64(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi64(d05, d12); + d05 = _mm512_min_epi64(d05, tmp); + + tmp = d13; + d13 = _mm512_max_epi64(d04, d13); + d04 = _mm512_min_epi64(d04, tmp); + + tmp = d14; + d14 = _mm512_max_epi64(d03, d14); + d03 = _mm512_min_epi64(d03, tmp); + + tmp = d15; + d15 = _mm512_max_epi64(d02, d15); + d02 = _mm512_min_epi64(d02, tmp); + + tmp = d16; + d16 = _mm512_max_epi64(d01, d16); + d01 = _mm512_min_epi64(d01, tmp); + + sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_08v_merge_ascending(d09, d10, d11, d12, d13, d14, d15, d16); + } + static INLINE void sort_16v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15, __m512i& d16) { + __m512i tmp; + + sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_08v_ascending(d09, d10, d11, d12, d13, d14, d15, d16); + + tmp = d09; + d09 = _mm512_max_epi64(d08, d09); + d08 = _mm512_min_epi64(d08, tmp); + + tmp = d10; + d10 = _mm512_max_epi64(d07, d10); + d07 = _mm512_min_epi64(d07, tmp); + + tmp = d11; + d11 = _mm512_max_epi64(d06, d11); + d06 = _mm512_min_epi64(d06, tmp); + + tmp = d12; + d12 = _mm512_max_epi64(d05, d12); + d05 = _mm512_min_epi64(d05, tmp); + + tmp = d13; + d13 = _mm512_max_epi64(d04, d13); + d04 = _mm512_min_epi64(d04, tmp); + + tmp = d14; + d14 = _mm512_max_epi64(d03, d14); + d03 = _mm512_min_epi64(d03, tmp); + + tmp = d15; + d15 = _mm512_max_epi64(d02, d15); + d02 = _mm512_min_epi64(d02, tmp); + + tmp = d16; + d16 = _mm512_max_epi64(d01, d16); + d01 = _mm512_min_epi64(d01, tmp); + + sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); + sort_08v_merge_descending(d09, d10, d11, d12, d13, d14, d15, d16); + } + + static NOINLINE void sort_01v(int64_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + sort_01v_ascending(d01); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); +} + + static NOINLINE void sort_02v(int64_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + sort_02v_ascending(d01, d02); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); +} + + static NOINLINE void sort_03v(int64_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + sort_03v_ascending(d01, d02, d03); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); +} + + static NOINLINE void sort_04v(int64_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + sort_04v_ascending(d01, d02, d03, d04); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); +} + + static NOINLINE void sort_05v(int64_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + sort_05v_ascending(d01, d02, d03, d04, d05); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); +} + + static NOINLINE void sort_06v(int64_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + sort_06v_ascending(d01, d02, d03, d04, d05, d06); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); +} + + static NOINLINE void sort_07v(int64_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + sort_07v_ascending(d01, d02, d03, d04, d05, d06, d07); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); +} + + static NOINLINE void sort_08v(int64_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); + _mm512_storeu_si512((__m512i *) ptr + 7, d08); +} + + static NOINLINE void sort_09v(int64_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; + sort_09v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); + _mm512_storeu_si512((__m512i *) ptr + 7, d08); + _mm512_storeu_si512((__m512i *) ptr + 8, d09); +} + + static NOINLINE void sort_10v(int64_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; + __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; + sort_10v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); + _mm512_storeu_si512((__m512i *) ptr + 7, d08); + _mm512_storeu_si512((__m512i *) ptr + 8, d09); + _mm512_storeu_si512((__m512i *) ptr + 9, d10); +} + + static NOINLINE void sort_11v(int64_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; + __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; + __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; + sort_11v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); + _mm512_storeu_si512((__m512i *) ptr + 7, d08); + _mm512_storeu_si512((__m512i *) ptr + 8, d09); + _mm512_storeu_si512((__m512i *) ptr + 9, d10); + _mm512_storeu_si512((__m512i *) ptr + 10, d11); +} + + static NOINLINE void sort_12v(int64_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; + __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; + __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; + __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);; + sort_12v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); + _mm512_storeu_si512((__m512i *) ptr + 7, d08); + _mm512_storeu_si512((__m512i *) ptr + 8, d09); + _mm512_storeu_si512((__m512i *) ptr + 9, d10); + _mm512_storeu_si512((__m512i *) ptr + 10, d11); + _mm512_storeu_si512((__m512i *) ptr + 11, d12); +} + + static NOINLINE void sort_13v(int64_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; + __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; + __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; + __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);; + __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);; + sort_13v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); + _mm512_storeu_si512((__m512i *) ptr + 7, d08); + _mm512_storeu_si512((__m512i *) ptr + 8, d09); + _mm512_storeu_si512((__m512i *) ptr + 9, d10); + _mm512_storeu_si512((__m512i *) ptr + 10, d11); + _mm512_storeu_si512((__m512i *) ptr + 11, d12); + _mm512_storeu_si512((__m512i *) ptr + 12, d13); +} + + static NOINLINE void sort_14v(int64_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; + __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; + __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; + __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);; + __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);; + __m512i d14 = _mm512_loadu_si512((__m512i const *) ptr + 13);; + sort_14v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); + _mm512_storeu_si512((__m512i *) ptr + 7, d08); + _mm512_storeu_si512((__m512i *) ptr + 8, d09); + _mm512_storeu_si512((__m512i *) ptr + 9, d10); + _mm512_storeu_si512((__m512i *) ptr + 10, d11); + _mm512_storeu_si512((__m512i *) ptr + 11, d12); + _mm512_storeu_si512((__m512i *) ptr + 12, d13); + _mm512_storeu_si512((__m512i *) ptr + 13, d14); +} + + static NOINLINE void sort_15v(int64_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; + __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; + __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; + __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);; + __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);; + __m512i d14 = _mm512_loadu_si512((__m512i const *) ptr + 13);; + __m512i d15 = _mm512_loadu_si512((__m512i const *) ptr + 14);; + sort_15v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); + _mm512_storeu_si512((__m512i *) ptr + 7, d08); + _mm512_storeu_si512((__m512i *) ptr + 8, d09); + _mm512_storeu_si512((__m512i *) ptr + 9, d10); + _mm512_storeu_si512((__m512i *) ptr + 10, d11); + _mm512_storeu_si512((__m512i *) ptr + 11, d12); + _mm512_storeu_si512((__m512i *) ptr + 12, d13); + _mm512_storeu_si512((__m512i *) ptr + 13, d14); + _mm512_storeu_si512((__m512i *) ptr + 14, d15); +} + + static NOINLINE void sort_16v(int64_t *ptr) { + __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; + __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; + __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; + __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);; + __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);; + __m512i d14 = _mm512_loadu_si512((__m512i const *) ptr + 13);; + __m512i d15 = _mm512_loadu_si512((__m512i const *) ptr + 14);; + __m512i d16 = _mm512_loadu_si512((__m512i const *) ptr + 15);; + sort_16v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15, d16); + _mm512_storeu_si512((__m512i *) ptr + 0, d01); + _mm512_storeu_si512((__m512i *) ptr + 1, d02); + _mm512_storeu_si512((__m512i *) ptr + 2, d03); + _mm512_storeu_si512((__m512i *) ptr + 3, d04); + _mm512_storeu_si512((__m512i *) ptr + 4, d05); + _mm512_storeu_si512((__m512i *) ptr + 5, d06); + _mm512_storeu_si512((__m512i *) ptr + 6, d07); + _mm512_storeu_si512((__m512i *) ptr + 7, d08); + _mm512_storeu_si512((__m512i *) ptr + 8, d09); + _mm512_storeu_si512((__m512i *) ptr + 9, d10); + _mm512_storeu_si512((__m512i *) ptr + 10, d11); + _mm512_storeu_si512((__m512i *) ptr + 11, d12); + _mm512_storeu_si512((__m512i *) ptr + 12, d13); + _mm512_storeu_si512((__m512i *) ptr + 13, d14); + _mm512_storeu_si512((__m512i *) ptr + 14, d15); + _mm512_storeu_si512((__m512i *) ptr + 15, d16); +} + static void sort(int64_t *ptr, size_t length); + +}; +} +} + +#undef i2d +#undef d2i +#undef i2s +#undef s2i +#undef s2d +#undef d2s + +#ifdef __GNUC__ +#ifdef __clang__ +#pragma clang attribute pop +#else +#pragma GCC pop_options +#endif +#endif +#endif + diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.h b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.h new file mode 100644 index 000000000000..0e87b3742266 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.h @@ -0,0 +1,20 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef BITONIC_SORT_H +#define BITONIC_SORT_H + +#include +#include "../defs.h" +#include "../machine_traits.h" + +namespace vxsort { +namespace smallsort { +template +struct bitonic { + public: + static void sort(T* ptr, size_t length); +}; +} // namespace smallsort +} // namespace gcsort +#endif diff --git a/src/coreclr/src/gc/vxsort/smallsort/codegen/avx2.py b/src/coreclr/src/gc/vxsort/smallsort/codegen/avx2.py new file mode 100644 index 000000000000..5f941d37ff1e --- /dev/null +++ b/src/coreclr/src/gc/vxsort/smallsort/codegen/avx2.py @@ -0,0 +1,490 @@ +## +## Licensed to the .NET Foundation under one or more agreements. +## The .NET Foundation licenses this file to you under the MIT license. +## + +import os +from datetime import datetime + +from utils import native_size_map, next_power_of_2 +from bitonic_isa import BitonicISA + + +class AVX2BitonicISA(BitonicISA): + def __init__(self, type): + self.vector_size_in_bytes = 32 + + self.type = type + + self.bitonic_size_map = {} + + for t, s in native_size_map.items(): + self.bitonic_size_map[t] = int(self.vector_size_in_bytes / s) + + self.bitonic_type_map = { + "int32_t": "__m256i", + "uint32_t": "__m256i", + "float": "__m256", + "int64_t": "__m256i", + "uint64_t": "__m256i", + "double": "__m256d", + } + + def max_bitonic_sort_vectors(self): + return 16 + + def vector_size(self): + return self.bitonic_size_map[self.type] + + def vector_type(self): + return self.bitonic_type_map[self.type] + + @classmethod + def supported_types(cls): + return native_size_map.keys() + + def i2d(self, v): + t = self.type + if t == "double": + return v + elif t == "float": + return f"s2d({v})" + return f"i2d({v})" + + def i2s(self, v): + t = self.type + if t == "double": + raise Exception("Incorrect Type") + elif t == "float": + return f"i2s({v})" + return v + + def d2i(self, v): + t = self.type + if t == "double": + return v + elif t == "float": + return f"d2s({v})" + return f"d2i({v})" + + def s2i(self, v): + t = self.type + if t == "double": + raise Exception("Incorrect Type") + elif t == "float": + return f"s2i({v})" + return v + + def generate_param_list(self, start, numParams): + return str.join(", ", list(map(lambda p: f"d{p:02d}", range(start, start + numParams)))) + + def generate_param_def_list(self, numParams): + t = self.type + return str.join(", ", list(map(lambda p: f"{self.vector_type()}& d{p:02d}", range(1, numParams + 1)))) + + def generate_shuffle_X1(self, v): + size = self.vector_size() + if size == 8: + return self.i2s(f"_mm256_shuffle_epi32({self.s2i(v)}, 0xB1)") + elif size == 4: + return self.d2i(f"_mm256_shuffle_pd({self.i2d(v)}, {self.i2d(v)}, 0x5)") + + def generate_shuffle_X2(self, v): + size = self.vector_size() + if size == 8: + return self.i2s(f"_mm256_shuffle_epi32({self.s2i(v)}, 0x4E)") + elif size == 4: + return self.d2i(f"_mm256_permute4x64_pd({self.i2d(v)}, 0x4E)") + + def generate_shuffle_XR(self, v): + size = self.vector_size() + if size == 8: + return self.i2s(f"_mm256_shuffle_epi32({self.s2i(v)}, 0x1B)") + elif size == 4: + return self.d2i(f"_mm256_permute4x64_pd({self.i2d(v)}, 0x1B)") + + def generate_blend_B1(self, v1, v2, ascending): + size = self.vector_size() + if size == 8: + if ascending: + return self.i2s(f"_mm256_blend_epi32({self.s2i(v1)}, {self.s2i(v2)}, 0xAA)") + else: + return self.i2s(f"_mm256_blend_epi32({self.s2i(v2)}, {self.s2i(v1)}, 0xAA)") + elif size == 4: + if ascending: + return self.d2i(f"_mm256_blend_pd({self.i2d(v1)}, {self.i2d(v2)}, 0xA)") + else: + return self.d2i(f"_mm256_blend_pd({self.i2d(v2)}, {self.i2d(v1)}, 0xA)") + + def generate_blend_B2(self, v1, v2, ascending): + size = self.vector_size() + if size == 8: + if ascending: + return self.i2s(f"_mm256_blend_epi32({self.s2i(v1)}, {self.s2i(v2)}, 0xCC)") + else: + return self.i2s(f"_mm256_blend_epi32({self.s2i(v2)}, {self.s2i(v1)}, 0xCC)") + elif size == 4: + if ascending: + return self.d2i(f"_mm256_blend_pd({self.i2d(v1)}, {self.i2d(v2)}, 0xC)") + else: + return self.d2i(f"_mm256_blend_pd({self.i2d(v2)}, {self.i2d(v1)}, 0xC)") + + def generate_blend_B4(self, v1, v2, ascending): + size = self.vector_size() + if size == 8: + if ascending: + return self.i2s(f"_mm256_blend_epi32({self.s2i(v1)}, {self.s2i(v2)}, 0xF0)") + else: + return self.i2s(f"_mm256_blend_epi32({self.s2i(v2)}, {self.s2i(v1)}, 0xF0)") + elif size == 4: + raise Exception("Incorrect Size") + + def generate_cross(self, v): + size = self.vector_size() + if size == 8: + return self.d2i(f"_mm256_permute4x64_pd({self.i2d(v)}, 0x4E)") + elif size == 4: + raise Exception("Incorrect Size") + + def generate_reverse(self, v): + size = self.vector_size() + if size == 8: + v = f"_mm256_shuffle_epi32({self.s2i(v)}, 0x1B)" + return self.d2i(f"_mm256_permute4x64_pd(i2d({v}), 0x4E)") + elif size == 4: + return self.d2i(f"_mm256_permute4x64_pd({self.i2d(v)}, 0x1B)") + + def crappity_crap_crap(self, v1, v2): + t = self.type + if t == "int64_t": + return f"cmp = _mm256_cmpgt_epi64({v1}, {v2});" + elif t == "uint64_t": + return f"cmp = _mm256_cmpgt_epi64(_mm256_xor_si256(topBit, {v1}), _mm256_xor_si256(topBit, {v2}));" + + return "" + + def generate_min(self, v1, v2): + t = self.type + if t == "int32_t": + return f"_mm256_min_epi32({v1}, {v2})" + elif t == "uint32_t": + return f"_mm256_min_epu32({v1}, {v2})" + elif t == "float": + return f"_mm256_min_ps({v1}, {v2})" + elif t == "int64_t": + return self.d2i(f"_mm256_blendv_pd({self.i2d(v1)}, {self.i2d(v2)}, i2d(cmp))") + elif t == "uint64_t": + return self.d2i(f"_mm256_blendv_pd({self.i2d(v1)}, {self.i2d(v2)}, i2d(cmp))") + elif t == "double": + return f"_mm256_min_pd({v1}, {v2})" + + def generate_max(self, v1, v2): + t = self.type + if t == "int32_t": + return f"_mm256_max_epi32({v1}, {v2})" + elif t == "uint32_t": + return f"_mm256_max_epu32({v1}, {v2})" + elif t == "float": + return f"_mm256_max_ps({v1}, {v2})" + elif t == "int64_t": + return self.d2i(f"_mm256_blendv_pd({self.i2d(v2)}, {self.i2d(v1)}, i2d(cmp))") + elif t == "uint64_t": + return self.d2i(f"_mm256_blendv_pd({self.i2d(v2)}, {self.i2d(v1)}, i2d(cmp))") + elif t == "double": + return f"_mm256_max_pd({v1}, {v2})" + + def get_load_intrinsic(self, v, offset): + t = self.type + if t == "double": + return f"_mm256_loadu_pd(({t} const *) ((__m256d const *) {v} + {offset}))" + if t == "float": + return f"_mm256_loadu_ps(({t} const *) ((__m256 const *) {v} + {offset}))" + return f"_mm256_lddqu_si256((__m256i const *) {v} + {offset});" + + + def get_store_intrinsic(self, ptr, offset, value): + t = self.type + if t == "double": + return f"_mm256_storeu_pd(({t} *) ((__m256d *) {ptr} + {offset}), {value})" + if t == "float": + return f"_mm256_storeu_ps(({t} *) ((__m256 *) {ptr} + {offset}), {value})" + return f"_mm256_storeu_si256((__m256i *) {ptr} + {offset}, {value})" + + def autogenerated_blabber(self): + return f"""///////////////////////////////////////////////////////////////////////////// +//// +// This file was auto-generated by a tool at {datetime.now().strftime("%F %H:%M:%S")} +// +// It is recommended you DO NOT directly edit this file but instead edit +// the code-generator that generated this source file instead. +/////////////////////////////////////////////////////////////////////////////""" + + def generate_prologue(self, f): + t = self.type + s = f"""{self.autogenerated_blabber()} + +#ifndef BITONIC_SORT_AVX2_{t.upper()}_H +#define BITONIC_SORT_AVX2_{t.upper()}_H + +#ifdef __GNUC__ +#ifdef __clang__ +#pragma clang attribute push (__attribute__((target("avx2"))), apply_to = any(function)) +#else +#pragma GCC push_options +#pragma GCC target("avx2") +#endif +#endif + +#include +#include "bitonic_sort.h" + +#define i2d _mm256_castsi256_pd +#define d2i _mm256_castpd_si256 +#define i2s _mm256_castsi256_ps +#define s2i _mm256_castps_si256 +#define s2d _mm256_castps_pd +#define d2s _mm256_castpd_ps + +namespace vxsort {{ +namespace smallsort {{ +template<> struct bitonic<{t}, AVX2> {{ +public: +""" + print(s, file=f) + + def generate_epilogue(self, f): + s = f""" +}}; +}} +}} + +#undef i2d +#undef d2i +#undef i2s +#undef s2i +#undef s2d +#undef d2s + +#ifdef __GNUC__ +#ifdef __clang__ +#pragma clang attribute pop +#else +#pragma GCC pop_options +#endif +#endif +#endif + """ + print(s, file=f) + + def generate_1v_basic_sorters(self, f, ascending): + g = self + type = self.type + maybe_cmp = lambda: ", cmp" if (type == "int64_t" or type == "uint64_t") else "" + maybe_topbit = lambda: f"\n {g.vector_type()} topBit = _mm256_set1_epi64x(1LLU << 63);" if (type == "uint64_t") else "" + suffix = "ascending" if ascending else "descending" + + s = f""" static INLINE void sort_01v_{suffix}({g.generate_param_def_list(1)}) {{ + {g.vector_type()} min, max, s{maybe_cmp()};{maybe_topbit()} + + s = {g.generate_shuffle_X1("d01")}; + {g.crappity_crap_crap("s", "d01")} + min = {g.generate_min("s", "d01")}; + max = {g.generate_max("s", "d01")}; + d01 = {g.generate_blend_B1("min", "max", ascending)}; + + s = {g.generate_shuffle_XR("d01")}; + {g.crappity_crap_crap("s", "d01")} + min = {g.generate_min("s", "d01")}; + max = {g.generate_max("s", "d01")}; + d01 = {g.generate_blend_B2("min", "max", ascending)}; + + s = {g.generate_shuffle_X1("d01")}; + {g.crappity_crap_crap("s", "d01")} + min = {g.generate_min("s", "d01")}; + max = {g.generate_max("s", "d01")}; + d01 = {g.generate_blend_B1("min", "max", ascending)};""" + + print(s, file=f) + + if g.vector_size() == 8: + s = f""" + s = {g.generate_reverse("d01")}; + min = {g.generate_min("s", "d01")}; + max = {g.generate_max("s", "d01")}; + d01 = {g.generate_blend_B4("min", "max", ascending)}; + + s = {g.generate_shuffle_X2("d01")}; + min = {g.generate_min("s", "d01")}; + max = {g.generate_max("s", "d01")}; + d01 = {g.generate_blend_B2("min", "max", ascending)}; + + s = {g.generate_shuffle_X1("d01")}; + min = {g.generate_min("s", "d01")}; + max = {g.generate_max("s", "d01")}; + d01 = {g.generate_blend_B1("min", "max", ascending)};""" + print(s, file=f) + print("}", file=f) + + + + def generate_1v_merge_sorters(self, f, ascending: bool): + g = self + type = self.type + maybe_cmp = lambda: ", cmp" if (type == "int64_t" or type == "uint64_t") else "" + maybe_topbit = lambda: f"\n {g.vector_type()} topBit = _mm256_set1_epi64x(1LLU << 63);" if ( + type == "uint64_t") else "" + + suffix = "ascending" if ascending else "descending" + + s = f""" static INLINE void sort_01v_merge_{suffix}({g.generate_param_def_list(1)}) {{ + {g.vector_type()} min, max, s{maybe_cmp()};{maybe_topbit()}""" + print(s, file=f) + + if g.vector_size() == 8: + s = f""" + s = {g.generate_cross("d01")}; + min = {g.generate_min("s", "d01")}; + max = {g.generate_max("s", "d01")}; + d01 = {g.generate_blend_B4("min", "max", ascending)};""" + print(s, file=f) + + s = f""" + s = {g.generate_shuffle_X2("d01")}; + {g.crappity_crap_crap("s", "d01")} + min = {g.generate_min("s", "d01")}; + max = {g.generate_max("s", "d01")}; + d01 = {g.generate_blend_B2("min", "max", ascending)}; + + s = {g.generate_shuffle_X1("d01")}; + {g.crappity_crap_crap("s", "d01")} + min = {g.generate_min("s", "d01")}; + max = {g.generate_max("s", "d01")}; + d01 = {g.generate_blend_B1("min", "max", ascending)};""" + + print(s, file=f) + print(" }", file=f) + + def generate_compounded_sorter(self, f, width, ascending, inline): + type = self.type + g = self + maybe_cmp = lambda: ", cmp" if (type == "int64_t" or type == "uint64_t") else "" + maybe_topbit = lambda: f"\n {g.vector_type()} topBit = _mm256_set1_epi64x(1LLU << 63);" if ( + type == "uint64_t") else "" + + w1 = int(next_power_of_2(width) / 2) + w2 = int(width - w1) + + suffix = "ascending" if ascending else "descending" + rev_suffix = "descending" if ascending else "ascending" + + inl = "INLINE" if inline else "NOINLINE" + + s = f""" static {inl} void sort_{width:02d}v_{suffix}({g.generate_param_def_list(width)}) {{ + {g.vector_type()} tmp{maybe_cmp()};{maybe_topbit()} + + sort_{w1:02d}v_{suffix}({g.generate_param_list(1, w1)}); + sort_{w2:02d}v_{rev_suffix}({g.generate_param_list(w1 + 1, w2)});""" + + print(s, file=f) + + for r in range(w1 + 1, width + 1): + x = w1 + 1 - (r - w1) + s = f""" + tmp = d{r:02d}; + {g.crappity_crap_crap(f"d{x:02d}", f"d{r:02d}")} + d{r:02d} = {g.generate_max(f"d{x:02d}", f"d{r:02d}")}; + d{x:02d} = {g.generate_min(f"d{x:02d}", "tmp")};""" + + print(s, file=f) + + s = f""" + sort_{w1:02d}v_merge_{suffix}({g.generate_param_list(1, w1)}); + sort_{w2:02d}v_merge_{suffix}({g.generate_param_list(w1 + 1, w2)});""" + print(s, file=f) + print(" }", file=f) + + + def generate_compounded_merger(self, f, width, ascending, inline): + type = self.type + g = self + maybe_cmp = lambda: ", cmp" if (type == "int64_t" or type == "uint64_t") else "" + maybe_topbit = lambda: f"\n {g.vector_type()} topBit = _mm256_set1_epi64x(1LLU << 63);" if ( + type == "uint64_t") else "" + + w1 = int(next_power_of_2(width) / 2) + w2 = int(width - w1) + + suffix = "ascending" if ascending else "descending" + rev_suffix = "descending" if ascending else "ascending" + + inl = "INLINE" if inline else "NOINLINE" + + s = f""" static {inl} void sort_{width:02d}v_merge_{suffix}({g.generate_param_def_list(width)}) {{ + {g.vector_type()} tmp{maybe_cmp()};{maybe_topbit()}""" + print(s, file=f) + + for r in range(w1 + 1, width + 1): + x = r - w1 + s = f""" + tmp = d{x:02d}; + {g.crappity_crap_crap(f"d{r:02d}", f"d{x:02d}")} + d{x:02d} = {g.generate_min(f"d{r:02d}", f"d{x:02d}")}; + {g.crappity_crap_crap(f"d{r:02d}", "tmp")} + d{r:02d} = {g.generate_max(f"d{r:02d}", "tmp")};""" + print(s, file=f) + + s = f""" + sort_{w1:02d}v_merge_{suffix}({g.generate_param_list(1, w1)}); + sort_{w2:02d}v_merge_{suffix}({g.generate_param_list(w1 + 1, w2)});""" + print(s, file=f) + print(" }", file=f) + + + def generate_entry_points(self, f): + type = self.type + g = self + for m in range(1, g.max_bitonic_sort_vectors() + 1): + s = f""" + static NOINLINE void sort_{m:02d}v({type} *ptr) {{""" + print(s, file=f) + + for l in range(0, m): + s = f" {g.vector_type()} d{l + 1:02d} = {g.get_load_intrinsic('ptr', l)};" + print(s, file=f) + + s = f" sort_{m:02d}v_ascending({g.generate_param_list(1, m)});" + print(s, file=f) + + for l in range(0, m): + s = f" {g.get_store_intrinsic('ptr', l, f'd{l + 1:02d}')};" + print(s, file=f) + + print("}", file=f) + + + def generate_master_entry_point(self, f_header, f_src): + basename = os.path.basename(f_header.name) + s = f"""#include "{basename}" + +using namespace vxsort; +""" + print(s, file=f_src) + + t = self.type + g = self + + s = f""" static void sort({t} *ptr, size_t length);""" + print(s, file=f_header) + + s = f"""void vxsort::smallsort::bitonic<{t}, vector_machine::AVX2 >::sort({t} *ptr, size_t length) {{ + const int N = {g.vector_size()}; + + switch(length / N) {{""" + print(s, file=f_src) + + for m in range(1, self.max_bitonic_sort_vectors() + 1): + s = f" case {m}: sort_{m:02d}v(ptr); break;" + print(s, file=f_src) + print(" }", file=f_src) + print("}", file=f_src) + pass diff --git a/src/coreclr/src/gc/vxsort/smallsort/codegen/avx512.py b/src/coreclr/src/gc/vxsort/smallsort/codegen/avx512.py new file mode 100644 index 000000000000..f08fda8a4445 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/smallsort/codegen/avx512.py @@ -0,0 +1,490 @@ +## +## Licensed to the .NET Foundation under one or more agreements. +## The .NET Foundation licenses this file to you under the MIT license. +## + +from datetime import datetime + +from utils import native_size_map, next_power_of_2 +from bitonic_isa import BitonicISA +import os + + +class AVX512BitonicISA(BitonicISA): + def __init__(self, type): + self.vector_size_in_bytes = 64 + + self.type = type + + self.bitonic_size_map = {} + + for t, s in native_size_map.items(): + self.bitonic_size_map[t] = int(self.vector_size_in_bytes / s) + + self.bitonic_type_map = { + "int32_t": "__m512i", + "uint32_t": "__m512i", + "float": "__m512", + "int64_t": "__m512i", + "uint64_t": "__m512i", + "double": "__m512d", + } + + def max_bitonic_sort_vectors(self): + return 16 + + def vector_size(self): + return self.bitonic_size_map[self.type] + + def vector_type(self): + return self.bitonic_type_map[self.type] + + @classmethod + def supported_types(cls): + return native_size_map.keys() + + def i2d(self, v): + t = self.type + if t == "double": + return v + elif t == "float": + raise Exception("Incorrect Type") + return f"i2d({v})" + + def i2s(self, v): + t = self.type + if t == "double": + raise Exception("Incorrect Type") + elif t == "float": + return f"i2s({v})" + return v + + def d2i(self, v): + t = self.type + if t == "double": + return v + elif t == "float": + raise Exception("Incorrect Type") + return f"d2i({v})" + + def s2i(self, v): + t = self.type + if t == "double": + raise Exception("Incorrect Type") + elif t == "float": + return f"s2i({v})" + return v + + def generate_param_list(self, start, numParams): + return str.join(", ", list(map(lambda p: f"d{p:02d}", range(start, start + numParams)))) + + def generate_param_def_list(self, numParams): + t = self.type + return str.join(", ", list(map(lambda p: f"{self.vector_type()}& d{p:02d}", range(1, numParams + 1)))) + + def generate_shuffle_S1(self, v): + t = self.type + size = self.bitonic_size_map[t] + if size == 16: + return self.i2s(f"_mm512_shuffle_epi32({self.s2i(v)}, _MM_PERM_CDAB)") + elif size == 8: + return self.d2i(f"_mm512_permute_pd({self.i2d(v)}, _MM_PERM_BBBB)") + + def generate_shuffle_X4(self, v): + t = self.type + size = self.bitonic_size_map[t] + if size == 16: + return self.i2s(f"_mm512_shuffle_epi32({self.s2i(v)}, _MM_PERM_ABCD)") + elif size == 8: + return self.d2i(f"_mm512_permutex_pd({self.i2d(v)}, _MM_PERM_ABCD)") + + def generate_shuffle_X8(self, v): + t = self.type + size = self.bitonic_size_map[t] + if size == 16: + s1 = f"_mm512_shuffle_epi32({self.s2i(v)}, _MM_PERM_ABCD)" + return self.i2s(f"_mm512_permutex_epi64({s1}, _MM_PERM_BADC)") + elif size == 8: + s1 = f"_mm512_permutex_pd({self.i2d(v)}, _MM_PERM_ABCD)" + return self.d2i(f"_mm512_shuffle_f64x2({s1}, {s1}, _MM_PERM_BADC)") + + def generate_shuffle_S2(self, v): + t = self.type + size = self.bitonic_size_map[t] + if size == 16: + return self.i2s(f"_mm512_shuffle_epi32({self.s2i(v)}, _MM_PERM_BADC)") + elif size == 8: + return self.d2i(f"_mm512_permutex_pd({self.i2d(v)}, _MM_PERM_BADC)") + + def generate_shuffle_X16(self, v): + t = self.type + size = self.bitonic_size_map[t] + if size == 16: + s1 = f"_mm512_shuffle_epi32({self.s2i(v)}, _MM_PERM_ABCD)" + return self.i2s(f"_mm512_shuffle_i64x2({s1}, {s1}, _MM_PERM_ABCD)") + elif size == 8: + return self.d2i(f"_mm512_shuffle_pd({self.i2d(v)}, {self.i2d(v)}, 0xB1)") + + def generate_shuffle_S4(self, v): + t = self.type + size = self.bitonic_size_map[t] + if size == 16: + return self.i2s(f"_mm512_permutex_epi64({self.s2i(v)}, _MM_PERM_BADC)") + elif size == 8: + return self.d2i(f"_mm512_shuffle_f64x2({self.i2d(v)}, {self.i2d(v)}, _MM_PERM_BADC)") + + def generate_shuffle_S8(self, v): + t = self.type + size = self.bitonic_size_map[t] + if size == 16: + return self.i2s(f"_mm512_shuffle_i64x2({self.s2i(v)}, {self.s2i(v)}, _MM_PERM_BADC)") + elif size == 8: + return self.d2i(f"_mm512_shuffle_pd({self.i2d(v)}, {self.i2d(v)}, 0xB1)") + + def generate_min(self, v1, v2): + t = self.type + if t == "int32_t": + return f"_mm512_min_epi32({v1}, {v2})" + elif t == "uint32_t": + return f"_mm512_min_epu32({v1}, {v2})" + elif t == "float": + return f"_mm512_min_ps({v1}, {v2})" + elif t == "int64_t": + return f"_mm512_min_epi64({v1}, {v2})" + elif t == "uint64_t": + return f"_mm512_min_epu64({v1}, {v2})" + elif t == "double": + return f"_mm512_min_pd({v1}, {v2})" + + def generate_max(self, v1, v2): + t = self.type + if t == "int32_t": + return f"_mm512_max_epi32({v1}, {v2})" + elif t == "uint32_t": + return f"_mm512_max_epu32({v1}, {v2})" + elif t == "float": + return f"_mm512_max_ps({v1}, {v2})" + elif t == "int64_t": + return f"_mm512_max_epi64({v1}, {v2})" + elif t == "uint64_t": + return f"_mm512_max_epu64({v1}, {v2})" + elif t == "double": + return f"_mm512_max_pd({v1}, {v2})" + + def generate_mask(self, stride, ascending): + b = 1 << stride + b = b - 1 + if ascending: + b = b << stride + + mask = 0 + size = self.vector_size() + while size > 0: + mask = mask << (stride * 2) | b + size = size - (stride * 2) + return mask + + + def generate_max_with_blend(self, src, v1, v2, stride, ascending): + mask = self.generate_mask(stride, ascending) + t = self.type + if t == "int32_t": + return f"_mm512_mask_max_epi32({src}, 0x{mask:04X}, {v1}, {v2})" + elif t == "uint32_t": + return f"_mm512_mask_max_epu32({src}, 0x{mask:04X}, {v1}, {v2})" + elif t == "float": + return f"_mm512_mask_max_ps({src}, 0x{mask:04X}, {v1}, {v2})" + elif t == "int64_t": + return f"_mm512_mask_max_epi64({src}, 0x{mask:04X}, {v1}, {v2})" + elif t == "uint64_t": + return f"_mm512_mask_max_epu64({src}, 0x{mask:04X}, {v1}, {v2})" + elif t == "double": + return f"_mm512_mask_max_pd({src}, 0x{mask:04X}, {v1}, {v2})" + + + def get_load_intrinsic(self, v, offset): + t = self.type + if t == "double": + return f"_mm512_loadu_pd(({t} const *) ((__m512d const *) {v} + {offset}))" + if t == "float": + return f"_mm512_loadu_ps(({t} const *) ((__m512 const *) {v} + {offset}))" + return f"_mm512_loadu_si512((__m512i const *) {v} + {offset});" + + + def get_store_intrinsic(self, ptr, offset, value): + t = self.type + if t == "double": + return f"_mm512_storeu_pd(({t} *) ((__m512d *) {ptr} + {offset}), {value})" + if t == "float": + return f"_mm512_storeu_ps(({t} *) ((__m512 *) {ptr} + {offset}), {value})" + return f"_mm512_storeu_si512((__m512i *) {ptr} + {offset}, {value})" + + def autogenerated_blabber(self): + return f"""///////////////////////////////////////////////////////////////////////////// +//// +// This file was auto-generated by a tool at {datetime.now().strftime("%F %H:%M:%S")} +// +// It is recommended you DO NOT directly edit this file but instead edit +// the code-generator that generated this source file instead. +/////////////////////////////////////////////////////////////////////////////""" + + def generate_prologue(self, f): + t = self.type + s = f"""{self.autogenerated_blabber()} + +#ifndef BITONIC_SORT_AVX512_{t.upper()}_H +#define BITONIC_SORT_AVX512_{t.upper()}_H + + +#ifdef __GNUC__ +#ifdef __clang__ +#pragma clang attribute push (__attribute__((target("avx512f"))), apply_to = any(function)) +#else +#pragma GCC push_options +#pragma GCC target("avx512f") +#endif +#endif + +#include +#include "bitonic_sort.h" + +#define i2d _mm512_castsi512_pd +#define d2i _mm512_castpd_si512 +#define i2s _mm512_castsi512_ps +#define s2i _mm512_castps_si512 +#define s2d _mm512_castps_pd +#define d2s _mm521_castpd_ps + +namespace vxsort {{ +namespace smallsort {{ +template<> struct bitonic<{t}, AVX512> {{ +public: +""" + print(s, file=f) + + def generate_epilogue(self, f): + s = f""" +}}; +}} +}} + +#undef i2d +#undef d2i +#undef i2s +#undef s2i +#undef s2d +#undef d2s + +#ifdef __GNUC__ +#ifdef __clang__ +#pragma clang attribute pop +#else +#pragma GCC pop_options +#endif +#endif +#endif +""" + print(s, file=f) + + def generate_1v_basic_sorters(self, f, ascending): + g = self + type = self.type + suffix = "ascending" if ascending else "descending" + + s = f""" static INLINE void sort_01v_{suffix}({g.generate_param_def_list(1)}) {{ + {g.vector_type()} min, s; + + s = {g.generate_shuffle_S1("d01")}; + min = {g.generate_min("s", "d01")}; + d01 = {g.generate_max_with_blend("min", "s", "d01", 1, ascending)}; + + s = {g.generate_shuffle_X4("d01")}; + min = {g.generate_min("s", "d01")}; + d01 = {g.generate_max_with_blend("min", "s", "d01", 2, ascending)}; + + s = {g.generate_shuffle_S1("d01")}; + min = {g.generate_min("s", "d01")}; + d01 = {g.generate_max_with_blend("min", "s", "d01", 1, ascending)}; + + s = {g.generate_shuffle_X8("d01")}; + min = {g.generate_min("s", "d01")}; + d01 = {g.generate_max_with_blend("min", "s", "d01", 4, ascending)}; + + s = {g.generate_shuffle_S2("d01")}; + min = {g.generate_min("s", "d01")}; + d01 = {g.generate_max_with_blend("min", "s", "d01", 2, ascending)}; + + s = {g.generate_shuffle_S1("d01")}; + min = {g.generate_min("s", "d01")}; + d01 = {g.generate_max_with_blend("min", "s", "d01", 1, ascending)};""" + + print(s, file=f) + + if g.vector_size() == 16: + s = f""" + s = {g.generate_shuffle_X16("d01")}; + min = {g.generate_min("s", "d01")}; + d01 = {g.generate_max_with_blend("min", "s", "d01", 8, ascending)}; + + s = {g.generate_shuffle_S4("d01")}; + min = {g.generate_min("s", "d01")}; + d01 = {g.generate_max_with_blend("min", "s", "d01", 4, ascending)}; + + s = {g.generate_shuffle_S2("d01")}; + min = {g.generate_min("s", "d01")}; + d01 = {g.generate_max_with_blend("min", "s", "d01", 2, ascending)}; + + s = {g.generate_shuffle_S1("d01")}; + min = {g.generate_min("s", "d01")}; + d01 = {g.generate_max_with_blend("min", "s", "d01", 1, ascending)};""" + print(s, file=f) + print(" }", file=f) + + def generate_1v_merge_sorters(self, f, ascending: bool): + g = self + type = self.type + suffix = "ascending" if ascending else "descending" + + s = f""" static INLINE void sort_01v_merge_{suffix}({g.generate_param_def_list(1)}) {{ + {g.vector_type()} min, s;""" + print(s, file=f) + + if g.vector_size() == 16: + s = f""" + s = {g.generate_shuffle_S8("d01")}; + min = {g.generate_min("s", "d01")}; + d01 = {g.generate_max_with_blend("min", "s", "d01", 8, ascending)};""" + print(s, file=f) + + s = f""" + s = {g.generate_shuffle_S4("d01")}; + min = {g.generate_min("s", "d01")}; + d01 = {g.generate_max_with_blend("min", "s", "d01", 4, ascending)}; + + s = {g.generate_shuffle_S2("d01")}; + min = {g.generate_min("s", "d01")}; + d01 = {g.generate_max_with_blend("min", "s", "d01", 2, ascending)}; + + s = {g.generate_shuffle_S1("d01")}; + min = {g.generate_min("s", "d01")}; + d01 = {g.generate_max_with_blend("min", "s", "d01", 1, ascending)};""" + + print(s, file=f) + print(" }", file=f) + + + def generate_compounded_sorter(self, f, width, ascending, inline): + type = self.type + g = self + + w1 = int(next_power_of_2(width) / 2) + w2 = int(width - w1) + + suffix = "ascending" if ascending else "descending" + rev_suffix = "descending" if ascending else "ascending" + + inl = "INLINE" if inline else "NOINLINE" + + s = f""" static {inl} void sort_{width:02d}v_{suffix}({g.generate_param_def_list(width)}) {{ + {g.vector_type()} tmp; + + sort_{w1:02d}v_{suffix}({g.generate_param_list(1, w1)}); + sort_{w2:02d}v_{rev_suffix}({g.generate_param_list(w1 + 1, w2)});""" + + print(s, file=f) + + for r in range(w1 + 1, width + 1): + x = w1 + 1 - (r - w1) + s = f""" + tmp = d{r:02d}; + d{r:02d} = {g.generate_max(f"d{x:02d}", f"d{r:02d}")}; + d{x:02d} = {g.generate_min(f"d{x:02d}", "tmp")};""" + + print(s, file=f) + + s = f""" + sort_{w1:02d}v_merge_{suffix}({g.generate_param_list(1, w1)}); + sort_{w2:02d}v_merge_{suffix}({g.generate_param_list(w1 + 1, w2)});""" + print(s, file=f) + print(" }", file=f) + + + def generate_compounded_merger(self, f, width, ascending, inline): + type = self.type + g = self + + w1 = int(next_power_of_2(width) / 2) + w2 = int(width - w1) + + suffix = "ascending" if ascending else "descending" + rev_suffix = "descending" if ascending else "ascending" + + inl = "INLINE" if inline else "NOINLINE" + + s = f""" static {inl} void sort_{width:02d}v_merge_{suffix}({g.generate_param_def_list(width)}) {{ + {g.vector_type()} tmp;""" + print(s, file=f) + + for r in range(w1 + 1, width + 1): + x = r - w1 + s = f""" + tmp = d{x:02d}; + d{x:02d} = {g.generate_min(f"d{r:02d}", f"d{x:02d}")}; + d{r:02d} = {g.generate_max(f"d{r:02d}", "tmp")};""" + print(s, file=f) + + s = f""" + sort_{w1:02d}v_merge_{suffix}({g.generate_param_list(1, w1)}); + sort_{w2:02d}v_merge_{suffix}({g.generate_param_list(w1 + 1, w2)});""" + print(s, file=f) + print(" }", file=f) + + + def generate_entry_points(self, f): + type = self.type + g = self + for m in range(1, g.max_bitonic_sort_vectors() + 1): + s = f""" + static NOINLINE void sort_{m:02d}v({type} *ptr) {{""" + print(s, file=f) + + for l in range(0, m): + s = f" {g.vector_type()} d{l + 1:02d} = {g.get_load_intrinsic('ptr', l)};" + print(s, file=f) + + s = f" sort_{m:02d}v_ascending({g.generate_param_list(1, m)});" + print(s, file=f) + + for l in range(0, m): + s = f" {g.get_store_intrinsic('ptr', l, f'd{l + 1:02d}')};" + print(s, file=f) + + print("}", file=f) + + + def generate_master_entry_point(self, f_header, f_src): + basename = os.path.basename(f_header.name) + s = f"""#include "{basename}" + +using namespace vxsort; +""" + print(s, file=f_src) + + t = self.type + g = self + + s = f""" static void sort({t} *ptr, size_t length);""" + print(s, file=f_header) + + s = f"""void vxsort::smallsort::bitonic<{t}, vector_machine::AVX512 >::sort({t} *ptr, size_t length) {{ + const int N = {g.vector_size()}; + + switch(length / N) {{""" + print(s, file=f_src) + + for m in range(1, self.max_bitonic_sort_vectors() + 1): + s = f" case {m}: sort_{m:02d}v(ptr); break;" + print(s, file=f_src) + print(" }", file=f_src) + print("}", file=f_src) + pass diff --git a/src/coreclr/src/gc/vxsort/smallsort/codegen/bitonic_gen.py b/src/coreclr/src/gc/vxsort/smallsort/codegen/bitonic_gen.py new file mode 100644 index 000000000000..4681e4986c3f --- /dev/null +++ b/src/coreclr/src/gc/vxsort/smallsort/codegen/bitonic_gen.py @@ -0,0 +1,119 @@ +## +## Licensed to the .NET Foundation under one or more agreements. +## The .NET Foundation licenses this file to you under the MIT license. +## + +#!/usr/bin/env python3 +# +# This is a tool to generate the bitonic sorter code that is used for small arrays. +# +# usage: bitonic_gen.py [-h] [--vector-isa VECTOR_ISA [VECTOR_ISA ...]] +# [--break-inline BREAK_INLINE] [--output-dir OUTPUT_DIR] +# +# the files in src/coreclr/src/gc/vxsort/smallsort checked in can be generated with: +# python bitonic_gen.py --output-dir c:\temp --vector-isa AVX2 AVX512 +# +import argparse +import os +from enum import Enum + +from avx2 import AVX2BitonicISA +from avx512 import AVX512BitonicISA +from bitonic_isa import BitonicISA + +BitonicISA.register(AVX2BitonicISA) +BitonicISA.register(AVX512BitonicISA) + + +def get_generator_supported_types(vector_isa): + if isinstance(vector_isa, str): + vector_isa = VectorISA[vector_isa] + if vector_isa == VectorISA.AVX2: + return AVX2BitonicISA.supported_types() + elif vector_isa == VectorISA.AVX512: + return AVX512BitonicISA.supported_types() + else: + raise Exception(f"Non-supported vector machine-type: {vector_isa}") + + +def get_generator(vector_isa, type): + if isinstance(vector_isa, str): + vector_isa = VectorISA[vector_isa] + if vector_isa == VectorISA.AVX2: + return AVX2BitonicISA(type) + elif vector_isa == VectorISA.AVX512: + return AVX512BitonicISA(type) + else: + raise Exception(f"Non-supported vector machine-type: {vector_isa}") + + +def generate_per_type(f_header, f_src, type, vector_isa, break_inline): + g = get_generator(vector_isa, type) + g.generate_prologue(f_header) + g.generate_1v_sorters(f_header, ascending=True) + g.generate_1v_sorters(f_header, ascending=False) + for width in range(2, g.max_bitonic_sort_vectors() + 1): + + # Allow breaking the inline chain once in a while (configurable) + if break_inline == 0 or width & break_inline != 0: + inline = True + else: + inline = False + g.generate_compounded_sorter(f_header, width, ascending=True, inline=inline) + g.generate_compounded_sorter(f_header, width, ascending=False, inline=inline) + if width <= g.largest_merge_variant_needed(): + g.generate_compounded_merger(f_header, width, ascending=True, inline=inline) + g.generate_compounded_merger(f_header, width, ascending=False, inline=inline) + + g.generate_entry_points(f_header) + g.generate_master_entry_point(f_header, f_src) + g.generate_epilogue(f_header) + + +class Language(Enum): + csharp = 'csharp' + cpp = 'cpp' + rust = 'rust' + + def __str__(self): + return self.value + + +class VectorISA(Enum): + AVX2 = 'AVX2' + AVX512 = 'AVX512' + SVE = 'SVE' + + def __str__(self): + return self.value + +def generate_all_types(): + parser = argparse.ArgumentParser() + #parser.add_argument("--language", type=Language, choices=list(Language), + # help="select output language: csharp/cpp/rust") + parser.add_argument("--vector-isa", + nargs='+', + default='all', + help='list of vector ISA to generate', + choices=list(VectorISA).append("all")) + parser.add_argument("--break-inline", type=int, default=0, help="break inlining every N levels") + + parser.add_argument("--output-dir", type=str, + help="output directory") + + opts = parser.parse_args() + + if 'all' in opts.vector_isa: + opts.vector_isa = list(VectorISA) + + for isa in opts.vector_isa: + for t in get_generator_supported_types(isa): + filename = f"bitonic_sort.{isa}.{t}.generated" + print(f"Generating {filename}.{{h,.cpp}}") + h_filename = os.path.join(opts.output_dir, filename + ".h") + h_src = os.path.join(opts.output_dir, filename + ".cpp") + with open(h_filename, "w") as f_header, open(h_src, "w") as f_source: + generate_per_type(f_header, f_source, t, isa, opts.break_inline) + +if __name__ == '__main__': + generate_all_types() diff --git a/src/coreclr/src/gc/vxsort/smallsort/codegen/bitonic_isa.py b/src/coreclr/src/gc/vxsort/smallsort/codegen/bitonic_isa.py new file mode 100644 index 000000000000..d48d7871dedf --- /dev/null +++ b/src/coreclr/src/gc/vxsort/smallsort/codegen/bitonic_isa.py @@ -0,0 +1,72 @@ +## +## Licensed to the .NET Foundation under one or more agreements. +## The .NET Foundation licenses this file to you under the MIT license. +## + +from abc import ABC, ABCMeta, abstractmethod + +from utils import next_power_of_2 + + +class BitonicISA(ABC, metaclass=ABCMeta): + + @abstractmethod + def vector_size(self): + pass + + @abstractmethod + def max_bitonic_sort_vectors(self): + pass + + def largest_merge_variant_needed(self): + return next_power_of_2(self.max_bitonic_sort_vectors()) / 2; + + @abstractmethod + def vector_size(self): + pass + + @abstractmethod + def vector_type(self): + pass + + @classmethod + @abstractmethod + def supported_types(cls): + pass + + @abstractmethod + def generate_prologue(self, f): + pass + + @abstractmethod + def generate_epilogue(self, f): + pass + + + @abstractmethod + def generate_1v_basic_sorters(self, f, ascending): + pass + + @abstractmethod + def generate_1v_merge_sorters(self, f, ascending): + pass + + def generate_1v_sorters(self, f, ascending): + self.generate_1v_basic_sorters(f, ascending) + self.generate_1v_merge_sorters(f, ascending) + + @abstractmethod + def generate_compounded_sorter(self, f, width, ascending, inline): + pass + + @abstractmethod + def generate_compounded_merger(self, f, width, ascending, inline): + pass + + @abstractmethod + def generate_entry_points(self, f): + pass + + @abstractmethod + def generate_master_entry_point(self, f): + pass diff --git a/src/coreclr/src/gc/vxsort/smallsort/codegen/utils.py b/src/coreclr/src/gc/vxsort/smallsort/codegen/utils.py new file mode 100644 index 000000000000..e96c4e8ffbb4 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/smallsort/codegen/utils.py @@ -0,0 +1,24 @@ +## +## Licensed to the .NET Foundation under one or more agreements. +## The .NET Foundation licenses this file to you under the MIT license. +## + +native_size_map = { + "int32_t": 4, + "uint32_t": 4, + "float": 4, + "int64_t": 8, + "uint64_t": 8, + "double": 8, +} + + +def next_power_of_2(v): + v = v - 1 + v |= v >> 1 + v |= v >> 2 + v |= v >> 4 + v |= v >> 8 + v |= v >> 16 + v = v + 1 + return int(v) diff --git a/src/coreclr/src/gc/vxsort/vxsort.h b/src/coreclr/src/gc/vxsort/vxsort.h new file mode 100644 index 000000000000..35812d9356f3 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/vxsort.h @@ -0,0 +1,602 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef VXSORT_VXSORT_H +#define VXSORT_VXSORT_H + +#ifdef __GNUC__ +#ifdef __clang__ +#pragma clang attribute push (__attribute__((target("popcnt"))), apply_to = any(function)) +#else +#pragma GCC push_options +#pragma GCC target("popcnt") +#endif +#endif + + +#include +#include + + +#include "defs.h" +//#include "isa_detection.h" +#include "alignment.h" +#include "machine_traits.h" +#include "smallsort/bitonic_sort.h" + +//#include +//#include +//#include + +namespace vxsort { +using vxsort::smallsort::bitonic; + + +template +class vxsort { + static_assert(Unroll >= 1, "Unroll can be in the range 1..12"); + static_assert(Unroll <= 12, "Unroll can be in the range 1..12"); + +private: + using MT = vxsort_machine_traits; + typedef typename MT::TV TV; + typedef alignment_hint AH; + + static const int ELEMENT_ALIGN = sizeof(T) - 1; + static const int N = sizeof(TV) / sizeof(T); + static const int32_t MAX_BITONIC_SORT_VECTORS = 16; + static const int32_t SMALL_SORT_THRESHOLD_ELEMENTS = MAX_BITONIC_SORT_VECTORS * N; + static const int32_t MaxInnerUnroll = (MAX_BITONIC_SORT_VECTORS - 3) / 2; + static const int32_t SafeInnerUnroll = MaxInnerUnroll > Unroll ? Unroll : MaxInnerUnroll; + static const int32_t SLACK_PER_SIDE_IN_VECTORS = Unroll; + static const size_t ALIGN = AH::ALIGN; + static const size_t ALIGN_MASK = ALIGN - 1; + + static const int SLACK_PER_SIDE_IN_ELEMENTS = SLACK_PER_SIDE_IN_VECTORS * N; + // The formula for figuring out how much temporary space we need for partitioning: + // 2 x the number of slack elements on each side for the purpose of partitioning in unrolled manner + + // 2 x amount of maximal bytes needed for alignment (32) + // one more vector's worth of elements since we write with N-way stores from both ends of the temporary area + // and we must make sure we do not accidentally over-write from left -> right or vice-versa right on that edge... + // In other words, while we allocated this much temp memory, the actual amount of elements inside said memory + // is smaller by 8 elements + 1 for each alignment (max alignment is actually N-1, I just round up to N...) + // This long sense just means that we over-allocate N+2 elements... + static const int PARTITION_TMP_SIZE_IN_ELEMENTS = + (2 * SLACK_PER_SIDE_IN_ELEMENTS + N + 4*N); + + static int floor_log2_plus_one(size_t n) { + auto result = 0; + while (n >= 1) { + result++; + n /= 2; + } + return result; + } + static void swap(T* left, T* right) { + auto tmp = *left; + *left = *right; + *right = tmp; + } + static void swap_if_greater(T* left, T* right) { + if (*left <= *right) + return; + swap(left, right); + } + + static void insertion_sort(T* lo, T* hi) { + for (auto i = lo + 1; i <= hi; i++) { + auto j = i; + auto t = *i; + while ((j > lo) && (t < *(j - 1))) { + *j = *(j - 1); + j--; + } + *j = t; + } + } + + static void heap_sort(T* lo, T* hi) { + size_t n = hi - lo + 1; + for (size_t i = n / 2; i >= 1; i--) { + down_heap(i, n, lo); + } + for (size_t i = n; i > 1; i--) { + swap(lo, lo + i - 1); + down_heap(1, i - 1, lo); + } + } + static void down_heap(size_t i, size_t n, T* lo) { + auto d = *(lo + i - 1); + size_t child; + while (i <= n / 2) { + child = 2 * i; + if (child < n && *(lo + child - 1) < (*(lo + child))) { + child++; + } + if (!(d < *(lo + child - 1))) { + break; + } + *(lo + i - 1) = *(lo + child - 1); + i = child; + } + *(lo + i - 1) = d; + } + + void reset(T* start, T* end) { + _depth = 0; + _startPtr = start; + _endPtr = end; + } + + T* _startPtr = nullptr; + T* _endPtr = nullptr; + + T _temp[PARTITION_TMP_SIZE_IN_ELEMENTS]; + int _depth = 0; + + NOINLINE + T* align_left_scalar_uncommon(T* read_left, T pivot, + T*& tmp_left, T*& tmp_right) { + if (((size_t)read_left & ALIGN_MASK) == 0) + return read_left; + + auto next_align = (T*)(((size_t)read_left + ALIGN) & ~ALIGN_MASK); + while (read_left < next_align) { + auto v = *(read_left++); + if (v <= pivot) { + *(tmp_left++) = v; + } else { + *(--tmp_right) = v; + } + } + + return read_left; + } + + NOINLINE + T* align_right_scalar_uncommon(T* readRight, T pivot, + T*& tmpLeft, T*& tmpRight) { + if (((size_t) readRight & ALIGN_MASK) == 0) + return readRight; + + auto nextAlign = (T *) ((size_t) readRight & ~ALIGN_MASK); + while (readRight > nextAlign) { + auto v = *(--readRight); + if (v <= pivot) { + *(tmpLeft++) = v; + } else { + *(--tmpRight) = v; + } + } + + return readRight; + } + + void sort(T* left, T* right, AH realignHint, + int depthLimit) { + auto length = (size_t)(right - left + 1); + + T* mid; + switch (length) { + case 0: + case 1: + return; + case 2: + swap_if_greater(left, right); + return; + case 3: + mid = right - 1; + swap_if_greater(left, mid); + swap_if_greater(left, right); + swap_if_greater(mid, right); + return; + } + + // Go to insertion sort below this threshold + if (length <= SMALL_SORT_THRESHOLD_ELEMENTS) { + + auto nextLength = (length & (N-1)) > 0 ? (length + N) & ~(N-1) : length; + + auto extraSpaceNeeded = nextLength - length; + auto fakeLeft = left - extraSpaceNeeded; + if (fakeLeft >= _startPtr) { + bitonic::sort(fakeLeft, nextLength); + } else { + insertion_sort(left, right); + } + return; + } + + // Detect a whole bunch of bad cases where partitioning + // will not do well: + // 1. Reverse sorted array + // 2. High degree of repeated values (dutch flag problem, one value) + if (depthLimit == 0) { + heap_sort(left, right); + _depth--; + return; + } + depthLimit--; + + // This is going to be a bit weird: + // Pre/Post alignment calculations happen here: we prepare hints to the + // partition function of how much to align and in which direction + // (pre/post). The motivation to do these calculations here and the actual + // alignment inside the partitioning code is that here, we can cache those + // calculations. As we recurse to the left we can reuse the left cached + // calculation, And when we recurse to the right we reuse the right + // calculation, so we can avoid re-calculating the same aligned addresses + // throughout the recursion, at the cost of a minor code complexity + // Since we branch on the magi values REALIGN_LEFT & REALIGN_RIGHT its safe + // to assume the we are not torturing the branch predictor.' + + // We use a long as a "struct" to pass on alignment hints to the + // partitioning By packing 2 32 bit elements into it, as the JIT seem to not + // do this. In reality we need more like 2x 4bits for each side, but I + // don't think there is a real difference' + + if (realignHint.left_align == AH::REALIGN) { + // Alignment flow: + // * Calculate pre-alignment on the left + // * See it would cause us an out-of bounds read + // * Since we'd like to avoid that, we adjust for post-alignment + // * No branches since we do branch->arithmetic + auto preAlignedLeft = reinterpret_cast(reinterpret_cast(left) & ~ALIGN_MASK); + auto cannotPreAlignLeft = (preAlignedLeft - _startPtr) >> 63; + realignHint.left_align = (preAlignedLeft - left) + (N & cannotPreAlignLeft); + assert(realignHint.left_align >= -N && realignHint.left_align <= N); + assert(AH::is_aligned(left + realignHint.left_align)); + } + + if (realignHint.right_align == AH::REALIGN) { + // Same as above, but in addition: + // right is pointing just PAST the last element we intend to partition + // (it's pointing to where we will store the pivot!) So we calculate alignment based on + // right - 1 + auto preAlignedRight = reinterpret_cast(((reinterpret_cast(right) - 1) & ~ALIGN_MASK) + ALIGN); + auto cannotPreAlignRight = (_endPtr - preAlignedRight) >> 63; + realignHint.right_align = (preAlignedRight - right - (N & cannotPreAlignRight)); + assert(realignHint.right_align >= -N && realignHint.right_align <= N); + assert(AH::is_aligned(right + realignHint.right_align)); + } + + // Compute median-of-three, of: + // the first, mid and one before last elements + mid = left + ((right - left) / 2); + swap_if_greater(left, mid); + swap_if_greater(left, right - 1); + swap_if_greater(mid, right - 1); + + // Pivot is mid, place it in the right hand side + swap(mid, right); + + auto sep = (length < PARTITION_TMP_SIZE_IN_ELEMENTS) ? + vectorized_partition(left, right, realignHint) : + vectorized_partition(left, right, realignHint); + + + + _depth++; + sort(left, sep - 2, realignHint.realign_right(), depthLimit); + sort(sep, right, realignHint.realign_left(), depthLimit); + _depth--; + } + + + static INLINE void partition_block(TV& dataVec, + const TV& P, + T*& left, + T*& right) { + if (MT::supports_compress_writes()) { + partition_block_with_compress(dataVec, P, left, right); + } else { + partition_block_without_compress(dataVec, P, left, right); + } + } + + static INLINE void partition_block_without_compress(TV& dataVec, + const TV& P, + T*& left, + T*& right) { + auto mask = MT::get_cmpgt_mask(dataVec, P); + dataVec = MT::partition_vector(dataVec, mask); + MT::store_vec(reinterpret_cast(left), dataVec); + MT::store_vec(reinterpret_cast(right), dataVec); + auto popCount = -_mm_popcnt_u64(mask); + right += popCount; + left += popCount + N; + } + + static INLINE void partition_block_with_compress(TV& dataVec, + const TV& P, + T*& left, + T*& right) { + auto mask = MT::get_cmpgt_mask(dataVec, P); + auto popCount = -_mm_popcnt_u64(mask); + MT::store_compress_vec(reinterpret_cast(left), dataVec, ~mask); + MT::store_compress_vec(reinterpret_cast(right + N + popCount), dataVec, mask); + right += popCount; + left += popCount + N; + } + + template + T* vectorized_partition(T* const left, T* const right, const AH hint) { + assert(right - left >= SMALL_SORT_THRESHOLD_ELEMENTS); + assert((reinterpret_cast(left) & ELEMENT_ALIGN) == 0); + assert((reinterpret_cast(right) & ELEMENT_ALIGN) == 0); + + // Vectorized double-pumped (dual-sided) partitioning: + // We start with picking a pivot using the media-of-3 "method" + // Once we have sensible pivot stored as the last element of the array + // We process the array from both ends. + // + // To get this rolling, we first read 2 Vector256 elements from the left and + // another 2 from the right, and store them in some temporary space in order + // to leave enough "space" inside the vector for storing partitioned values. + // Why 2 from each side? Because we need n+1 from each side where n is the + // number of Vector256 elements we process in each iteration... The + // reasoning behind the +1 is because of the way we decide from *which* side + // to read, we may end up reading up to one more vector from any given side + // and writing it in its entirety to the opposite side (this becomes + // slightly clearer when reading the code below...) Conceptually, the bulk + // of the processing looks like this after clearing out some initial space + // as described above: + + // [.............................................................................] + // ^wl ^rl rr^ wr^ + // Where: + // wl = writeLeft + // rl = readLeft + // rr = readRight + // wr = writeRight + + // In every iteration, we select what side to read from based on how much + // space is left between head read/write pointer on each side... + // We read from where there is a smaller gap, e.g. that side + // that is closer to the unfortunate possibility of its write head + // overwriting its read head... By reading from THAT side, we're ensuring + // this does not happen + + // An additional unfortunate complexity we need to deal with is that the + // right pointer must be decremented by another Vector256.Count elements + // Since the Load/Store primitives obviously accept start addresses + auto pivot = *right; + // We do this here just in case we need to pre-align to the right + // We end up + *right = std::numeric_limits::Max(); + + // Broadcast the selected pivot + const TV P = MT::broadcast(pivot); + + auto readLeft = left; + auto readRight = right; + + auto tmpStartLeft = _temp; + auto tmpLeft = tmpStartLeft; + auto tmpStartRight = _temp + PARTITION_TMP_SIZE_IN_ELEMENTS; + auto tmpRight = tmpStartRight; + + tmpRight -= N; + + // the read heads always advance by 8 elements, or 32 bytes, + // We can spend some extra time here to align the pointers + // so they start at a cache-line boundary + // Once that happens, we can read with Avx.LoadAlignedVector256 + // And also know for sure that our reads will never cross cache-lines + // Otherwise, 50% of our AVX2 Loads will need to read from two cache-lines + align_vectorized(left, right, hint, P, readLeft, readRight, + tmpStartLeft, tmpLeft, tmpStartRight, tmpRight); + + const auto leftAlign = hint.left_align; + const auto rightAlign = hint.right_align; + if (leftAlign > 0) { + tmpRight += N; + readLeft = align_left_scalar_uncommon(readLeft, pivot, tmpLeft, tmpRight); + tmpRight -= N; + } + + if (rightAlign < 0) { + tmpRight += N; + readRight = + align_right_scalar_uncommon(readRight, pivot, tmpLeft, tmpRight); + tmpRight -= N; + } + + assert(((size_t)readLeft & ALIGN_MASK) == 0); + assert(((size_t)readRight & ALIGN_MASK) == 0); + + assert((((size_t)readRight - (size_t)readLeft) % ALIGN) == 0); + assert((readRight - readLeft) >= InnerUnroll * 2); + + // From now on, we are fully aligned + // and all reading is done in full vector units + auto readLeftV = (TV*) readLeft; + auto readRightV = (TV*) readRight; + #ifndef NDEBUG + readLeft = nullptr; + readRight = nullptr; + #endif + + for (auto u = 0; u < InnerUnroll; u++) { + auto dl = MT::load_vec(readLeftV + u); + auto dr = MT::load_vec(readRightV - (u + 1)); + partition_block(dl, P, tmpLeft, tmpRight); + partition_block(dr, P, tmpLeft, tmpRight); + } + + tmpRight += N; + // Adjust for the reading that was made above + readLeftV += InnerUnroll; + readRightV -= InnerUnroll*2; + TV* nextPtr; + + auto writeLeft = left; + auto writeRight = right - N; + + while (readLeftV < readRightV) { + if (writeRight - ((T *) readRightV) < (2 * (InnerUnroll * N) - N)) { + nextPtr = readRightV; + readRightV -= InnerUnroll; + } else { + mess_up_cmov(); + nextPtr = readLeftV; + readLeftV += InnerUnroll; + } + + TV d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12; + + switch (InnerUnroll) { + case 12: d12 = MT::load_vec(nextPtr + InnerUnroll - 12); + case 11: d11 = MT::load_vec(nextPtr + InnerUnroll - 11); + case 10: d10 = MT::load_vec(nextPtr + InnerUnroll - 10); + case 9: d09 = MT::load_vec(nextPtr + InnerUnroll - 9); + case 8: d08 = MT::load_vec(nextPtr + InnerUnroll - 8); + case 7: d07 = MT::load_vec(nextPtr + InnerUnroll - 7); + case 6: d06 = MT::load_vec(nextPtr + InnerUnroll - 6); + case 5: d05 = MT::load_vec(nextPtr + InnerUnroll - 5); + case 4: d04 = MT::load_vec(nextPtr + InnerUnroll - 4); + case 3: d03 = MT::load_vec(nextPtr + InnerUnroll - 3); + case 2: d02 = MT::load_vec(nextPtr + InnerUnroll - 2); + case 1: d01 = MT::load_vec(nextPtr + InnerUnroll - 1); + } + + switch (InnerUnroll) { + case 12: partition_block(d12, P, writeLeft, writeRight); + case 11: partition_block(d11, P, writeLeft, writeRight); + case 10: partition_block(d10, P, writeLeft, writeRight); + case 9: partition_block(d09, P, writeLeft, writeRight); + case 8: partition_block(d08, P, writeLeft, writeRight); + case 7: partition_block(d07, P, writeLeft, writeRight); + case 6: partition_block(d06, P, writeLeft, writeRight); + case 5: partition_block(d05, P, writeLeft, writeRight); + case 4: partition_block(d04, P, writeLeft, writeRight); + case 3: partition_block(d03, P, writeLeft, writeRight); + case 2: partition_block(d02, P, writeLeft, writeRight); + case 1: partition_block(d01, P, writeLeft, writeRight); + } + } + + readRightV += (InnerUnroll - 1); + + while (readLeftV <= readRightV) { + if (writeRight - (T *) readRightV < N) { + nextPtr = readRightV; + readRightV -= 1; + } else { + mess_up_cmov(); + nextPtr = readLeftV; + readLeftV += 1; + } + + auto d = MT::load_vec(nextPtr); + partition_block(d, P, writeLeft, writeRight); + //partition_block_without_compress(d, P, writeLeft, writeRight); + } + + // 3. Copy-back the 4 registers + remainder we partitioned in the beginning + auto leftTmpSize = tmpLeft - tmpStartLeft; + memcpy(writeLeft, tmpStartLeft, leftTmpSize * sizeof(T)); + writeLeft += leftTmpSize; + auto rightTmpSize = tmpStartRight - tmpRight; + memcpy(writeLeft, tmpRight, rightTmpSize * sizeof(T)); + + // Shove to pivot back to the boundary + *right = *writeLeft; + *writeLeft++ = pivot; + + assert(writeLeft > left); + assert(writeLeft <= right); + + return writeLeft; + } + void align_vectorized(const T* left, + const T* right, + const AH& hint, + const TV P, + T*& readLeft, + T*& readRight, + T*& tmpStartLeft, + T*& tmpLeft, + T*& tmpStartRight, + T*& tmpRight) const { + const auto leftAlign = hint.left_align; + const auto rightAlign = hint.right_align; + const auto rai = ~((rightAlign - 1) >> 31); + const auto lai = leftAlign >> 31; + const auto preAlignedLeft = (TV*) (left + leftAlign); + const auto preAlignedRight = (TV*) (right + rightAlign - N); + + // Alignment with vectorization is tricky, so read carefully before changing code: + // 1. We load data, which we might need to align, if the alignment hints + // mean pre-alignment (or overlapping alignment) + // 2. We partition and store in the following order: + // a) right-portion of right vector to the right-side + // b) left-portion of left vector to the right side + // c) at this point one-half of each partitioned vector has been committed + // back to memory. + // d) we advance the right write (tmpRight) pointer by how many elements + // were actually needed to be written to the right hand side + // e) We write the right portion of the left vector to the right side + // now that its write position has been updated + auto RT0 = MT::load_vec(preAlignedRight); + auto LT0 = MT::load_vec(preAlignedLeft); + auto rtMask = MT::get_cmpgt_mask(RT0, P); + auto ltMask = MT::get_cmpgt_mask(LT0, P); + const auto rtPopCountRightPart = max(_mm_popcnt_u32(rtMask), rightAlign); + const auto ltPopCountRightPart = _mm_popcnt_u32(ltMask); + const auto rtPopCountLeftPart = N - rtPopCountRightPart; + const auto ltPopCountLeftPart = N - ltPopCountRightPart; + + if (MT::supports_compress_writes()) { + MT::store_compress_vec((TV *) (tmpRight + N - rtPopCountRightPart), RT0, rtMask); + MT::store_compress_vec((TV *) tmpLeft, LT0, ~ltMask); + + tmpRight -= rtPopCountRightPart & rai; + readRight += (rightAlign - N) & rai; + + MT::store_compress_vec((TV *) (tmpRight + N - ltPopCountRightPart), LT0, ltMask); + tmpRight -= ltPopCountRightPart & lai; + tmpLeft += ltPopCountLeftPart & lai; + tmpStartLeft += -leftAlign & lai; + readLeft += (leftAlign + N) & lai; + + MT::store_compress_vec((TV*) tmpLeft, RT0, ~rtMask); + tmpLeft += rtPopCountLeftPart & rai; + tmpStartRight -= rightAlign & rai; + } + else { + RT0 = MT::partition_vector(RT0, rtMask); + LT0 = MT::partition_vector(LT0, ltMask); + MT::store_vec((TV*) tmpRight, RT0); + MT::store_vec((TV*) tmpLeft, LT0); + + + tmpRight -= rtPopCountRightPart & rai; + readRight += (rightAlign - N) & rai; + + MT::store_vec((TV*) tmpRight, LT0); + tmpRight -= ltPopCountRightPart & lai; + + tmpLeft += ltPopCountLeftPart & lai; + tmpStartLeft += -leftAlign & lai; + readLeft += (leftAlign + N) & lai; + + MT::store_vec((TV*) tmpLeft, RT0); + tmpLeft += rtPopCountLeftPart & rai; + tmpStartRight -= rightAlign & rai; + } + } + + public: + NOINLINE void sort(T* left, T* right) { + reset(left, right); + auto depthLimit = 2 * floor_log2_plus_one(right + 1 - left); + sort(left, right, AH(), depthLimit); + } +}; + +} // namespace gcsort + +#include "vxsort_targets_disable.h" + +#endif diff --git a/src/coreclr/src/gc/vxsort/vxsort_targets_disable.h b/src/coreclr/src/gc/vxsort/vxsort_targets_disable.h new file mode 100644 index 000000000000..1c6efb1b2462 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/vxsort_targets_disable.h @@ -0,0 +1,11 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + + +#ifdef __GNUC__ +#ifdef __clang__ +#pragma clang attribute pop +#else +#pragma GCC pop_options +#endif +#endif diff --git a/src/coreclr/src/gc/vxsort/vxsort_targets_enable_avx2.h b/src/coreclr/src/gc/vxsort/vxsort_targets_enable_avx2.h new file mode 100644 index 000000000000..343d7ae18506 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/vxsort_targets_enable_avx2.h @@ -0,0 +1,11 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifdef __GNUC__ +#ifdef __clang__ +#pragma clang attribute push (__attribute__((target("avx2"))), apply_to = any(function)) +#else +#pragma GCC push_options +#pragma GCC target("avx512f") +#endif +#endif diff --git a/src/coreclr/src/gc/vxsort/vxsort_targets_enable_avx512.h b/src/coreclr/src/gc/vxsort/vxsort_targets_enable_avx512.h new file mode 100644 index 000000000000..c5bfe4998a8f --- /dev/null +++ b/src/coreclr/src/gc/vxsort/vxsort_targets_enable_avx512.h @@ -0,0 +1,11 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifdef __GNUC__ +#ifdef __clang__ +#pragma clang attribute push (__attribute__((target("avx512f"))), apply_to = any(function)) +#else +#pragma GCC push_options +#pragma GCC target("avx512f") +#endif +#endif diff --git a/src/coreclr/src/ilasm/CMakeLists.txt b/src/coreclr/src/ilasm/CMakeLists.txt index ae5419514df5..13e7467e0b1e 100644 --- a/src/coreclr/src/ilasm/CMakeLists.txt +++ b/src/coreclr/src/ilasm/CMakeLists.txt @@ -4,6 +4,7 @@ add_definitions(-DUNICODE) add_definitions(-D_UNICODE) add_definitions(-D_FEATURE_NO_HOST) add_definitions(-D__ILASM__) +add_definitions(-DFEATURE_METADATA_EMIT_PORTABLE_PDB) add_definitions(-DFEATURE_CORECLR) @@ -18,6 +19,7 @@ set(ILASM_SOURCES main.cpp assembler.cpp prebuilt/asmparse.cpp + portable_pdb.cpp ) set(ILASM_HEADERS @@ -32,6 +34,7 @@ set(ILASM_HEADERS method.hpp nvpair.h typar.hpp + portable_pdb.h ) if(CLR_CMAKE_TARGET_WIN32) @@ -72,11 +75,11 @@ set(ILASM_LINK_LIBRARIES utilcodestaticnohost mscorpe ${START_LIBRARY_GROUP} # Start group of libraries that have circular references - mdhotdata_full - mdcompiler_wks - mdruntime_wks - mdruntimerw_wks - mdstaticapi + mdhotdata_ppdb + mdcompiler_ppdb + mdruntime_ppdb + mdruntimerw_ppdb + mdstaticapi_ppdb ${END_LIBRARY_GROUP} # End group of libraries that have circular references ceefgen corguids diff --git a/src/coreclr/src/ilasm/assem.cpp b/src/coreclr/src/ilasm/assem.cpp index cdfd302be2ef..7ded7ca981d9 100644 --- a/src/coreclr/src/ilasm/assem.cpp +++ b/src/coreclr/src/ilasm/assem.cpp @@ -157,6 +157,9 @@ Assembler::Assembler() dummyClass = new Class(NULL); indexKeywords(&indxKeywords); + + m_pdbFormat = CLASSIC; + m_pPortablePdbWriter = NULL; } @@ -218,7 +221,11 @@ Assembler::~Assembler() m_pEmitter->Release(); m_pEmitter = NULL; } - + if (m_pPortablePdbWriter != NULL) + { + delete m_pPortablePdbWriter; + m_pPortablePdbWriter = NULL; + } if (m_pDisp != NULL) { m_pDisp->Release(); @@ -227,7 +234,7 @@ Assembler::~Assembler() } -BOOL Assembler::Init() +BOOL Assembler::Init(BOOL generatePdb, PdbFormat pdbFormat) { if (m_pCeeFileGen != NULL) { if (m_pCeeFile) @@ -246,6 +253,9 @@ BOOL Assembler::Init() if (FAILED(m_pCeeFileGen->GetSectionCreate (m_pCeeFile, ".sdata", sdReadWrite, &m_pGlobalDataSection))) return FALSE; if (FAILED(m_pCeeFileGen->GetSectionCreate (m_pCeeFile, ".tls", sdReadWrite, &m_pTLSSection))) return FALSE; + m_fGeneratePDB = generatePdb; + m_pdbFormat = pdbFormat; + return TRUE; } @@ -468,6 +478,8 @@ BOOL Assembler::AddMethod(Method *pMethod) BOOL Assembler::EmitMethodBody(Method* pMethod, BinStr* pbsOut) { + HRESULT hr = S_OK; + if(pMethod) { BinStr* pbsBody = pMethod->m_pbsBody; @@ -483,7 +495,6 @@ BOOL Assembler::EmitMethodBody(Method* pMethod, BinStr* pbsOut) VarDescr* pVD; BinStr* pbsSig = new BinStr(); unsigned cnt; - HRESULT hr; DWORD cSig; const COR_SIGNATURE* mySig; @@ -514,57 +525,67 @@ BOOL Assembler::EmitMethodBody(Method* pMethod, BinStr* pbsOut) pFH->SetLocalVarSigTok(pMethod->m_LocalsSig); } //-------------------------------------------------------------------------------- - if(m_fGeneratePDB && (m_pSymWriter != NULL)) + if(m_fGeneratePDB) { - m_pSymWriter->OpenMethod(pMethod->m_Tok); - ULONG N = pMethod->m_LinePCList.COUNT(); - if(pMethod->m_fEntryPoint) m_pSymWriter->SetUserEntryPoint(pMethod->m_Tok); - if(N) + if (m_pSymWriter != NULL) { - LinePC *pLPC; - ULONG32 *offsets=new ULONG32[N], *lines = new ULONG32[N], *columns = new ULONG32[N]; - ULONG32 *endlines=new ULONG32[N], *endcolumns=new ULONG32[N]; - if(offsets && lines && columns && endlines && endcolumns) + m_pSymWriter->OpenMethod(pMethod->m_Tok); + ULONG N = pMethod->m_LinePCList.COUNT(); + if(pMethod->m_fEntryPoint) m_pSymWriter->SetUserEntryPoint(pMethod->m_Tok); + if(N) { - DocWriter* pDW; - unsigned j=0; - while((pDW = m_DocWriterList.PEEK(j++))) + LinePC *pLPC; + ULONG32 *offsets=new ULONG32[N], *lines = new ULONG32[N], *columns = new ULONG32[N]; + ULONG32 *endlines=new ULONG32[N], *endcolumns=new ULONG32[N]; + if(offsets && lines && columns && endlines && endcolumns) { - if((m_pSymDocument = pDW->pWriter)) + DocWriter* pDW; + unsigned j=0; + while((pDW = m_DocWriterList.PEEK(j++))) { - int i, n; - for(i=0, n=0; (pLPC = pMethod->m_LinePCList.PEEK(i)); i++) + if((m_pSymDocument = pDW->pWriter)) { - if(pLPC->pWriter == m_pSymDocument) + int i, n; + for(i=0, n=0; (pLPC = pMethod->m_LinePCList.PEEK(i)); i++) { - offsets[n] = pLPC->PC; - lines[n] = pLPC->Line; - columns[n] = pLPC->Column; - endlines[n] = pLPC->LineEnd; - endcolumns[n] = pLPC->ColumnEnd; - n++; + if(pLPC->pWriter == m_pSymDocument) + { + offsets[n] = pLPC->PC; + lines[n] = pLPC->Line; + columns[n] = pLPC->Column; + endlines[n] = pLPC->LineEnd; + endcolumns[n] = pLPC->ColumnEnd; + n++; + } } - } - if(n) m_pSymWriter->DefineSequencePoints(m_pSymDocument,n, - offsets,lines,columns,endlines,endcolumns); - } // end if(pSymDocument) - } // end while(pDW = next doc.writer) - pMethod->m_LinePCList.RESET(true); - } - else report->error("\nOutOfMemory!\n"); - delete [] offsets; - delete [] lines; - delete [] columns; - delete [] endlines; - delete [] endcolumns; - }//enf if(N) - HRESULT hrr; - if(pMethod->m_ulLines[1]) - hrr = m_pSymWriter->SetMethodSourceRange(m_pSymDocument,pMethod->m_ulLines[0], pMethod->m_ulColumns[0], - m_pSymDocument,pMethod->m_ulLines[1], pMethod->m_ulColumns[1]); - EmitScope(&(pMethod->m_MainScope)); // recursively emits all nested scopes - - m_pSymWriter->CloseMethod(); + if(n) m_pSymWriter->DefineSequencePoints(m_pSymDocument,n, + offsets,lines,columns,endlines,endcolumns); + } // end if(pSymDocument) + } // end while(pDW = next doc.writer) + pMethod->m_LinePCList.RESET(true); + } + else report->error("\nOutOfMemory!\n"); + delete [] offsets; + delete [] lines; + delete [] columns; + delete [] endlines; + delete [] endcolumns; + }//enf if(N) + HRESULT hrr; + if(pMethod->m_ulLines[1]) + hrr = m_pSymWriter->SetMethodSourceRange(m_pSymDocument,pMethod->m_ulLines[0], pMethod->m_ulColumns[0], + m_pSymDocument,pMethod->m_ulLines[1], pMethod->m_ulColumns[1]); + EmitScope(&(pMethod->m_MainScope)); // recursively emits all nested scopes + + m_pSymWriter->CloseMethod(); + } + else if (IsPortablePdb()) + { + if (FAILED(m_pPortablePdbWriter->DefineSequencePoints(pMethod))) + return FALSE; + if (FAILED(m_pPortablePdbWriter->DefineLocalScope(pMethod))) + return FALSE; + } } // end if(fIncludeDebugInfo) //----------------------------------------------------- diff --git a/src/coreclr/src/ilasm/assembler.cpp b/src/coreclr/src/ilasm/assembler.cpp index b1c9dd50d81b..9a418e0fd44b 100644 --- a/src/coreclr/src/ilasm/assembler.cpp +++ b/src/coreclr/src/ilasm/assembler.cpp @@ -1418,6 +1418,20 @@ void Assembler::EmitOpcode(Instr* instr) pLPC->ColumnEnd = instr->column_end; pLPC->PC = m_CurPC; pLPC->pWriter = instr->pWriter; + + pLPC->pOwnerDocument = instr->pOwnerDocument; + if (0xfeefee == instr->linenum && + 0xfeefee == instr->linenum_end && + 0 == instr->column && + 0 == instr->column_end) + { + pLPC->IsHidden = TRUE; + } + else + { + pLPC->IsHidden = FALSE; + } + m_pCurMethod->m_LinePCList.PUSH(pLPC); } else report->error("\nOut of memory!\n"); @@ -2375,40 +2389,51 @@ void Assembler::SetSourceFileName(__in __nullterminated char* szName) } if(m_fGeneratePDB) { - DocWriter* pDW; - unsigned i=0; - while((pDW = m_DocWriterList.PEEK(i++)) != NULL) - { - if(!strcmp(szName,pDW->Name)) break; - } - if(pDW) + if (IsPortablePdb()) { - m_pSymDocument = pDW->pWriter; - delete [] szName; + if (FAILED(m_pPortablePdbWriter->DefineDocument(szName, &m_guidLang))) + { + report->error("Failed to define a document: '%s'", szName); + } + delete[] szName; } - else if(m_pSymWriter) + else { - HRESULT hr; - WszMultiByteToWideChar(g_uCodePage,0,szName,-1,wzUniBuf,dwUniBuf); - if(FAILED(hr=m_pSymWriter->DefineDocument(wzUniBuf,&m_guidLang, - &m_guidLangVendor,&m_guidDoc,&m_pSymDocument))) + DocWriter* pDW; + unsigned i = 0; + while ((pDW = m_DocWriterList.PEEK(i++)) != NULL) { - m_pSymDocument = NULL; - report->error("Failed to define a document writer"); + if (!strcmp(szName, pDW->Name)) break; } - if((pDW = new DocWriter()) != NULL) + if (pDW) { - pDW->Name = szName; - pDW->pWriter = m_pSymDocument; - m_DocWriterList.PUSH(pDW); + m_pSymDocument = pDW->pWriter; + delete[] szName; } - else + else if (m_pSymWriter) { - report->error("Out of memory"); - delete [] szName; + HRESULT hr; + WszMultiByteToWideChar(g_uCodePage, 0, szName, -1, wzUniBuf, dwUniBuf); + if (FAILED(hr = m_pSymWriter->DefineDocument(wzUniBuf, &m_guidLang, + &m_guidLangVendor, &m_guidDoc, &m_pSymDocument))) + { + m_pSymDocument = NULL; + report->error("Failed to define a document writer"); + } + if ((pDW = new DocWriter()) != NULL) + { + pDW->Name = szName; + pDW->pWriter = m_pSymDocument; + m_DocWriterList.PUSH(pDW); + } + else + { + report->error("Out of memory"); + delete[] szName; + } } + else delete[] szName; } - else delete [] szName; } else delete [] szName; } @@ -2428,6 +2453,39 @@ void Assembler::SetSourceFileName(BinStr* pbsName) } } +// Portable PDB paraphernalia +void Assembler::SetPdbFileName(__in __nullterminated char* szName) +{ + if (szName) + { + if (*szName) + { + strcpy_s(m_szPdbFileName, MAX_FILENAME_LENGTH * 3 + 1, szName); + WszMultiByteToWideChar(g_uCodePage, 0, szName, -1, m_wzPdbFileName, MAX_FILENAME_LENGTH); + } + } +} +HRESULT Assembler::SavePdbFile() +{ + HRESULT hr = S_OK; + mdMethodDef entryPoint; + + if (m_pdbFormat == PORTABLE) + { + if (FAILED(hr = (m_pPortablePdbWriter == NULL ? E_FAIL : S_OK))) goto exit; + if (FAILED(hr = (m_pPortablePdbWriter->GetEmitter() == NULL ? E_FAIL : S_OK))) goto exit; + if (FAILED(hr = m_pCeeFileGen->GetEntryPoint(m_pCeeFile, &entryPoint))) goto exit; + if (FAILED(hr = m_pPortablePdbWriter->BuildPdbStream(m_pEmitter, entryPoint))) goto exit; + if (FAILED(hr = m_pPortablePdbWriter->GetEmitter()->Save(m_wzPdbFileName, NULL))) goto exit; + } +exit: + return hr; +} +BOOL Assembler::IsPortablePdb() +{ + return (m_pdbFormat == PORTABLE) && (m_pPortablePdbWriter != NULL); +} + void Assembler::RecordTypeConstraints(GenericParamConstraintList* pGPCList, int numTyPars, TyParDescr* tyPars) { if (numTyPars > 0) diff --git a/src/coreclr/src/ilasm/assembler.h b/src/coreclr/src/ilasm/assembler.h index 39bacaf44213..60aa014940d5 100644 --- a/src/coreclr/src/ilasm/assembler.h +++ b/src/coreclr/src/ilasm/assembler.h @@ -16,6 +16,9 @@ #include "asmenum.h" #include "asmtemplates.h" +#include "portable_pdb.h" +#include "portablepdbmdi.h" + // Disable the "initialization of static local vars is no thread safe" error #ifdef _MSC_VER #pragma warning(disable : 4640) @@ -640,6 +643,7 @@ struct Instr unsigned column_end; unsigned pc; ISymUnmanagedDocumentWriter* pWriter; + Document* pOwnerDocument; }; #define INSTR_POOL_SIZE 16 @@ -732,6 +736,12 @@ struct Indx } }; +typedef enum { + CLASSIC, // default - classic PDB format, currently not supported for CoreCLR + PORTABLE, + // EMBEDDED // for future use +} PdbFormat; + class Assembler { public: Assembler(); @@ -769,8 +779,8 @@ class Assembler { mdToken m_tkSysEnum; BOOL m_fDidCoInitialise; - IMetaDataDispenserEx *m_pDisp; - IMetaDataEmit2 *m_pEmitter; + IMetaDataDispenserEx2 *m_pDisp; + IMetaDataEmit3 *m_pEmitter; ICeeFileGen *m_pCeeFileGen; IMetaDataImport2 *m_pImporter; // Import interface. HCEEFILE m_pCeeFile; @@ -842,7 +852,7 @@ class Assembler { void AddToImplList(mdToken); void ClearBoundList(void); //-------------------------------------------------------------------------------- - BOOL Init(); + BOOL Init(BOOL generatePdb, PdbFormat pdbFormat); void ProcessLabel(__in_z __in char *pszName); GlobalLabel *FindGlobalLabel(LPCUTF8 pszName); GlobalFixup *AddDeferredGlobalFixup(__in __nullterminated char *pszLabel, BYTE* reference); @@ -1049,6 +1059,20 @@ class Assembler { GUID m_guidLangVendor; GUID m_guidDoc; + // Portable PDB paraphernalia +public: + PdbFormat m_pdbFormat; + PortablePdbWriter* m_pPortablePdbWriter; + char m_szPdbFileName[MAX_FILENAME_LENGTH * 3 + 1]; + WCHAR m_wzPdbFileName[MAX_FILENAME_LENGTH]; + + // Sets the pdb file name of the assembled file. + void SetPdbFileName(__in __nullterminated char* szName); + // Saves the pdb file. + HRESULT SavePdbFile(); + // Checks whether pdb generation is portable + BOOL IsPortablePdb(); + // Security paraphernalia public: void AddPermissionDecl(CorDeclSecurity action, mdToken type, NVPair *pairs) @@ -1223,7 +1247,7 @@ class Assembler { Clockwork* bClock; void SetClock(Clockwork* val) { bClock = val; }; // ENC paraphernalia - HRESULT InitMetaDataForENC(__in __nullterminated WCHAR* wzOrigFileName); + HRESULT InitMetaDataForENC(__in __nullterminated WCHAR* wzOrigFileName, BOOL generatePdb, PdbFormat pdbFormat); BOOL EmitFieldsMethodsENC(Class* pClass); BOOL EmitEventsPropsENC(Class* pClass); HRESULT CreateDeltaFiles(__in __nullterminated WCHAR *pwzOutputFilename); diff --git a/src/coreclr/src/ilasm/grammar_after.cpp b/src/coreclr/src/ilasm/grammar_after.cpp index 96787774562f..dc4c8497e818 100644 --- a/src/coreclr/src/ilasm/grammar_after.cpp +++ b/src/coreclr/src/ilasm/grammar_after.cpp @@ -284,7 +284,7 @@ Instr* SetupInstr(unsigned short opcode) if((pVal = PASM->GetInstr())) { pVal->opcode = opcode; - if((pVal->pWriter = PASM->m_pSymDocument)!=NULL) + if((pVal->pWriter = PASM->m_pSymDocument)!=NULL || PASM->IsPortablePdb()) { if(PENV->bExternSource) { @@ -299,9 +299,13 @@ Instr* SetupInstr(unsigned short opcode) pVal->linenum = PENV->curLine; pVal->column = 1; pVal->linenum_end = PENV->curLine; - pVal->column_end = 0; + // Portable PDB rule: + // - If Start Line is equal to End Line then End Column is greater than Start Column. + // To fulfill this condition the column_end is set to 2 instead of 0 + pVal->column_end = PASM->IsPortablePdb() ? 2 : 0; pVal->pc = PASM->m_CurPC; } + pVal->pOwnerDocument = PASM->IsPortablePdb() ? PASM->m_pPortablePdbWriter->GetCurrentDocument() : NULL; } } return pVal; diff --git a/src/coreclr/src/ilasm/main.cpp b/src/coreclr/src/ilasm/main.cpp index 3942e8cecc99..9eec9a853277 100644 --- a/src/coreclr/src/ilasm/main.cpp +++ b/src/coreclr/src/ilasm/main.cpp @@ -94,6 +94,7 @@ WCHAR *pwzDeltaFiles[1024]; char szInputFilename[MAX_FILENAME_LENGTH*3]; WCHAR wzInputFilename[MAX_FILENAME_LENGTH]; WCHAR wzOutputFilename[MAX_FILENAME_LENGTH]; +WCHAR wzPdbFilename[MAX_FILENAME_LENGTH]; #ifdef _PREFAST_ @@ -111,7 +112,8 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv) int exitval=1; bool bLogo = TRUE; bool bReportProgress = TRUE; - BOOL bNoDebug = TRUE; + BOOL bGeneratePdb = FALSE; + PdbFormat pdbFormat = CLASSIC; WCHAR* wzIncludePath = NULL; int exitcode = 0; unsigned uCodePage; @@ -132,6 +134,7 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv) g_uConsoleCP = GetConsoleOutputCP(); memset(wzOutputFilename,0,sizeof(wzOutputFilename)); + memset(wzPdbFilename, 0, sizeof(wzPdbFilename)); #ifdef _DEBUG DisableThrowCheck(); @@ -163,6 +166,8 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv) printf("\n/DLL Compile to .dll"); printf("\n/EXE Compile to .exe (default)"); printf("\n/PDB Create the PDB file without enabling debug info tracking"); + printf("\n/PDBFMT=CLASSIC Use classic PDB format for PDB file generation (default)"); + printf("\n/PDBFMT=PORTABLE Use portable PDB format for PDB file generation"); printf("\n/APPCONTAINER Create an AppContainer exe or dll"); printf("\n/DEBUG Disable JIT optimization, create PDB file, use sequence points from PDB"); printf("\n/DEBUG=IMPL Disable JIT optimization, create PDB file, use implicit sequence points"); @@ -245,11 +250,9 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv) } else if (!_stricmp(szOpt, "DEB")) { - pAsm->m_dwIncludeDebugInfo = 0x101; - // PDB is ignored under 'DEB' option for ilasm on CoreCLR. - // https://github.com/dotnet/coreclr/issues/2982 - bNoDebug = FALSE; + bGeneratePdb = TRUE; + pAsm->m_dwIncludeDebugInfo = 0x101; WCHAR *pStr = EqualOrColon(argv[i]); if(pStr != NULL) { @@ -275,9 +278,43 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv) } else if (!_stricmp(szOpt, "PDB")) { - // 'PDB' option is ignored for ilasm on CoreCLR. - // https://github.com/dotnet/coreclr/issues/2982 - bNoDebug = FALSE; + bGeneratePdb = TRUE; + + // check for /PDBFMT= command line option + char szOpt2[3 + 1] = { 0 }; + WszWideCharToMultiByte(uCodePage, 0, &argv[i][4], 3, szOpt2, sizeof(szOpt2), NULL, NULL); + if (!_stricmp(szOpt2, "FMT")) + { + WCHAR* pStr = EqualOrColon(argv[i]); + if (pStr != NULL) + { + for (pStr++; *pStr == L' '; pStr++); //skip the blanks + if (wcslen(pStr) == 0) + { + goto InvalidOption; //if no suboption + } + else + { + WCHAR wzSubOpt[8 + 1]; + wcsncpy_s(wzSubOpt, 8 + 1, pStr, 8); + wzSubOpt[8] = 0; + if (0 == _wcsicmp(wzSubOpt, W("CLASSIC"))) + pdbFormat = CLASSIC; + else if (0 == _wcsicmp(wzSubOpt, W("PORTABLE"))) + pdbFormat = PORTABLE; + else + goto InvalidOption; // bad subooption + } + } + else + { + goto InvalidOption; // bad subooption + } + } + else if (*szOpt2) + { + goto InvalidOption; // bad subooption + } } else if (!_stricmp(szOpt, "CLO")) { @@ -599,7 +636,15 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv) delete pAsm; goto ErrorExit; } - if(!pAsm->Init()) + if (bGeneratePdb && CLASSIC == pdbFormat) + { + // Classic PDB format is not supported on CoreCLR + // https://github.com/dotnet/coreclr/issues/2982 + + printf("WARNING: Classic PDB format is not supported on CoreCLR.\n"); + printf("Use '/PDBFMT=PORTABLE' option in order to generate portable PDB format. \n"); + } + if (!pAsm->Init(bGeneratePdb, pdbFormat)) { fprintf(stderr,"Failed to initialize Assembler\n"); delete pAsm; @@ -624,6 +669,17 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv) while(j); wcscat_s(wzOutputFilename, MAX_FILENAME_LENGTH,(IsDLL ? W(".dll") : (IsOBJ ? W(".obj") : W(".exe")))); } + if (pAsm->m_fGeneratePDB) + { + wcscpy_s(wzPdbFilename, MAX_FILENAME_LENGTH, wzOutputFilename); + WCHAR* extPos = wcsrchr(wzPdbFilename, L'.'); + if (extPos != NULL) + *extPos = 0; + wcscat_s(wzPdbFilename, MAX_FILENAME_LENGTH, W(".pdb")); + char* pszPdbFilename = FullFileName(wzPdbFilename, uCodePage); + pAsm->SetPdbFileName(pszPdbFilename); + delete[] pszPdbFilename; + } if(wzIncludePath == NULL) { PathString wzIncludePathBuffer; @@ -744,6 +800,16 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv) exitval = 1; pParser->msg("Failed to write output file, error code=0x%08X\n",hr); } + // Generate PDB file + if (pAsm->m_fGeneratePDB) + { + if (pAsm->m_fReportProgress) pParser->msg("Writing PDB file: %s\n", pAsm->m_szPdbFileName); + if (FAILED(hr = pAsm->SavePdbFile())) + { + exitval = 1; + pParser->msg("Failed to write PDB file, error code=0x%08X\n", hr); + } + } if(bClock) cw.cEnd = GetTickCount(); #define ENC_ENABLED if(exitval==0) @@ -788,7 +854,7 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv) } else #endif - if (SUCCEEDED(pAsm->InitMetaDataForENC(wzNewOutputFilename))) + if (SUCCEEDED(pAsm->InitMetaDataForENC(wzNewOutputFilename, bGeneratePdb, pdbFormat))) { pAsm->SetSourceFileName(FullFileName(wzInputFilename,uCodePage)); // deletes the argument! @@ -860,7 +926,7 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv) WszSetEnvironmentVariable(W("COMP_ENC_OPENSCOPE"), W("")); WszSetEnvironmentVariable(W("COMP_ENC_EMIT"), W("")); - if(exitval || bNoDebug) + if (exitval || !bGeneratePdb) { // PE file was not created, or no debug info required. Kill PDB if any WCHAR* pc = wcsrchr(wzOutputFilename,L'.'); diff --git a/src/coreclr/src/ilasm/method.hpp b/src/coreclr/src/ilasm/method.hpp index 47786f5d33c0..c52a3a41e810 100644 --- a/src/coreclr/src/ilasm/method.hpp +++ b/src/coreclr/src/ilasm/method.hpp @@ -24,6 +24,8 @@ struct LinePC ULONG ColumnEnd; ULONG PC; ISymUnmanagedDocumentWriter* pWriter; + Document* pOwnerDocument; + BOOL IsHidden; }; typedef FIFO LinePCList; diff --git a/src/coreclr/src/ilasm/portable_pdb.cpp b/src/coreclr/src/ilasm/portable_pdb.cpp new file mode 100644 index 000000000000..f283ad05ec3d --- /dev/null +++ b/src/coreclr/src/ilasm/portable_pdb.cpp @@ -0,0 +1,399 @@ +// 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. + +#include "portable_pdb.h" +#include +#include "assembler.h" + +//***************************************************************************** +// Document +//***************************************************************************** +Document::Document() +{ + m_name = NULL; + m_token = mdDocumentNil; +} + +Document::~Document() +{ + if (m_name) + { + delete[] m_name; + m_name = NULL; + } + m_token = mdDocumentNil; +}; + +char* Document::GetName() +{ + return m_name; +} + +void Document::SetName(char* name) +{ + m_name = new char[strlen(name) + 1]; + strcpy_s(m_name, strlen(name) + 1, name); +} + +mdDocument Document::GetToken() +{ + return m_token; +} + +void Document::SetToken(mdDocument token) +{ + m_token = token; +} + + +//***************************************************************************** +// PortablePdbWriter +//***************************************************************************** +PortablePdbWriter::PortablePdbWriter() +{ + m_pdbStream.id.pdbGuid = { 0 }; + m_pdbStream.id.pdbTimeStamp = 0; + m_pdbStream.entryPoint = mdMethodDefNil; + m_pdbStream.referencedTypeSystemTables = 0UL; + m_pdbStream.typeSystemTableRows = new ULONG[TBL_COUNT]; + m_pdbStream.typeSystemTableRowsSize = 0; + m_currentDocument = NULL; + m_pdbEmitter = NULL; +} + +PortablePdbWriter::~PortablePdbWriter() +{ + if (m_pdbEmitter != NULL) + { + m_pdbEmitter->Release(); + m_pdbEmitter = NULL; + } + if (m_pdbStream.typeSystemTableRows != NULL) + { + delete[] m_pdbStream.typeSystemTableRows; + m_pdbStream.typeSystemTableRows = NULL; + } + + m_documentList.RESET(true); +} + +HRESULT PortablePdbWriter::Init(IMetaDataDispenserEx2* mdDispenser) +{ + HRESULT hr = S_OK; + if (m_pdbEmitter != NULL) + { + m_pdbEmitter->Release(); + m_pdbEmitter = NULL; + } + m_currentDocument = NULL; + m_documentList.RESET(true); + + memset(m_pdbStream.typeSystemTableRows, 0, sizeof(ULONG) * TBL_COUNT); + time_t now; + time(&now); + m_pdbStream.id.pdbTimeStamp = (ULONG)now; + hr = CoCreateGuid(&m_pdbStream.id.pdbGuid); + + if (FAILED(hr)) goto exit; + + hr = mdDispenser->DefinePortablePdbScope( + CLSID_CorMetaDataRuntime, + 0, + IID_IMetaDataEmit3, + (IUnknown**)&m_pdbEmitter); +exit: + return hr; +} + +IMetaDataEmit3* PortablePdbWriter::GetEmitter() +{ + return m_pdbEmitter; +} + +GUID* PortablePdbWriter::GetGuid() +{ + return &m_pdbStream.id.pdbGuid; +} + +ULONG PortablePdbWriter::GetTimestamp() +{ + return m_pdbStream.id.pdbTimeStamp; +} + +Document* PortablePdbWriter::GetCurrentDocument() +{ + return m_currentDocument; +} + +HRESULT PortablePdbWriter::BuildPdbStream(IMetaDataEmit3* peEmitter, mdMethodDef entryPoint) +{ + HRESULT hr = S_OK; + + m_pdbStream.entryPoint = entryPoint; + + if (FAILED(hr = peEmitter->GetReferencedTypeSysTables( + &m_pdbStream.referencedTypeSystemTables, + m_pdbStream.typeSystemTableRows, + TBL_COUNT, + &m_pdbStream.typeSystemTableRowsSize))) goto exit; + + if (FAILED(hr = m_pdbEmitter->DefinePdbStream(&m_pdbStream))) goto exit; + +exit: + return hr; +} + +HRESULT PortablePdbWriter::DefineDocument(char* name, GUID* language) +{ + HRESULT hr = S_OK; + Document* document = NULL; + unsigned i = 0; + + // did we already add a document with this name + while ((document = m_documentList.PEEK(i++)) != NULL) + { + if (!strcmp(name, document->GetName())) + break; + } + + if (document) + { + // found one in the list + // set it as current + m_currentDocument = document; + } + else + { + // define a new document + document = new Document(); + // save the document name, the 'name' parameter will be overriten - tokenized + document->SetName(name); + + // TODO: make use of hash algorithm and hash value + GUID hashAlgorithmUnknown = { 0 }; + BYTE* hashValue = NULL; + ULONG cbHashValue = 0; + mdDocument docToken = mdDocumentNil; + + if (FAILED(hr = m_pdbEmitter->DefineDocument( + name, // will be tokenized + &hashAlgorithmUnknown, + hashValue, + cbHashValue, + language, + &docToken))) + { + delete document; + m_currentDocument = NULL; + hr = E_FAIL; + } + else + { + document->SetToken(docToken); + m_currentDocument = document; + m_documentList.PUSH(document); + } + } + + return hr; +} + +HRESULT PortablePdbWriter::DefineSequencePoints(Method* method) +{ + HRESULT hr = S_OK; + BinStr* blob = new BinStr(); + + // Blob ::= header SequencePointRecord (SequencePointRecord | document-record)* + // SequencePointRecord :: = sequence-point-record | hidden-sequence-point-record + + // header ::= {LocalSignature, InitialDocument} + // LocalSignature + ULONG localSigRid = RidFromToken(method->m_LocalsSig); + CompressUnsignedLong(localSigRid, blob); + // InitialDocument TODO: skip this for now + + // SequencePointRecord + ULONG offset = 0; + ULONG deltaLines = 0; + LONG deltaColumns = 0; + LONG deltaStartLine = 0; + LONG deltaStartColumn = 0; + LinePC* currSeqPoint = NULL; + LinePC* prevSeqPoint = NULL; + LinePC* prevNonHiddenSeqPoint = NULL; + LinePC* nextSeqPoint = NULL; + BOOL isValid = TRUE; + + for (UINT32 i = 0; i < method->m_LinePCList.COUNT(); i++) + { + currSeqPoint = method->m_LinePCList.PEEK(i); + if (i < (method->m_LinePCList.COUNT() - 1)) + nextSeqPoint = method->m_LinePCList.PEEK(i + 1); + else + nextSeqPoint = NULL; + + isValid = VerifySequencePoint(currSeqPoint, nextSeqPoint); + if (!isValid) + { + method->m_pAssembler->report->warn("Sequence point at line: [0x%x] and offset: [0x%x] in method '%s' is not valid!\n", + currSeqPoint->Line, + currSeqPoint->PC, + method->m_szName); + hr = E_FAIL; + break; // TODO: break or ignore? + } + + if (!currSeqPoint->IsHidden) + { + //offset + offset = (i == 0) ? currSeqPoint->PC : currSeqPoint->PC - prevSeqPoint->PC; + CompressUnsignedLong(offset, blob); + + //delta lines + deltaLines = currSeqPoint->LineEnd - currSeqPoint->Line; + CompressUnsignedLong(deltaLines, blob); + + //delta columns + deltaColumns = currSeqPoint->ColumnEnd - currSeqPoint->Column; + if (deltaLines == 0) + CompressUnsignedLong(deltaColumns, blob); + else + CompressSignedLong(deltaColumns, blob); + + //delta start line + if (prevNonHiddenSeqPoint == NULL) + { + deltaStartLine = currSeqPoint->Line; + CompressUnsignedLong(deltaStartLine, blob); + } + else + { + deltaStartLine = currSeqPoint->Line - prevNonHiddenSeqPoint->Line; + CompressSignedLong(deltaStartLine, blob); + } + + //delta start column + if (prevNonHiddenSeqPoint == NULL) + { + deltaStartColumn = currSeqPoint->Column; + CompressUnsignedLong(deltaStartColumn, blob); + } + else + { + deltaStartColumn = currSeqPoint->Column - prevNonHiddenSeqPoint->Column; + CompressSignedLong(deltaStartColumn, blob); + } + + prevNonHiddenSeqPoint = currSeqPoint; + } + else + { + //offset + offset = (i == 0) ? currSeqPoint->PC : currSeqPoint->PC - prevSeqPoint->PC; + CompressUnsignedLong(offset, blob); + + //delta lines + deltaLines = 0; + CompressUnsignedLong(deltaLines, blob); + + //delta lines + deltaColumns = 0; + CompressUnsignedLong(deltaColumns, blob); + } + prevSeqPoint = currSeqPoint; + } + + // finally define sequence points for the method + if (isValid && currSeqPoint != NULL) + { + ULONG documentRid = RidFromToken(currSeqPoint->pOwnerDocument->GetToken()); + hr = m_pdbEmitter->DefineSequencePoints(documentRid, blob->ptr(), blob->length()); + } + + delete blob; + return hr; +} + +HRESULT PortablePdbWriter::DefineLocalScope(Method* method) +{ + if (!_DefineLocalScope(method->m_Tok, &method->m_MainScope)) + return E_FAIL; + else + return S_OK; +} + +BOOL PortablePdbWriter::_DefineLocalScope(mdMethodDef methodDefToken, Scope* currScope) +{ + BOOL fSuccess = FALSE; + ARG_NAME_LIST* pLocalVar = currScope->pLocals; + ULONG methodRid = RidFromToken(methodDefToken); + ULONG importScopeRid = RidFromToken(mdImportScopeNil); // TODO: not supported for now + ULONG firstLocalVarRid = 0; + ULONG firstLocalConstRid = RidFromToken(mdLocalConstantNil); // TODO: not supported for now + ULONG start = 0; + ULONG length = 0; + mdLocalVariable firstLocVarToken = mdLocalScopeNil; + + while (pLocalVar != NULL) + { + mdLocalVariable locVarToken = mdLocalScopeNil; + USHORT attribute = 0; // TODO: not supported for now + USHORT index = pLocalVar->dwAttr & 0xffff; // slot + if (FAILED(m_pdbEmitter->DefineLocalVariable(attribute, index, (char*)pLocalVar->szName, &locVarToken))) goto exit; + + if (firstLocVarToken == mdLocalScopeNil) + firstLocVarToken = locVarToken; + + pLocalVar = pLocalVar->pNext; + } + + if (firstLocVarToken != mdLocalScopeNil) + { + firstLocalVarRid = RidFromToken(firstLocVarToken); + start = currScope->dwStart; + length = currScope->dwEnd - currScope->dwStart; + if (FAILED(m_pdbEmitter->DefineLocalScope(methodRid, importScopeRid, firstLocalVarRid, firstLocalConstRid, start, length))) goto exit; + } + + fSuccess = TRUE; + for (ULONG i = 0; i < currScope->SubScope.COUNT(); i++) + fSuccess &= _DefineLocalScope(methodDefToken, currScope->SubScope.PEEK(i)); + +exit: + return fSuccess; +} + +BOOL PortablePdbWriter::VerifySequencePoint(LinePC* curr, LinePC* next) +{ + if (!curr->IsHidden) + { + if ((curr->PC >= 0 && curr->PC < 0x20000000) && + (next == NULL || (next != NULL && curr->PC < next->PC)) && + (curr->Line >= 0 && curr->Line < 0x20000000 && curr->Line != 0xfeefee) && + (curr->LineEnd >= 0 && curr->LineEnd < 0x20000000 && curr->LineEnd != 0xfeefee) && + (curr->Column >= 0 && curr->Column < 0x10000) && + (curr->ColumnEnd >= 0 && curr->ColumnEnd < 0x10000) && + (curr->LineEnd > curr->Line || (curr->Line == curr->LineEnd && curr->ColumnEnd > curr->Column))) + { + return TRUE; + } + else + { + return FALSE; + } + } + return TRUE; +} + +void PortablePdbWriter::CompressUnsignedLong(ULONG srcData, BinStr* dstBuffer) +{ + ULONG cnt = CorSigCompressData(srcData, dstBuffer->getBuff(sizeof(ULONG) + 1)); + dstBuffer->remove((sizeof(ULONG) + 1) - cnt); +} + +void PortablePdbWriter::CompressSignedLong(LONG srcData, BinStr* dstBuffer) +{ + ULONG cnt = CorSigCompressSignedInt(srcData, dstBuffer->getBuff(sizeof(LONG) + 1)); + dstBuffer->remove((sizeof(LONG) + 1) - cnt); +} diff --git a/src/coreclr/src/ilasm/portable_pdb.h b/src/coreclr/src/ilasm/portable_pdb.h new file mode 100644 index 000000000000..0685842069b4 --- /dev/null +++ b/src/coreclr/src/ilasm/portable_pdb.h @@ -0,0 +1,69 @@ +// 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. + +#ifndef PORTABLE_PDB_H +#define PORTABLE_PDB_H + +#include "ilasmpch.h" +#include "asmtemplates.h" +#include "portablepdbmdds.h" +#include "portablepdbmdi.h" + +//***************************************************************************** +// Document +//***************************************************************************** +class Document +{ +public: + Document(); + ~Document(); + char* GetName(); + void SetName(char* name); + mdDocument GetToken(); + void SetToken(mdDocument token); + +private: + char* m_name; + mdDocument m_token; +}; + +typedef FIFO DocumentList; + +class BinStr; +class Method; +class Scope; +struct LinePC; + +//***************************************************************************** +// PortablePdbWriter +//***************************************************************************** +class PortablePdbWriter +{ +public: + PortablePdbWriter(); + ~PortablePdbWriter(); + HRESULT Init(IMetaDataDispenserEx2* mdDispenser); + IMetaDataEmit3* GetEmitter(); + GUID* GetGuid(); + ULONG GetTimestamp(); + Document* GetCurrentDocument(); + HRESULT BuildPdbStream(IMetaDataEmit3* peEmitter, mdMethodDef entryPoint); + HRESULT DefineDocument(char* name, GUID* language); + HRESULT DefineSequencePoints(Method* method); + HRESULT DefineLocalScope(Method* method); + +private: + BOOL VerifySequencePoint(LinePC* curr, LinePC* next); + void CompressUnsignedLong(ULONG srcData, BinStr* dstBuffer); + void CompressSignedLong(LONG srcData, BinStr* dstBuffer); + BOOL _DefineLocalScope(mdMethodDef methodDefToken, Scope* currScope); + +private: + IMetaDataEmit3* m_pdbEmitter; + PORT_PDB_STREAM m_pdbStream; + DocumentList m_documentList; + Document* m_currentDocument; +}; + +#endif diff --git a/src/coreclr/src/ilasm/writer.cpp b/src/coreclr/src/ilasm/writer.cpp index 64b0054ec3e0..dc3df055470b 100644 --- a/src/coreclr/src/ilasm/writer.cpp +++ b/src/coreclr/src/ilasm/writer.cpp @@ -30,7 +30,7 @@ HRESULT Assembler::InitMetaData() if(bClock) bClock->cMDInitBegin = GetTickCount(); hr = MetaDataGetDispenser(CLSID_CorMetaDataDispenser, - IID_IMetaDataDispenserEx, (void **)&m_pDisp); + IID_IMetaDataDispenserEx2, (void **)&m_pDisp); if (FAILED(hr)) goto exit; @@ -43,7 +43,7 @@ HRESULT Assembler::InitMetaData() hr = m_pDisp->SetOption(MetaDataRuntimeVersion, &encOption); ::SysFreeString(bstr); } - hr = m_pDisp->DefineScope(CLSID_CorMetaDataRuntime, 0, IID_IMetaDataEmit2, + hr = m_pDisp->DefineScope(CLSID_CorMetaDataRuntime, 0, IID_IMetaDataEmit3, (IUnknown **)&m_pEmitter); if (FAILED(hr)) goto exit; @@ -52,6 +52,11 @@ HRESULT Assembler::InitMetaData() if(FAILED(hr = m_pEmitter->QueryInterface(IID_IMetaDataImport2, (void**)&m_pImporter))) goto exit; + if (m_pdbFormat == PdbFormat::PORTABLE) + { + m_pPortablePdbWriter = new PortablePdbWriter(); + if (FAILED(hr = m_pPortablePdbWriter->Init(m_pDisp))) goto exit; + } //m_Parser = new AsmParse(m_pEmitter); m_fInitialisedMetaData = TRUE; @@ -204,7 +209,7 @@ HRESULT Assembler::CreateDebugDirectory() ULONG deOffset; // Only emit this if we're also emitting debug info. - if (!(m_fGeneratePDB && m_pSymWriter)) + if (!(m_fGeneratePDB && (m_pSymWriter || IsPortablePdb()))) return S_OK; IMAGE_DEBUG_DIRECTORY debugDirIDD; @@ -215,38 +220,80 @@ HRESULT Assembler::CreateDebugDirectory() } param; param.debugDirData = NULL; - // Get the debug info from the symbol writer. - if (FAILED(hr=m_pSymWriter->GetDebugInfo(NULL, 0, ¶m.debugDirDataSize, NULL))) - return hr; + if (m_pSymWriter) // CLASSIC + { + // Get the debug info from the symbol writer. + if (FAILED(hr=m_pSymWriter->GetDebugInfo(NULL, 0, ¶m.debugDirDataSize, NULL))) + return hr; - // Will there even be any? - if (param.debugDirDataSize == 0) - return S_OK; + // Will there even be any? + if (param.debugDirDataSize == 0) + return S_OK; - // Make some room for the data. - PAL_TRY(Param *, pParam, ¶m) { - pParam->debugDirData = new BYTE[pParam->debugDirDataSize]; - } PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - hr = E_FAIL; - } PAL_ENDTRY - - if(FAILED(hr)) return hr; - // Actually get the data now. - if (FAILED(hr = m_pSymWriter->GetDebugInfo(&debugDirIDD, - param.debugDirDataSize, - NULL, - param.debugDirData))) - goto ErrExit; + // Make some room for the data. + PAL_TRY(Param *, pParam, ¶m) { + pParam->debugDirData = new BYTE[pParam->debugDirDataSize]; + } PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { + hr = E_FAIL; + } PAL_ENDTRY - // Grab the timestamp of the PE file. - DWORD fileTimeStamp; + if(FAILED(hr)) return hr; + // Actually get the data now. + if (FAILED(hr = m_pSymWriter->GetDebugInfo(&debugDirIDD, + param.debugDirDataSize, + NULL, + param.debugDirData))) + goto ErrExit; - if (FAILED(hr = m_pCeeFileGen->GetFileTimeStamp(m_pCeeFile, - &fileTimeStamp))) - goto ErrExit; + // Grab the timestamp of the PE file. + DWORD fileTimeStamp; - // Fill in the directory entry. - debugDirIDD.TimeDateStamp = VAL32(fileTimeStamp); + if (FAILED(hr = m_pCeeFileGen->GetFileTimeStamp(m_pCeeFile, + &fileTimeStamp))) + goto ErrExit; + + // Fill in the directory entry. + debugDirIDD.TimeDateStamp = VAL32(fileTimeStamp); + } + else if (IsPortablePdb()) // PORTABLE + { + // get module ID + DWORD rsds = 0x53445352; + DWORD pdbAge = 0x1; + DWORD len = sizeof(rsds) + sizeof(GUID) + sizeof(pdbAge) + (DWORD)strlen(m_szPdbFileName) + 1; + BYTE* dbgDirData = new BYTE[len]; + + DWORD offset = 0; + memcpy_s(dbgDirData + offset, len, &rsds, sizeof(rsds)); // RSDS + offset += sizeof(rsds); + memcpy_s(dbgDirData + offset, len, m_pPortablePdbWriter->GetGuid(), sizeof(GUID)); // PDB GUID + offset += sizeof(GUID); + memcpy_s(dbgDirData + offset, len, &pdbAge, sizeof(pdbAge)); // PDB AGE + offset += sizeof(pdbAge); + memcpy_s(dbgDirData + offset, len, m_szPdbFileName, strlen(m_szPdbFileName) + 1); // PDB PATH + + debugDirIDD.Characteristics = 0; + debugDirIDD.TimeDateStamp = m_pPortablePdbWriter->GetTimestamp(); + debugDirIDD.MajorVersion = 0x100; + debugDirIDD.MinorVersion = 0x504d; + debugDirIDD.Type = IMAGE_DEBUG_TYPE_CODEVIEW; + debugDirIDD.SizeOfData = len; + debugDirIDD.AddressOfRawData = 0; // will be updated bellow + debugDirIDD.PointerToRawData = 0; // will be updated bellow + + param.debugDirDataSize = len; + + // Make some room for the data. + PAL_TRY(Param*, pParam, ¶m) { + pParam->debugDirData = new BYTE[pParam->debugDirDataSize]; + } PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { + hr = E_FAIL; + } PAL_ENDTRY + + if (FAILED(hr)) return hr; + + param.debugDirData = dbgDirData; + } // Grab memory in the section for our stuff. // Note that UpdateResource doesn't work correctly if the debug directory is diff --git a/src/coreclr/src/ilasm/writer_enc.cpp b/src/coreclr/src/ilasm/writer_enc.cpp index 1888b563e6f8..96a637b4dec4 100644 --- a/src/coreclr/src/ilasm/writer_enc.cpp +++ b/src/coreclr/src/ilasm/writer_enc.cpp @@ -12,7 +12,7 @@ int ist=0; #define REPT_STEP //printf("Step %d\n",++ist); -HRESULT Assembler::InitMetaDataForENC(__in __nullterminated WCHAR* wzOrigFileName) +HRESULT Assembler::InitMetaDataForENC(__in __nullterminated WCHAR* wzOrigFileName, BOOL generatePdb, PdbFormat pdbFormat) { HRESULT hr = E_FAIL; @@ -33,6 +33,11 @@ HRESULT Assembler::InitMetaDataForENC(__in __nullterminated WCHAR* wzOrigFileNam m_pEmitter->Release(); m_pEmitter = NULL; } + if (m_pPortablePdbWriter != NULL) + { + delete m_pPortablePdbWriter; + m_pPortablePdbWriter = NULL; + } //WszSetEnvironmentVariable(L"COMP_ENC_OPENSCOPE", wzOrigFileName); //hr = m_pDisp->DefineScope(CLSID_CorMetaDataRuntime, 0, IID_IMetaDataEmit2, // (IUnknown **)&m_pEmitter); @@ -63,7 +68,7 @@ HRESULT Assembler::InitMetaDataForENC(__in __nullterminated WCHAR* wzOrigFileNam goto exit; //WszSetEnvironmentVariable(L"COMP_ENC_EMIT", wzOrigFileName); - if(!Init()) goto exit; // close and re-open CeeFileGen and CeeFile + if(!Init(generatePdb, pdbFormat)) goto exit; // close and re-open CeeFileGen and CeeFile hr = S_OK; @@ -445,6 +450,11 @@ REPT_STEP m_pEmitter->Release(); m_pEmitter = NULL; } + if (m_pPortablePdbWriter != NULL) + { + delete m_pPortablePdbWriter; + m_pPortablePdbWriter = NULL; + } return S_OK; diff --git a/src/coreclr/src/inc/cordebug.idl b/src/coreclr/src/inc/cordebug.idl index 857f0dee2ed0..7ab2867d9f28 100644 --- a/src/coreclr/src/inc/cordebug.idl +++ b/src/coreclr/src/inc/cordebug.idl @@ -3313,6 +3313,45 @@ interface ICorDebugProcess10 : IUnknown HRESULT EnableGCNotificationEvents(BOOL fEnable); } +// The memory range described by this structure is a closed-open +// interval, that is only the start is inclusive. +typedef struct _COR_MEMORY_RANGE +{ + CORDB_ADDRESS start; // The start address of the range. + CORDB_ADDRESS end; // The end address of the range. +} COR_MEMORY_RANGE; + +[ + object, + local, + uuid(D1A0BCFC-5865-4437-BE3F-36F022951F8A), + pointer_default(unique) +] +interface ICorDebugMemoryRangeEnum : ICorDebugEnum +{ + /* + * Gets the next "celt" number of objects in the enumeration. + * The actual number of objects retrieved is returned in "pceltFetched". + * Returns S_FALSE if the actual number of objects retrieved is smaller + * than the number of objects requested. + */ + HRESULT Next([in] ULONG celt, + [out, size_is(celt), + length_is(*pceltFetched)] COR_MEMORY_RANGE objects[], + [out] ULONG *pceltFetched); +}; + +[ + object, + local, + uuid(344B37AA-F2C0-4D3B-9909-91CCF787DA8C), + pointer_default(unique) +] +interface ICorDebugProcess11 : IUnknown +{ + HRESULT EnumerateLoaderHeapMemoryRegions([out] ICorDebugMemoryRangeEnum** ppRanges); +} + // Event types MODULE_LOADED and MODULE_UNLOADED implement this interface [ object, diff --git a/src/coreclr/src/inc/corinfoinstructionset.h b/src/coreclr/src/inc/corinfoinstructionset.h index a2d9aaf69c9f..c292403b9e1c 100644 --- a/src/coreclr/src/inc/corinfoinstructionset.h +++ b/src/coreclr/src/inc/corinfoinstructionset.h @@ -20,17 +20,21 @@ enum CORINFO_InstructionSet InstructionSet_AdvSimd=2, InstructionSet_Aes=3, InstructionSet_Crc32=4, - InstructionSet_Sha1=5, - InstructionSet_Sha256=6, - InstructionSet_Atomics=7, - InstructionSet_Vector64=8, - InstructionSet_Vector128=9, - InstructionSet_ArmBase_Arm64=10, - InstructionSet_AdvSimd_Arm64=11, - InstructionSet_Aes_Arm64=12, - InstructionSet_Crc32_Arm64=13, - InstructionSet_Sha1_Arm64=14, - InstructionSet_Sha256_Arm64=15, + InstructionSet_Dp=5, + InstructionSet_Rdm=6, + InstructionSet_Sha1=7, + InstructionSet_Sha256=8, + InstructionSet_Atomics=9, + InstructionSet_Vector64=10, + InstructionSet_Vector128=11, + InstructionSet_ArmBase_Arm64=12, + InstructionSet_AdvSimd_Arm64=13, + InstructionSet_Aes_Arm64=14, + InstructionSet_Crc32_Arm64=15, + InstructionSet_Dp_Arm64=16, + InstructionSet_Rdm_Arm64=17, + InstructionSet_Sha1_Arm64=18, + InstructionSet_Sha256_Arm64=19, #endif // TARGET_ARM64 #ifdef TARGET_AMD64 InstructionSet_X86Base=1, @@ -158,6 +162,10 @@ struct CORINFO_InstructionSetFlags AddInstructionSet(InstructionSet_Aes_Arm64); if (HasInstructionSet(InstructionSet_Crc32)) AddInstructionSet(InstructionSet_Crc32_Arm64); + if (HasInstructionSet(InstructionSet_Dp)) + AddInstructionSet(InstructionSet_Dp_Arm64); + if (HasInstructionSet(InstructionSet_Rdm)) + AddInstructionSet(InstructionSet_Rdm_Arm64); if (HasInstructionSet(InstructionSet_Sha1)) AddInstructionSet(InstructionSet_Sha1_Arm64); if (HasInstructionSet(InstructionSet_Sha256)) @@ -237,6 +245,14 @@ inline CORINFO_InstructionSetFlags EnsureInstructionSetFlagsAreValid(CORINFO_Ins resultflags.RemoveInstructionSet(InstructionSet_Crc32); if (resultflags.HasInstructionSet(InstructionSet_Crc32_Arm64) && !resultflags.HasInstructionSet(InstructionSet_Crc32)) resultflags.RemoveInstructionSet(InstructionSet_Crc32_Arm64); + if (resultflags.HasInstructionSet(InstructionSet_Dp) && !resultflags.HasInstructionSet(InstructionSet_Dp_Arm64)) + resultflags.RemoveInstructionSet(InstructionSet_Dp); + if (resultflags.HasInstructionSet(InstructionSet_Dp_Arm64) && !resultflags.HasInstructionSet(InstructionSet_Dp)) + resultflags.RemoveInstructionSet(InstructionSet_Dp_Arm64); + if (resultflags.HasInstructionSet(InstructionSet_Rdm) && !resultflags.HasInstructionSet(InstructionSet_Rdm_Arm64)) + resultflags.RemoveInstructionSet(InstructionSet_Rdm); + if (resultflags.HasInstructionSet(InstructionSet_Rdm_Arm64) && !resultflags.HasInstructionSet(InstructionSet_Rdm)) + resultflags.RemoveInstructionSet(InstructionSet_Rdm_Arm64); if (resultflags.HasInstructionSet(InstructionSet_Sha1) && !resultflags.HasInstructionSet(InstructionSet_Sha1_Arm64)) resultflags.RemoveInstructionSet(InstructionSet_Sha1); if (resultflags.HasInstructionSet(InstructionSet_Sha1_Arm64) && !resultflags.HasInstructionSet(InstructionSet_Sha1)) @@ -251,6 +267,10 @@ inline CORINFO_InstructionSetFlags EnsureInstructionSetFlagsAreValid(CORINFO_Ins resultflags.RemoveInstructionSet(InstructionSet_Aes); if (resultflags.HasInstructionSet(InstructionSet_Crc32) && !resultflags.HasInstructionSet(InstructionSet_ArmBase)) resultflags.RemoveInstructionSet(InstructionSet_Crc32); + if (resultflags.HasInstructionSet(InstructionSet_Dp) && !resultflags.HasInstructionSet(InstructionSet_AdvSimd)) + resultflags.RemoveInstructionSet(InstructionSet_Dp); + if (resultflags.HasInstructionSet(InstructionSet_Rdm) && !resultflags.HasInstructionSet(InstructionSet_AdvSimd)) + resultflags.RemoveInstructionSet(InstructionSet_Rdm); if (resultflags.HasInstructionSet(InstructionSet_Sha1) && !resultflags.HasInstructionSet(InstructionSet_ArmBase)) resultflags.RemoveInstructionSet(InstructionSet_Sha1); if (resultflags.HasInstructionSet(InstructionSet_Sha256) && !resultflags.HasInstructionSet(InstructionSet_ArmBase)) @@ -415,6 +435,14 @@ inline const char *InstructionSetToString(CORINFO_InstructionSet instructionSet) return "Crc32"; case InstructionSet_Crc32_Arm64 : return "Crc32_Arm64"; + case InstructionSet_Dp : + return "Dp"; + case InstructionSet_Dp_Arm64 : + return "Dp_Arm64"; + case InstructionSet_Rdm : + return "Rdm"; + case InstructionSet_Rdm_Arm64 : + return "Rdm_Arm64"; case InstructionSet_Sha1 : return "Sha1"; case InstructionSet_Sha1_Arm64 : @@ -561,6 +589,8 @@ inline CORINFO_InstructionSet InstructionSetFromR2RInstructionSet(ReadyToRunInst case READYTORUN_INSTRUCTION_AdvSimd: return InstructionSet_AdvSimd; case READYTORUN_INSTRUCTION_Aes: return InstructionSet_Aes; case READYTORUN_INSTRUCTION_Crc32: return InstructionSet_Crc32; + case READYTORUN_INSTRUCTION_Dp: return InstructionSet_Dp; + case READYTORUN_INSTRUCTION_Rdm: return InstructionSet_Rdm; case READYTORUN_INSTRUCTION_Sha1: return InstructionSet_Sha1; case READYTORUN_INSTRUCTION_Sha256: return InstructionSet_Sha256; case READYTORUN_INSTRUCTION_Atomics: return InstructionSet_Atomics; diff --git a/src/coreclr/src/inc/dacprivate.h b/src/coreclr/src/inc/dacprivate.h index 2587609228e7..99419667a963 100644 --- a/src/coreclr/src/inc/dacprivate.h +++ b/src/coreclr/src/inc/dacprivate.h @@ -1028,6 +1028,8 @@ struct MSLAYOUT DacpJitCodeHeapInfo CLRDATA_ADDRESS currentAddr = 0; } HostData; }; + + DacpJitCodeHeapInfo() : codeHeapType(0), LoaderHeap(0) {} }; #include "static_assert.h" diff --git a/src/coreclr/src/inc/mdcommon.h b/src/coreclr/src/inc/mdcommon.h index 4a375770d90c..eeeb32fc7282 100644 --- a/src/coreclr/src/inc/mdcommon.h +++ b/src/coreclr/src/inc/mdcommon.h @@ -38,7 +38,9 @@ enum MAPPINGTYPE #define ENC_MODEL_STREAM_A "#-" #define MINIMAL_MD_STREAM_A "#JTD" #define HOT_MODEL_STREAM_A "#!" - +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB +#define PDB_STREAM_A "#Pdb" +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB #define SCHEMA_STREAM W("#Schema") #define STRING_POOL_STREAM W("#Strings") @@ -49,5 +51,8 @@ enum MAPPINGTYPE #define ENC_MODEL_STREAM W("#-") #define MINIMAL_MD_STREAM W("#JTD") #define HOT_MODEL_STREAM W("#!") +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB +#define PDB_STREAM W("#Pdb") +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB #endif // __MDCommon_h__ diff --git a/src/coreclr/src/inc/metamodelpub.h b/src/coreclr/src/inc/metamodelpub.h index 003902be696f..0f00534a6214 100644 --- a/src/coreclr/src/inc/metamodelpub.h +++ b/src/coreclr/src/inc/metamodelpub.h @@ -1520,6 +1520,133 @@ class GenericParamConstraintRec }; }; +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB +/* Portable PDB tables */ +// -- Dummy records to fill the gap to 0x30 +class DummyRec +{ +public: + enum { + COL_COUNT, + COL_KEY + }; +}; +class Dummy1Rec : public DummyRec {}; +class Dummy2Rec : public DummyRec {}; +class Dummy3Rec : public DummyRec {}; + +class DocumentRec +{ +public: + enum { + COL_Name, + COL_HashAlgorithm, + COL_Hash, + COL_Language, + COL_COUNT, + COL_KEY + }; +}; + +class MethodDebugInformationRec +{ +public: + enum { + COL_Document, + COL_SequencePoints, + COL_COUNT, + COL_KEY + }; +}; + +class LocalScopeRec +{ +METADATA_FIELDS_PROTECTION: + // [IMPORTANT]: Assigning values directly can override other columns, use PutCol instead + ULONG m_StartOffset; + // [IMPORTANT]: Assigning values directly can override other columns, use PutCol instead + ULONG m_Length; +public: + enum { + COL_Method, + COL_ImportScope, + COL_VariableList, + COL_ConstantList, + COL_StartOffset, + COL_Length, + COL_COUNT, + COL_KEY + }; +}; + +class LocalVariableRec +{ +METADATA_FIELDS_PROTECTION: + USHORT m_Attributes; + USHORT m_Index; +public: + enum { + COL_Attributes, + COL_Index, + COL_Name, + COL_COUNT, + COL_KEY + }; + + USHORT GetAttributes() + { + LIMITED_METHOD_CONTRACT; + + return GET_UNALIGNED_VAL16(&m_Attributes); + } + void SetAttributes(USHORT attributes) + { + LIMITED_METHOD_CONTRACT; + + m_Attributes = VAL16(attributes); + } + + USHORT GetIndex() + { + LIMITED_METHOD_CONTRACT; + + return GET_UNALIGNED_VAL16(&m_Index); + } + void SetIndex(USHORT index) + { + LIMITED_METHOD_CONTRACT; + + m_Index = VAL16(index); + } +}; + +class LocalConstantRec +{ +public: + enum { + COL_Name, + COL_Signature, + COL_COUNT, + COL_KEY + }; +}; + +class ImportScopeRec +{ +public: + enum { + COL_Parent, + COL_Imports, + COL_COUNT, + COL_KEY + }; +}; + +// TODO: +// class StateMachineMethodRec +// class CustomDebugInformationRec +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB + #include // List of MiniMd tables. @@ -1569,15 +1696,40 @@ class GenericParamConstraintRec MiniMdTable(NestedClass) \ MiniMdTable(GenericParam) \ MiniMdTable(MethodSpec) \ - MiniMdTable(GenericParamConstraint) \ + MiniMdTable(GenericParamConstraint) + +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB +#define PortablePdbMiniMdTables() \ + /* Dummy tables to fill the gap to 0x30 */ \ + MiniMdTable(Dummy1) /* 0x2D */ \ + MiniMdTable(Dummy2) /* 0x2E */ \ + MiniMdTable(Dummy3) /* 0x2F */ \ + /* Actual portable PDB tables */ \ + MiniMdTable(Document) /* 0x30 */ \ + MiniMdTable(MethodDebugInformation) /* 0x31 */ \ + MiniMdTable(LocalScope) /* 0x32 */ \ + MiniMdTable(LocalVariable) /* 0x33 */ \ + MiniMdTable(LocalConstant) /* 0x34 */ \ + MiniMdTable(ImportScope) /* 0x35 */ \ + // TODO: + // MiniMdTable(StateMachineMethod) /* 0x36 */ + // MiniMdTable(CustomDebugInformation) /* 0x37 */ +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB #undef MiniMdTable #define MiniMdTable(x) TBL_##x, enum { MiniMdTables() +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + PortablePdbMiniMdTables() +#endif TBL_COUNT, // Highest table. TBL_COUNT_V1 = TBL_NestedClass + 1, // Highest table in v1.0 database +#ifndef FEATURE_METADATA_EMIT_PORTABLE_PDB TBL_COUNT_V2 = TBL_GenericParamConstraint + 1 // Highest in v2.0 database +#else + TBL_COUNT_V2 = TBL_ImportScope + 1 // Highest in portable PDB database +#endif }; #undef MiniMdTable diff --git a/src/coreclr/src/inc/readytorun.h b/src/coreclr/src/inc/readytorun.h index f3bc01a878b9..b883f4b558e9 100644 --- a/src/coreclr/src/inc/readytorun.h +++ b/src/coreclr/src/inc/readytorun.h @@ -219,6 +219,7 @@ enum ReadyToRunHelper // Not a real helper - handle to current module passed to delay load helpers. READYTORUN_HELPER_Module = 0x01, READYTORUN_HELPER_GSCookie = 0x02, + READYTORUN_HELPER_IndirectTrapThreads = 0x03, // // Delay load helpers diff --git a/src/coreclr/src/inc/readytoruninstructionset.h b/src/coreclr/src/inc/readytoruninstructionset.h index 85347d873a12..670a66458ff7 100644 --- a/src/coreclr/src/inc/readytoruninstructionset.h +++ b/src/coreclr/src/inc/readytoruninstructionset.h @@ -31,6 +31,8 @@ enum ReadyToRunInstructionSet READYTORUN_INSTRUCTION_Sha256=20, READYTORUN_INSTRUCTION_Atomics=21, READYTORUN_INSTRUCTION_X86Base=22, + READYTORUN_INSTRUCTION_Dp=23, + READYTORUN_INSTRUCTION_Rdm=24, }; diff --git a/src/coreclr/src/jit/block.h b/src/coreclr/src/jit/block.h index dedbdaecb96e..26ccbd80a42a 100644 --- a/src/coreclr/src/jit/block.h +++ b/src/coreclr/src/jit/block.h @@ -445,6 +445,7 @@ struct BasicBlock : private LIR::Range #define BBF_DOMINATED_BY_EXCEPTIONAL_ENTRY 0x800000000 // Block is dominated by exceptional entry. #define BBF_BACKWARD_JUMP_TARGET 0x1000000000 // Block is a target of a backward jump #define BBF_PATCHPOINT 0x2000000000 // Block is a patchpoint +#define BBF_HAS_SUPPRESSGC_CALL 0x4000000000 // BB contains a call to a method with SuppressGCTransitionAttribute // clang-format on diff --git a/src/coreclr/src/jit/codegen.h b/src/coreclr/src/jit/codegen.h index 36f6842295f6..d6e14d7a308c 100644 --- a/src/coreclr/src/jit/codegen.h +++ b/src/coreclr/src/jit/codegen.h @@ -92,7 +92,7 @@ class CodeGen final : public CodeGenInterface inline RegState* regStateForType(var_types t) { - return varTypeIsFloating(t) ? &floatRegState : &intRegState; + return varTypeUsesFloatReg(t) ? &floatRegState : &intRegState; } inline RegState* regStateForReg(regNumber reg) { diff --git a/src/coreclr/src/jit/codegencommon.cpp b/src/coreclr/src/jit/codegencommon.cpp index be4b08e9f436..ccfd7567f46a 100644 --- a/src/coreclr/src/jit/codegencommon.cpp +++ b/src/coreclr/src/jit/codegencommon.cpp @@ -440,7 +440,7 @@ regMaskTP CodeGenInterface::genGetRegMask(const LclVarDsc* varDsc) assert(varDsc->lvIsInReg()); - if (varTypeIsFloating(varDsc->TypeGet())) + if (varTypeUsesFloatReg(varDsc->TypeGet())) { regMask = genRegMaskFloat(varDsc->GetRegNum(), varDsc->TypeGet()); } @@ -11457,13 +11457,13 @@ void CodeGen::genReturn(GenTree* treeNode) genSimpleReturn(treeNode); #else // !TARGET_ARM64 #if defined(TARGET_X86) - if (varTypeIsFloating(treeNode)) + if (varTypeUsesFloatReg(treeNode)) { genFloatReturn(treeNode); } else #elif defined(TARGET_ARM) - if (varTypeIsFloating(treeNode) && (compiler->opts.compUseSoftFP || compiler->info.compIsVarArgs)) + if (varTypeUsesFloatReg(treeNode) && (compiler->opts.compUseSoftFP || compiler->info.compIsVarArgs)) { if (targetType == TYP_FLOAT) { @@ -11479,7 +11479,7 @@ void CodeGen::genReturn(GenTree* treeNode) else #endif // TARGET_ARM { - regNumber retReg = varTypeIsFloating(treeNode) ? REG_FLOATRET : REG_INTRET; + regNumber retReg = varTypeUsesFloatReg(treeNode) ? REG_FLOATRET : REG_INTRET; if (op1->GetRegNum() != retReg) { inst_RV_RV(ins_Move_Extend(targetType, true), retReg, op1->GetRegNum(), targetType); @@ -11613,10 +11613,8 @@ bool CodeGen::isStructReturn(GenTree* treeNode) #if defined(TARGET_AMD64) && !defined(UNIX_AMD64_ABI) assert(!varTypeIsStruct(treeNode)); return false; -#elif defined(TARGET_ARM64) - return varTypeIsStruct(treeNode) && (compiler->info.compRetNativeType == TYP_STRUCT); #else - return varTypeIsStruct(treeNode); + return varTypeIsStruct(treeNode) && (compiler->info.compRetNativeType == TYP_STRUCT); #endif } @@ -11946,8 +11944,8 @@ void CodeGen::genRegCopy(GenTree* treeNode) // an argument, or returned from a call, in an integer register and must be // copied if it's in an xmm register. - bool srcFltReg = (varTypeIsFloating(op1) || varTypeIsSIMD(op1)); - bool tgtFltReg = (varTypeIsFloating(treeNode) || varTypeIsSIMD(treeNode)); + bool srcFltReg = (varTypeUsesFloatReg(op1)); + bool tgtFltReg = (varTypeUsesFloatReg(treeNode)); if (srcFltReg != tgtFltReg) { instruction ins; diff --git a/src/coreclr/src/jit/codegenlinear.cpp b/src/coreclr/src/jit/codegenlinear.cpp index 0de6f0ecf297..94306e936549 100644 --- a/src/coreclr/src/jit/codegenlinear.cpp +++ b/src/coreclr/src/jit/codegenlinear.cpp @@ -57,7 +57,7 @@ void CodeGen::genInitializeRegisterState() continue; } - noway_assert(!varTypeIsFloating(varDsc->TypeGet())); + noway_assert(!varTypeUsesFloatReg(varDsc->TypeGet())); // Mark the register as holding the variable assert(varDsc->GetRegNum() != REG_STK); diff --git a/src/coreclr/src/jit/codegenxarch.cpp b/src/coreclr/src/jit/codegenxarch.cpp index b66c75b51f9c..207cef87d94e 100644 --- a/src/coreclr/src/jit/codegenxarch.cpp +++ b/src/coreclr/src/jit/codegenxarch.cpp @@ -4812,10 +4812,10 @@ void CodeGen::genCodeForSwap(GenTreeOp* tree) var_types type2 = varDsc2->TypeGet(); // We must have both int or both fp regs - assert(!varTypeIsFloating(type1) || varTypeIsFloating(type2)); + assert(!varTypeUsesFloatReg(type1) || varTypeUsesFloatReg(type2)); // FP swap is not yet implemented (and should have NYI'd in LSRA) - assert(!varTypeIsFloating(type1)); + assert(!varTypeUsesFloatReg(type1)); regNumber oldOp1Reg = lcl1->GetRegNum(); regMaskTP oldOp1RegMask = genRegMask(oldOp1Reg); @@ -4999,7 +4999,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call) genConsumeReg(putArgRegNode); // Validate the putArgRegNode has the right type. - assert(varTypeIsFloating(putArgRegNode->TypeGet()) == genIsValidFloatReg(argReg)); + assert(varTypeUsesFloatReg(putArgRegNode->TypeGet()) == genIsValidFloatReg(argReg)); if (putArgRegNode->GetRegNum() != argReg) { inst_RV_RV(ins_Move_Extend(putArgRegNode->TypeGet(), false), argReg, putArgRegNode->GetRegNum()); @@ -5910,12 +5910,14 @@ void CodeGen::genCompareInt(GenTree* treeNode) { assert(treeNode->OperIsCompare() || treeNode->OperIs(GT_CMP)); - GenTreeOp* tree = treeNode->AsOp(); - GenTree* op1 = tree->gtOp1; - GenTree* op2 = tree->gtOp2; - var_types op1Type = op1->TypeGet(); - var_types op2Type = op2->TypeGet(); - regNumber targetReg = tree->GetRegNum(); + GenTreeOp* tree = treeNode->AsOp(); + GenTree* op1 = tree->gtOp1; + GenTree* op2 = tree->gtOp2; + var_types op1Type = op1->TypeGet(); + var_types op2Type = op2->TypeGet(); + regNumber targetReg = tree->GetRegNum(); + emitter* emit = GetEmitter(); + bool canReuseFlags = false; genConsumeOperands(tree); @@ -5947,6 +5949,11 @@ void CodeGen::genCompareInt(GenTree* treeNode) } else if (op1->isUsedFromReg() && op2->IsIntegralConst(0)) { + if (compiler->opts.OptimizationEnabled()) + { + canReuseFlags = true; + } + // We're comparing a register to 0 so we can generate "test reg1, reg1" // instead of the longer "cmp reg1, 0" ins = INS_test; @@ -5997,7 +6004,15 @@ void CodeGen::genCompareInt(GenTree* treeNode) // TYP_UINT and TYP_ULONG should not appear here, only small types can be unsigned assert(!varTypeIsUnsigned(type) || varTypeIsSmall(type)); - GetEmitter()->emitInsBinary(ins, emitTypeSize(type), op1, op2); + bool needsOCFlags = !tree->OperIs(GT_EQ, GT_NE); + if (canReuseFlags && emit->AreFlagsSetToZeroCmp(op1->GetRegNum(), emitTypeSize(type), needsOCFlags)) + { + JITDUMP("Not emitting compare due to flags being already set\n"); + } + else + { + emit->emitInsBinary(ins, emitTypeSize(type), op1, op2); + } // Are we evaluating this into a register? if (targetReg != REG_NA) @@ -7065,9 +7080,9 @@ void CodeGen::genIntrinsic(GenTree* treeNode) // void CodeGen::genBitCast(var_types targetType, regNumber targetReg, var_types srcType, regNumber srcReg) { - const bool srcFltReg = varTypeIsFloating(srcType) || varTypeIsSIMD(srcType); + const bool srcFltReg = varTypeUsesFloatReg(srcType) || varTypeIsSIMD(srcType); assert(srcFltReg == genIsValidFloatReg(srcReg)); - const bool dstFltReg = varTypeIsFloating(targetType) || varTypeIsSIMD(targetType); + const bool dstFltReg = varTypeUsesFloatReg(targetType) || varTypeIsSIMD(targetType); assert(dstFltReg == genIsValidFloatReg(targetReg)); if (srcFltReg != dstFltReg) { @@ -7818,7 +7833,7 @@ void CodeGen::genStoreRegToStackArg(var_types type, regNumber srcReg, int offset else #endif // TARGET_X86 { - assert((varTypeIsFloating(type) && genIsValidFloatReg(srcReg)) || + assert((varTypeUsesFloatReg(type) && genIsValidFloatReg(srcReg)) || (varTypeIsIntegralOrI(type) && genIsValidIntReg(srcReg))); ins = ins_Store(type); } diff --git a/src/coreclr/src/jit/compiler.cpp b/src/coreclr/src/jit/compiler.cpp index a6e4ee76f9b9..c78ee4477e0d 100644 --- a/src/coreclr/src/jit/compiler.cpp +++ b/src/coreclr/src/jit/compiler.cpp @@ -4841,6 +4841,9 @@ void Compiler::compCompile(void** methodCodePtr, ULONG* methodCodeSize, JitFlags compQuirkForPPPflag = compQuirkForPPP(); #endif + // Insert GC Polls + DoPhase(this, PHASE_INSERT_GC_POLLS, &Compiler::fgInsertGCPolls); + // Determine start of cold region if we are hot/cold splitting // DoPhase(this, PHASE_DETERMINE_FIRST_COLD_BLOCK, &Compiler::fgDetermineFirstColdBlock); diff --git a/src/coreclr/src/jit/compiler.h b/src/coreclr/src/jit/compiler.h index 6e5f95482511..c5f571838d4b 100644 --- a/src/coreclr/src/jit/compiler.h +++ b/src/coreclr/src/jit/compiler.h @@ -764,7 +764,7 @@ class LclVarDsc regMaskTP lvRegMask() const { regMaskTP regMask = RBM_NONE; - if (varTypeIsFloating(TypeGet())) + if (varTypeUsesFloatReg(TypeGet())) { if (GetRegNum() != REG_STK) { @@ -900,7 +900,7 @@ class LclVarDsc bool propagate = true); bool IsFloatRegType() const { - return isFloatRegType(lvType) || lvIsHfaRegArg(); + return varTypeUsesFloatReg(lvType) || lvIsHfaRegArg(); } var_types GetHfaType() const @@ -3239,6 +3239,7 @@ class Compiler #endif // TARGET_ARM void lvaAssignFrameOffsets(FrameLayoutState curState); void lvaFixVirtualFrameOffsets(); + void lvaUpdateArgWithInitialReg(LclVarDsc* varDsc); void lvaUpdateArgsWithInitialReg(); void lvaAssignVirtualFrameOffsetsToArgs(); #ifdef UNIX_AMD64_ABI @@ -3468,6 +3469,10 @@ class Compiler bool CanPromoteStructType(CORINFO_CLASS_HANDLE typeHnd); bool TryPromoteStructVar(unsigned lclNum); + void Clear() + { + structPromotionInfo.typeHnd = NO_CLASS_HANDLE; + } #ifdef DEBUG void CheckRetypedAsScalar(CORINFO_FIELD_HANDLE fieldHnd, var_types requestedType); @@ -4989,10 +4994,11 @@ class Compiler void fgInitBlockVarSets(); // true if we've gone through and created GC Poll calls. - bool fgGCPollsCreated; - void fgMarkGCPollBlocks(); - void fgCreateGCPolls(); - bool fgCreateGCPoll(GCPollType pollType, BasicBlock* block, Statement* stmt = nullptr); + bool fgGCPollsCreated; + void fgMarkGCPollBlocks(); + void fgCreateGCPolls(); + PhaseStatus fgInsertGCPolls(); + BasicBlock* fgCreateGCPoll(GCPollType pollType, BasicBlock* block); // Requires that "block" is a block that returns from // a finally. Returns the number of successors (jump targets of @@ -5616,6 +5622,8 @@ class Compiler GenTree* fgMorphToEmulatedFP(GenTree* tree); GenTree* fgMorphConst(GenTree* tree); + GenTreeLclVar* fgMorphTryFoldObjAsLclVar(GenTreeObj* obj); + public: GenTree* fgMorphTree(GenTree* tree, MorphAddrContext* mac = nullptr); @@ -6517,6 +6525,7 @@ class Compiler #define OMF_HAS_GUARDEDDEVIRT 0x00000080 // Method contains guarded devirtualization candidate #define OMF_HAS_EXPRUNTIMELOOKUP 0x00000100 // Method contains a runtime lookup to an expandable dictionary. #define OMF_HAS_PATCHPOINT 0x00000200 // Method contains patchpoints +#define OMF_NEEDS_GCPOLLS 0x00000400 // Method needs GC polls bool doesMethodHaveFatPointer() { @@ -7609,7 +7618,7 @@ class Compiler // If "tree" is a indirection (GT_IND, or GT_OBJ) whose arg is an ADDR, whose arg is a LCL_VAR, return that LCL_VAR // node, else NULL. - static GenTree* fgIsIndirOfAddrOfLocal(GenTree* tree); + static GenTreeLclVar* fgIsIndirOfAddrOfLocal(GenTree* tree); // This map is indexed by GT_OBJ nodes that are address of promoted struct variables, which // have been annotated with the GTF_VAR_DEATH flag. If such a node is *not* mapped in this diff --git a/src/coreclr/src/jit/compphases.h b/src/coreclr/src/jit/compphases.h index 79370e83c6a0..0fe78151c173 100644 --- a/src/coreclr/src/jit/compphases.h +++ b/src/coreclr/src/jit/compphases.h @@ -86,6 +86,7 @@ CompPhaseNameMacro(PHASE_ASSERTION_PROP_MAIN, "Assertion prop", #endif CompPhaseNameMacro(PHASE_OPT_UPDATE_FLOW_GRAPH, "Update flow graph opt pass", "UPD-FG-O", false, -1, false) CompPhaseNameMacro(PHASE_COMPUTE_EDGE_WEIGHTS2, "Compute edge weights (2, false)", "EDG-WGT2", false, -1, false) +CompPhaseNameMacro(PHASE_INSERT_GC_POLLS, "Insert GC Polls", "GC-POLLS", false, -1, true) CompPhaseNameMacro(PHASE_DETERMINE_FIRST_COLD_BLOCK, "Determine first cold block", "COLD-BLK", false, -1, true) CompPhaseNameMacro(PHASE_RATIONALIZE, "Rationalize IR", "RAT", false, -1, false) CompPhaseNameMacro(PHASE_SIMPLE_LOWERING, "Do 'simple' lowering", "SMP-LWR", false, -1, false) diff --git a/src/coreclr/src/jit/emitxarch.cpp b/src/coreclr/src/jit/emitxarch.cpp index 1321067fef64..81f9ce8ef681 100644 --- a/src/coreclr/src/jit/emitxarch.cpp +++ b/src/coreclr/src/jit/emitxarch.cpp @@ -213,6 +213,93 @@ bool emitter::AreUpper32BitsZero(regNumber reg) return false; } +//------------------------------------------------------------------------ +// AreFlagsSetToZeroCmp: Checks if the previous instruction set the SZ, and optionally OC, flags to +// the same values as if there were a compare to 0 +// +// Arguments: +// reg - register of interest +// opSize - size of register +// needsOCFlags - additionally check the overflow and carry flags +// +// Return Value: +// true if the previous instruction set the flags for reg +// false if not, or if we can't safely determine +// +// Notes: +// Currently only looks back one instruction. +bool emitter::AreFlagsSetToZeroCmp(regNumber reg, emitAttr opSize, bool needsOCFlags) +{ + assert(reg != REG_NA); + // Don't look back across IG boundaries (possible control flow) + if (emitCurIGinsCnt == 0 && ((emitCurIG->igFlags & IGF_EXTEND) == 0)) + { + return false; + } + + instrDesc* id = emitLastIns; + insFormat fmt = id->idInsFmt(); + + // make sure op1 is a reg + switch (fmt) + { + case IF_RWR_CNS: + case IF_RRW_CNS: + case IF_RRW_SHF: + case IF_RWR_RRD: + case IF_RRW_RRD: + case IF_RWR_MRD: + case IF_RWR_SRD: + case IF_RRW_SRD: + case IF_RWR_ARD: + case IF_RRW_ARD: + case IF_RWR: + case IF_RRD: + case IF_RRW: + break; + + default: + return false; + } + + if (id->idReg1() != reg) + { + return false; + } + + switch (id->idIns()) + { + case INS_adc: + case INS_add: + case INS_dec: + case INS_dec_l: + case INS_inc: + case INS_inc_l: + case INS_neg: + case INS_shr_1: + case INS_shl_1: + case INS_sar_1: + case INS_sbb: + case INS_sub: + case INS_xadd: + if (needsOCFlags) + { + return false; + } + __fallthrough; + // these always set OC to 0 + case INS_and: + case INS_or: + case INS_xor: + return id->idOpSize() == opSize; + + default: + break; + } + + return false; +} + //------------------------------------------------------------------------ // IsDstSrcImmAvxInstruction: Checks if the instruction has a "reg, reg/mem, imm" or // "reg/mem, reg, imm" form for the legacy, VEX, and EVEX diff --git a/src/coreclr/src/jit/emitxarch.h b/src/coreclr/src/jit/emitxarch.h index fff3fd017ee7..f7c0f5c65af4 100644 --- a/src/coreclr/src/jit/emitxarch.h +++ b/src/coreclr/src/jit/emitxarch.h @@ -96,6 +96,8 @@ bool Is4ByteSSEInstruction(instruction ins); bool AreUpper32BitsZero(regNumber reg); +bool AreFlagsSetToZeroCmp(regNumber reg, emitAttr opSize, bool needsOCFlags); + bool hasRexPrefix(code_t code) { #ifdef TARGET_AMD64 diff --git a/src/coreclr/src/jit/flowgraph.cpp b/src/coreclr/src/jit/flowgraph.cpp index b7582eb2a6f9..e870a8f4c0fe 100644 --- a/src/coreclr/src/jit/flowgraph.cpp +++ b/src/coreclr/src/jit/flowgraph.cpp @@ -3557,10 +3557,177 @@ void Compiler::fgInitBlockVarSets() fgBBVarSetsInited = true; } +//------------------------------------------------------------------------------ +// fgInsertGCPolls : Insert GC polls for basic blocks containing calls to methods +// with SuppressGCTransitionAttribute. +// +// Notes: +// When not optimizing, the method relies on BBF_HAS_SUPPRESSGC_CALL flag to +// find the basic blocks that require GC polls; when optimizing the tree nodes +// are scanned to find calls to methods with SuppressGCTransitionAttribute. +// +// Returns: +// PhaseStatus indicating what, if anything, was changed. +// + +PhaseStatus Compiler::fgInsertGCPolls() +{ + PhaseStatus result = PhaseStatus::MODIFIED_NOTHING; + + if ((optMethodFlags & OMF_NEEDS_GCPOLLS) == 0) + { + return result; + } + + bool createdPollBlocks = false; + +#ifdef DEBUG + if (verbose) + { + printf("*************** In fgInsertGCPolls() for %s\n", info.compFullName); + fgDispBasicBlocks(false); + printf("\n"); + } +#endif // DEBUG + + BasicBlock* block; + + // Walk through the blocks and hunt for a block that has needs a GC Poll + for (block = fgFirstBB; block; block = block->bbNext) + { + bool blockNeedsGCPoll = false; + if (opts.OptimizationDisabled()) + { + if ((block->bbFlags & BBF_HAS_SUPPRESSGC_CALL) != 0) + { + blockNeedsGCPoll = true; + } + } + else + { + // When optimizations are enabled, we can't rely on BBF_HAS_SUPPRESSGC_CALL flag: + // the call could've been moved, e.g., hoisted from a loop, CSE'd, etc. + for (Statement* stmt = block->FirstNonPhiDef(); !blockNeedsGCPoll && (stmt != nullptr); + stmt = stmt->GetNextStmt()) + { + if ((stmt->GetRootNode()->gtFlags & GTF_CALL) != 0) + { + for (GenTree* tree = stmt->GetTreeList(); !blockNeedsGCPoll && (tree != nullptr); + tree = tree->gtNext) + { + if (tree->OperGet() == GT_CALL) + { + GenTreeCall* call = tree->AsCall(); + if (call->IsUnmanaged() && call->IsSuppressGCTransition()) + { + blockNeedsGCPoll = true; + } + } + } + } + } + } + + if (!blockNeedsGCPoll) + { + continue; + } + + result = PhaseStatus::MODIFIED_EVERYTHING; + + // This block needs a GC poll. We either just insert a callout or we split the block and inline part of + // the test. + + // If we're doing GCPOLL_CALL, just insert a GT_CALL node before the last node in the block. + CLANG_FORMAT_COMMENT_ANCHOR; + +#ifdef DEBUG + switch (block->bbJumpKind) + { + case BBJ_RETURN: + case BBJ_ALWAYS: + case BBJ_COND: + case BBJ_SWITCH: + case BBJ_NONE: + case BBJ_THROW: + break; + default: + assert(!"Unexpected block kind"); + } +#endif // DEBUG + + GCPollType pollType = GCPOLL_INLINE; + + // We'd like to inset an inline poll. Below is the list of places where we + // can't or don't want to emit an inline poll. Check all of those. If after all of that we still + // have INLINE, then emit an inline check. + + if (opts.OptimizationDisabled()) + { +#ifdef DEBUG + if (verbose) + { + printf("Selecting CALL poll in block " FMT_BB " because of debug/minopts\n", block->bbNum); + } +#endif // DEBUG + + // Don't split blocks and create inlined polls unless we're optimizing. + pollType = GCPOLL_CALL; + } + else if (genReturnBB == block) + { +#ifdef DEBUG + if (verbose) + { + printf("Selecting CALL poll in block " FMT_BB " because it is the single return block\n", block->bbNum); + } +#endif // DEBUG + + // we don't want to split the single return block + pollType = GCPOLL_CALL; + } + else if (BBJ_SWITCH == block->bbJumpKind) + { +#ifdef DEBUG + if (verbose) + { + printf("Selecting CALL poll in block " FMT_BB " because it is a SWITCH block\n", block->bbNum); + } +#endif // DEBUG + + // We don't want to deal with all the outgoing edges of a switch block. + pollType = GCPOLL_CALL; + } + + BasicBlock* curBasicBlock = fgCreateGCPoll(pollType, block); + createdPollBlocks |= (block != curBasicBlock); + block = curBasicBlock; + } + + // If we split a block to create a GC Poll, then rerun fgReorderBlocks to push the rarely run blocks out + // past the epilog. We should never split blocks unless we're optimizing. + if (createdPollBlocks) + { + noway_assert(opts.OptimizationEnabled()); + fgReorderBlocks(); + fgUpdateChangedFlowGraph(); + } +#ifdef DEBUG + if (verbose) + { + printf("*************** After fgInsertGCPolls()\n"); + fgDispBasicBlocks(true); + } +#endif // DEBUG + + return result; +} + /***************************************************************************** * * The following does the final pass on BBF_NEEDS_GCPOLL and then actually creates the GC Polls. */ + void Compiler::fgCreateGCPolls() { if (GCPOLL_NONE == opts.compGCPollType) @@ -3832,7 +3999,8 @@ void Compiler::fgCreateGCPolls() // TODO-Cleanup: potentially don't split if we're in an EH region. - createdPollBlocks |= fgCreateGCPoll(pollType, block); + BasicBlock* curBasicBlock = fgCreateGCPoll(pollType, block); + createdPollBlocks |= (block != curBasicBlock); } // If we split a block to create a GC Poll, then rerun fgReorderBlocks to push the rarely run blocks out @@ -3852,13 +4020,18 @@ void Compiler::fgCreateGCPolls() #endif // DEBUG } -/***************************************************************************** - * - * Actually create a GCPoll in the given block. Returns true if it created - * a basic block. - */ +//------------------------------------------------------------------------------ +// fgCreateGCPoll : Insert a GC poll of the specified type for the given basic block. +// +// Arguments: +// pollType - The type of GC poll to insert +// block - Basic block to insert the poll for +// +// Return Value: +// If new basic blocks are inserted, the last inserted block; otherwise, the input block. +// -bool Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block, Statement* stmt) +BasicBlock* Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block) { bool createdPollBlocks; @@ -3873,51 +4046,26 @@ bool Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block, Statement* pollType = GCPOLL_CALL; } -#ifdef DEBUG - // If a statment was supplied it should be contained in the block. - if (stmt != nullptr) - { - bool containsStmt = false; - for (Statement* stmtMaybe : block->Statements()) - { - containsStmt = (stmtMaybe == stmt); - if (containsStmt) - { - break; - } - } - - assert(containsStmt); - } -#endif // Create the GC_CALL node GenTree* call = gtNewHelperCallNode(CORINFO_HELP_POLL_GC, TYP_VOID); call = fgMorphCall(call->AsCall()); gtSetEvalOrder(call); + BasicBlock* bottom = nullptr; + if (pollType == GCPOLL_CALL) { createdPollBlocks = false; - if (stmt != nullptr) - { - // The GC_POLL should be inserted relative to the supplied statement. The safer - // location for the insertion is prior to the current statement since the supplied - // statement could be a GT_JTRUE (see fgNewStmtNearEnd() for more details). - Statement* newStmt = gtNewStmt(call); - - // Set the GC_POLL statement to have the same IL offset at the subsequent one. - newStmt->SetILOffsetX(stmt->GetILOffsetX()); - fgInsertStmtBefore(block, stmt, newStmt); - } - else if (block->bbJumpKind == BBJ_ALWAYS) + Statement* newStmt = nullptr; + if (block->bbJumpKind == BBJ_ALWAYS) { // for BBJ_ALWAYS I don't need to insert it before the condition. Just append it. - fgNewStmtAtEnd(block, call); + newStmt = fgNewStmtAtEnd(block, call); } else { - Statement* newStmt = fgNewStmtNearEnd(block, call); + newStmt = fgNewStmtNearEnd(block, call); // For DDB156656, we need to associate the GC Poll with the IL offset (and therefore sequence // point) of the tree before which we inserted the poll. One example of when this is a // problem: @@ -3945,6 +4093,12 @@ bool Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block, Statement* } } + if (fgStmtListThreaded) + { + gtSetStmtInfo(newStmt); + fgSetStmtSeq(newStmt); + } + block->bbFlags |= BBF_GC_SAFE_POINT; #ifdef DEBUG if (verbose) @@ -3974,8 +4128,8 @@ bool Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block, Statement* lpIndexFallThrough = topFallThrough->bbNatLoopNum; } - BasicBlock* poll = fgNewBBafter(BBJ_NONE, top, true); - BasicBlock* bottom = fgNewBBafter(top->bbJumpKind, poll, true); + BasicBlock* poll = fgNewBBafter(BBJ_NONE, top, true); + bottom = fgNewBBafter(top->bbJumpKind, poll, true); BBjumpKinds oldJumpKind = top->bbJumpKind; unsigned char lpIndex = top->bbNatLoopNum; @@ -4010,12 +4164,16 @@ bool Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block, Statement* } // Add the GC_CALL node to Poll. - fgNewStmtAtEnd(poll, call); + Statement* pollStmt = fgNewStmtAtEnd(poll, call); + if (fgStmtListThreaded) + { + gtSetStmtInfo(pollStmt); + fgSetStmtSeq(pollStmt); + } - // Remove the last statement from Top and add it to Bottom. - if (oldJumpKind != BBJ_ALWAYS) + // Remove the last statement from Top and add it to Bottom if necessary. + if ((oldJumpKind == BBJ_COND) || (oldJumpKind == BBJ_RETURN) || (oldJumpKind == BBJ_THROW)) { - // if I'm always jumping to the target, then this is not a condition that needs moving. Statement* stmt = top->firstStmt(); while (stmt->GetNextStmt() != nullptr) { @@ -4063,7 +4221,12 @@ bool Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block, Statement* trapRelop->gtFlags |= GTF_RELOP_JMP_USED | GTF_DONT_CSE; GenTree* trapCheck = gtNewOperNode(GT_JTRUE, TYP_VOID, trapRelop); gtSetEvalOrder(trapCheck); - fgNewStmtAtEnd(top, trapCheck); + Statement* trapCheckStmt = fgNewStmtAtEnd(top, trapCheck); + if (fgStmtListThreaded) + { + gtSetStmtInfo(trapCheckStmt); + fgSetStmtSeq(trapCheckStmt); + } #ifdef DEBUG if (verbose) @@ -4087,10 +4250,10 @@ bool Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block, Statement* switch (oldJumpKind) { case BBJ_NONE: - // nothing to update. This can happen when inserting a GC Poll - // when suppressing a GC transition during an unmanaged call. + fgReplacePred(bottom->bbNext, top, bottom); break; case BBJ_RETURN: + case BBJ_THROW: // no successors break; case BBJ_COND: @@ -4136,7 +4299,7 @@ bool Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block, Statement* #endif // DEBUG } - return createdPollBlocks; + return createdPollBlocks ? bottom : block; } /***************************************************************************** @@ -7136,13 +7299,15 @@ bool Compiler::fgIsCommaThrow(GenTree* tree, bool forFolding /* = false */) // tree - The tree node under consideration // // Return Value: -// If "tree" is a indirection (GT_IND, GT_BLK, or GT_OBJ) whose arg is an ADDR, -// whose arg in turn is a LCL_VAR, return that LCL_VAR node, else nullptr. +// If "tree" is a indirection (GT_IND, GT_BLK, or GT_OBJ) whose arg is: +// - an ADDR, whose arg in turn is a LCL_VAR, return that LCL_VAR node; +// - a LCL_VAR_ADDR, return that LCL_VAR_ADDR; +// - else nullptr. // // static -GenTree* Compiler::fgIsIndirOfAddrOfLocal(GenTree* tree) +GenTreeLclVar* Compiler::fgIsIndirOfAddrOfLocal(GenTree* tree) { - GenTree* res = nullptr; + GenTreeLclVar* res = nullptr; if (tree->OperIsIndir()) { GenTree* addr = tree->AsIndir()->Addr(); @@ -7175,12 +7340,12 @@ GenTree* Compiler::fgIsIndirOfAddrOfLocal(GenTree* tree) GenTree* lclvar = addr->AsOp()->gtOp1; if (lclvar->OperGet() == GT_LCL_VAR) { - res = lclvar; + res = lclvar->AsLclVar(); } } else if (addr->OperGet() == GT_LCL_VAR_ADDR) { - res = addr; + res = addr->AsLclVar(); } } return res; @@ -7295,7 +7460,7 @@ GenTreeCall* Compiler::fgGetStaticsCCtorHelper(CORINFO_CLASS_HANDLE cls, CorInfo NamedIntrinsic ni = lookupNamedIntrinsic(info.compMethodHnd); if (ni == NI_System_Collections_Generic_EqualityComparer_get_Default) { - JITDUMP("\nmarking helper call [06%u] as special dce...\n", result->gtTreeID); + JITDUMP("\nmarking helper call [%06u] as special dce...\n", result->gtTreeID); result->gtCallMoreFlags |= GTF_CALL_M_HELPER_SPECIAL_DCE; } } @@ -15176,6 +15341,12 @@ bool Compiler::fgOptimizeBranch(BasicBlock* bJump) return false; } + if (fgStmtListThreaded) + { + gtSetStmtInfo(stmt); + fgSetStmtSeq(stmt); + } + /* Append the expression to our list */ if (newStmtList != nullptr) @@ -21223,7 +21394,8 @@ void Compiler::fgDebugCheckBBlist(bool checkBBNum /* = false */, bool checkBBRef assert(block->lastNode()->gtNext == nullptr && (block->lastNode()->gtOper == GT_SWITCH || block->lastNode()->gtOper == GT_SWITCH_TABLE)); } - else if (!(block->bbJumpKind == BBJ_ALWAYS || block->bbJumpKind == BBJ_RETURN)) + else if (!(block->bbJumpKind == BBJ_ALWAYS || block->bbJumpKind == BBJ_RETURN || + block->bbJumpKind == BBJ_NONE || block->bbJumpKind == BBJ_THROW)) { // this block cannot have a poll assert(!(block->bbFlags & BBF_NEEDS_GCPOLL)); diff --git a/src/coreclr/src/jit/gentree.cpp b/src/coreclr/src/jit/gentree.cpp index 98bea0eabc9c..8ca9a49a2ce7 100644 --- a/src/coreclr/src/jit/gentree.cpp +++ b/src/coreclr/src/jit/gentree.cpp @@ -2782,7 +2782,7 @@ bool Compiler::gtIsLikelyRegVar(GenTree* tree) } #ifdef TARGET_X86 - if (varTypeIsFloating(tree->TypeGet())) + if (varTypeUsesFloatReg(tree->TypeGet())) return false; if (varTypeIsLong(tree->TypeGet())) return false; @@ -11089,7 +11089,7 @@ void Compiler::gtDispLeaf(GenTree* tree, IndentStack* indentStack) break; case GT_PHYSREG: - printf(" %s", getRegName(tree->AsPhysReg()->gtSrcReg, varTypeIsFloating(tree))); + printf(" %s", getRegName(tree->AsPhysReg()->gtSrcReg, varTypeUsesFloatReg(tree))); break; case GT_IL_OFFSET: @@ -15348,7 +15348,7 @@ GenTree* Compiler::gtNewTempAssign( // see "Zero init inlinee locals:" in fgInlinePrependStatements // thus we may need to set compFloatingPointUsed to true here. // - if (varTypeIsFloating(dstTyp) && (compFloatingPointUsed == false)) + if (varTypeUsesFloatReg(dstTyp) && (compFloatingPointUsed == false)) { compFloatingPointUsed = true; } @@ -19165,7 +19165,7 @@ regNumber ReturnTypeDesc::GetABIReturnReg(unsigned idx) const } else { - noway_assert(varTypeIsFloating(regType0)); + noway_assert(varTypeUsesFloatReg(regType0)); resultReg = REG_FLOATRET; } } @@ -19186,9 +19186,9 @@ regNumber ReturnTypeDesc::GetABIReturnReg(unsigned idx) const } else { - noway_assert(varTypeIsFloating(regType1)); + noway_assert(varTypeUsesFloatReg(regType1)); - if (varTypeIsFloating(regType0)) + if (varTypeUsesFloatReg(regType0)) { resultReg = REG_FLOATRET_1; } diff --git a/src/coreclr/src/jit/gentree.h b/src/coreclr/src/jit/gentree.h index 4f61fa7ef75b..5e51988d7668 100644 --- a/src/coreclr/src/jit/gentree.h +++ b/src/coreclr/src/jit/gentree.h @@ -7493,7 +7493,7 @@ inline bool GenTree::HasLastUse() // inline void GenTree::SetLastUse(int regIndex) { - unsigned int bitToSet = gtFlags |= GetLastUseBit(regIndex); + gtFlags |= GetLastUseBit(regIndex); } //----------------------------------------------------------------------------------- diff --git a/src/coreclr/src/jit/hwintrinsic.cpp b/src/coreclr/src/jit/hwintrinsic.cpp index 14a9b8628ffc..5e7eda61c30d 100644 --- a/src/coreclr/src/jit/hwintrinsic.cpp +++ b/src/coreclr/src/jit/hwintrinsic.cpp @@ -914,6 +914,14 @@ GenTree* Compiler::impHWIntrinsic(NamedIntrinsic intrinsic, { assert(numArgs == 4); indexedElementBaseType = getBaseTypeAndSizeOfSIMDType(sigReader.op3ClsHnd, &indexedElementSimdSize); + + if (intrinsic == NI_Dp_DotProductBySelectedQuadruplet) + { + assert(((baseType == TYP_INT) && (indexedElementBaseType == TYP_BYTE)) || + ((baseType == TYP_UINT) && (indexedElementBaseType == TYP_UBYTE))); + // The second source operand of sdot, udot instructions is an indexed 32-bit element. + indexedElementBaseType = baseType; + } } assert(indexedElementBaseType == baseType); diff --git a/src/coreclr/src/jit/hwintrinsicarm64.cpp b/src/coreclr/src/jit/hwintrinsicarm64.cpp index f869fcd2a8c5..c572f9bf0888 100644 --- a/src/coreclr/src/jit/hwintrinsicarm64.cpp +++ b/src/coreclr/src/jit/hwintrinsicarm64.cpp @@ -26,10 +26,14 @@ static CORINFO_InstructionSet Arm64VersionOfIsa(CORINFO_InstructionSet isa) return InstructionSet_ArmBase_Arm64; case InstructionSet_Crc32: return InstructionSet_Crc32_Arm64; + case InstructionSet_Dp: + return InstructionSet_Dp_Arm64; case InstructionSet_Sha1: return InstructionSet_Sha1_Arm64; case InstructionSet_Sha256: return InstructionSet_Sha256_Arm64; + case InstructionSet_Rdm: + return InstructionSet_Rdm_Arm64; default: return InstructionSet_NONE; } @@ -69,6 +73,20 @@ static CORINFO_InstructionSet lookupInstructionSet(const char* className) return InstructionSet_Crc32; } } + else if (className[0] == 'D') + { + if (strcmp(className, "Dp") == 0) + { + return InstructionSet_Dp; + } + } + else if (className[0] == 'R') + { + if (strcmp(className, "Rdm") == 0) + { + return InstructionSet_Rdm; + } + } else if (className[0] == 'S') { if (strcmp(className, "Sha1") == 0) @@ -140,20 +158,20 @@ bool HWIntrinsicInfo::isFullyImplementedIsa(CORINFO_InstructionSet isa) case InstructionSet_ArmBase_Arm64: case InstructionSet_Crc32: case InstructionSet_Crc32_Arm64: + case InstructionSet_Dp: + case InstructionSet_Dp_Arm64: + case InstructionSet_Rdm: + case InstructionSet_Rdm_Arm64: case InstructionSet_Sha1: case InstructionSet_Sha1_Arm64: case InstructionSet_Sha256: case InstructionSet_Sha256_Arm64: case InstructionSet_Vector64: case InstructionSet_Vector128: - { return true; - } default: - { return false; - } } } diff --git a/src/coreclr/src/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/src/jit/hwintrinsiccodegenarm64.cpp index a6b3bf943388..162fd4588915 100644 --- a/src/coreclr/src/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/src/jit/hwintrinsiccodegenarm64.cpp @@ -718,6 +718,16 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) } break; + case NI_AdvSimd_Arm64_StorePair: + case NI_AdvSimd_Arm64_StorePairNonTemporal: + GetEmitter()->emitIns_R_R_R(ins, emitSize, op2Reg, op3Reg, op1Reg); + break; + + case NI_AdvSimd_Arm64_StorePairScalar: + case NI_AdvSimd_Arm64_StorePairScalarNonTemporal: + GetEmitter()->emitIns_R_R_R(ins, emitTypeSize(intrin.baseType), op2Reg, op3Reg, op1Reg); + break; + case NI_Vector64_CreateScalarUnsafe: case NI_Vector128_CreateScalarUnsafe: if (intrin.op1->isContainedFltOrDblImmed()) diff --git a/src/coreclr/src/jit/hwintrinsiclistarm64.h b/src/coreclr/src/jit/hwintrinsiclistarm64.h index 09154b51bd2a..6de9ca2b158b 100644 --- a/src/coreclr/src/jit/hwintrinsiclistarm64.h +++ b/src/coreclr/src/jit/hwintrinsiclistarm64.h @@ -488,6 +488,10 @@ HARDWARE_INTRINSIC(AdvSimd_Arm64, ShiftRightArithmeticRoundedNarrowingSaturateUn HARDWARE_INTRINSIC(AdvSimd_Arm64, ShiftRightLogicalNarrowingSaturateScalar, 8, 2, {INS_uqshrn, INS_uqshrn, INS_uqshrn, INS_uqshrn, INS_uqshrn, INS_uqshrn, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_ShiftRightByImmediate, HW_Flag_HasImmediateOperand|HW_Flag_SIMDScalar) HARDWARE_INTRINSIC(AdvSimd_Arm64, ShiftRightLogicalRoundedNarrowingSaturateScalar, 8, 2, {INS_uqrshrn, INS_uqrshrn, INS_uqrshrn, INS_uqrshrn, INS_uqrshrn, INS_uqrshrn, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_ShiftRightByImmediate, HW_Flag_HasImmediateOperand|HW_Flag_SIMDScalar) HARDWARE_INTRINSIC(AdvSimd_Arm64, Sqrt, -1, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fsqrt, INS_fsqrt}, HW_Category_SIMD, HW_Flag_NoFlag) +HARDWARE_INTRINSIC(AdvSimd_Arm64, StorePair, -1, 3, {INS_stp, INS_stp, INS_stp, INS_stp, INS_stp, INS_stp, INS_stp, INS_stp, INS_stp, INS_stp}, HW_Category_MemoryStore, HW_Flag_BaseTypeFromSecondArg|HW_Flag_SpecialCodeGen) +HARDWARE_INTRINSIC(AdvSimd_Arm64, StorePairScalar, 8, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_stp, INS_stp, INS_invalid, INS_invalid, INS_stp, INS_invalid}, HW_Category_MemoryStore, HW_Flag_BaseTypeFromSecondArg|HW_Flag_SpecialCodeGen) +HARDWARE_INTRINSIC(AdvSimd_Arm64, StorePairScalarNonTemporal, 8, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_stnp, INS_stnp, INS_invalid, INS_invalid, INS_stnp, INS_invalid}, HW_Category_MemoryStore, HW_Flag_BaseTypeFromSecondArg|HW_Flag_SpecialCodeGen) +HARDWARE_INTRINSIC(AdvSimd_Arm64, StorePairNonTemporal, -1, 3, {INS_stnp, INS_stnp, INS_stnp, INS_stnp, INS_stnp, INS_stnp, INS_stnp, INS_stnp, INS_stnp, INS_stp}, HW_Category_MemoryStore, HW_Flag_BaseTypeFromSecondArg|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(AdvSimd_Arm64, Subtract, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fsub}, HW_Category_SIMD, HW_Flag_NoFlag) HARDWARE_INTRINSIC(AdvSimd_Arm64, SubtractSaturateScalar, 8, 2, {INS_sqsub, INS_uqsub, INS_sqsub, INS_uqsub, INS_sqsub, INS_uqsub, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_SIMDScalar) HARDWARE_INTRINSIC(AdvSimd_Arm64, TransposeEven, -1, 2, {INS_trn1, INS_trn1, INS_trn1, INS_trn1, INS_trn1, INS_trn1, INS_trn1, INS_trn1, INS_trn1, INS_trn1}, HW_Category_SIMD, HW_Flag_NoFlag) @@ -544,6 +548,34 @@ HARDWARE_INTRINSIC(Crc32, ComputeCrc32C, HARDWARE_INTRINSIC(Crc32_Arm64, ComputeCrc32, 0, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_crc32x, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_BaseTypeFromSecondArg|HW_Flag_NoFloatingPointUsed|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Crc32_Arm64, ComputeCrc32C, 0, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_crc32cx, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_BaseTypeFromSecondArg|HW_Flag_NoFloatingPointUsed|HW_Flag_SpecialCodeGen) +// *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** +// ISA Function name SIMD size Number of arguments Instructions Category Flags +// {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE} +// *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** +// DP Intrinsics +HARDWARE_INTRINSIC(Dp, DotProduct, -1, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sdot, INS_udot, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Dp, DotProductBySelectedQuadruplet, -1, 4, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sdot, INS_udot, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMDByIndexedElement, HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics) + +// *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** +// ISA Function name SIMD size Number of arguments Instructions Category Flags +// {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE} +// *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** +// RDM Intrinsics +HARDWARE_INTRINSIC(Rdm, MultiplyRoundedDoublingAndAddSaturateHigh, -1, 3, {INS_invalid, INS_invalid, INS_sqrdmlah, INS_invalid, INS_sqrdmlah, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Rdm, MultiplyRoundedDoublingAndSubtractSaturateHigh, -1, 3, {INS_invalid, INS_invalid, INS_sqrdmlsh, INS_invalid, INS_sqrdmlsh, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Rdm, MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh, -1, 4, {INS_invalid, INS_invalid, INS_sqrdmlah, INS_invalid, INS_sqrdmlah, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMDByIndexedElement, HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Rdm, MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh, -1, 4, {INS_invalid, INS_invalid, INS_sqrdmlsh, INS_invalid, INS_sqrdmlsh, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMDByIndexedElement, HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics) + +// *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** +// ISA Function name SIMD size Number of arguments Instructions Category Flags +// {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE} +// *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** +// RDM 64-bit only Intrinsics +HARDWARE_INTRINSIC(Rdm_Arm64, MultiplyRoundedDoublingAndAddSaturateHighScalar, 8, 3, {INS_invalid, INS_invalid, INS_sqrdmlah, INS_invalid, INS_sqrdmlah, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_HasRMWSemantics|HW_Flag_SIMDScalar) +HARDWARE_INTRINSIC(Rdm_Arm64, MultiplyRoundedDoublingAndSubtractSaturateHighScalar, 8, 3, {INS_invalid, INS_invalid, INS_sqrdmlsh, INS_invalid, INS_sqrdmlsh, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_HasRMWSemantics|HW_Flag_SIMDScalar) +HARDWARE_INTRINSIC(Rdm_Arm64, MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh, 8, 4, {INS_invalid, INS_invalid, INS_sqrdmlah, INS_invalid, INS_sqrdmlah, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMDByIndexedElement, HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics|HW_Flag_SIMDScalar) +HARDWARE_INTRINSIC(Rdm_Arm64, MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh, 8, 4, {INS_invalid, INS_invalid, INS_sqrdmlsh, INS_invalid, INS_sqrdmlsh, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMDByIndexedElement, HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics|HW_Flag_SIMDScalar) + // *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** // ISA Function name SIMD size Number of arguments Instructions Category Flags // {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE} diff --git a/src/coreclr/src/jit/importer.cpp b/src/coreclr/src/jit/importer.cpp index 10b760702ccc..e3efd08dbe30 100644 --- a/src/coreclr/src/jit/importer.cpp +++ b/src/coreclr/src/jit/importer.cpp @@ -893,8 +893,10 @@ GenTreeCall::Use* Compiler::impPopCallArgs(unsigned count, CORINFO_SIG_INFO* sig // ABI handling of this argument. // Note that this can happen, for example, if we have a SIMD intrinsic that returns a SIMD type // with a different baseType than we've seen. + // We also need to ensure an OBJ node if we have a FIELD node that might be transformed to LCL_FLD + // or a plain GT_IND. // TODO-Cleanup: Consider whether we can eliminate all of these cases. - if (gtGetStructHandleIfPresent(temp) != structType) + if ((gtGetStructHandleIfPresent(temp) != structType) || temp->OperIs(GT_FIELD)) { forceNormalization = true; } @@ -1666,9 +1668,12 @@ GenTree* Compiler::impNormStructVal(GenTree* structVal, break; case GT_FIELD: - // Wrap it in a GT_OBJ. + // Wrap it in a GT_OBJ, if needed. structVal->gtType = structType; - structVal = gtNewObjNode(structHnd, gtNewOperNode(GT_ADDR, TYP_BYREF, structVal)); + if ((structType == TYP_STRUCT) || forceNormalization) + { + structVal = gtNewObjNode(structHnd, gtNewOperNode(GT_ADDR, TYP_BYREF, structVal)); + } break; case GT_LCL_VAR: @@ -12534,7 +12539,15 @@ void Compiler::impImportBlockCode(BasicBlock* block) op1 = impPopStack().val; type = op1->TypeGet(); - // brfalse and brtrue is only allowed on I4, refs, and byrefs. + // Per Ecma-355, brfalse and brtrue are only specified for nint, ref, and byref. + // + // We've historically been a bit more permissive, so here we allow + // any type that gtNewZeroConNode can handle. + if (!varTypeIsArithmetic(type) && !varTypeIsGC(type)) + { + BADCODE("invalid type for brtrue/brfalse"); + } + if (opts.OptimizationEnabled() && (block->bbJumpDest == block->bbNext)) { block->bbJumpKind = BBJ_NONE; @@ -12561,12 +12574,11 @@ void Compiler::impImportBlockCode(BasicBlock* block) } else { - /* We'll compare against an equally-sized integer 0 */ - /* For small types, we always compare against int */ + // We'll compare against an equally-sized integer 0 + // For small types, we always compare against int op2 = gtNewZeroConNode(genActualType(op1->gtType)); - /* Create the comparison operator and try to fold it */ - + // Create the comparison operator and try to fold it oper = (opcode == CEE_BRTRUE || opcode == CEE_BRTRUE_S) ? GT_NE : GT_EQ; op1 = gtNewOperNode(oper, TYP_INT, op1, op2); } diff --git a/src/coreclr/src/jit/layout.cpp b/src/coreclr/src/jit/layout.cpp index b76b4322aae4..bafe17bb0b0a 100644 --- a/src/coreclr/src/jit/layout.cpp +++ b/src/coreclr/src/jit/layout.cpp @@ -410,3 +410,64 @@ ClassLayout* ClassLayout::GetPPPQuirkLayout(CompAllocator alloc) return m_pppQuirkLayout; } #endif // TARGET_AMD64 + +//------------------------------------------------------------------------ +// AreCompatible: check if 2 layouts are the same for copying. +// +// Arguments: +// layout1 - the first layout; +// layout2 - the second layout. +// +// Return value: +// true if compatible, false otherwise. +// +// Notes: +// Layouts are called compatible if they are equal or if +// they have the same size and the same GC slots. +// +// static +bool ClassLayout::AreCompatible(const ClassLayout* layout1, const ClassLayout* layout2) +{ + CORINFO_CLASS_HANDLE clsHnd1 = layout1->GetClassHandle(); + CORINFO_CLASS_HANDLE clsHnd2 = layout2->GetClassHandle(); + assert(clsHnd1 != NO_CLASS_HANDLE); + assert(clsHnd2 != NO_CLASS_HANDLE); + + if (clsHnd1 == clsHnd2) + { + return true; + } + + if (layout1->GetSize() != layout2->GetSize()) + { + return false; + } + + if (layout1->HasGCPtr() != layout2->HasGCPtr()) + { + return false; + } + + if (!layout1->HasGCPtr() && !layout2->HasGCPtr()) + { + return true; + } + + assert(layout1->HasGCPtr() && layout2->HasGCPtr()); + if (layout1->GetGCPtrCount() != layout2->GetGCPtrCount()) + { + return false; + } + + assert(layout1->GetSlotCount() == layout2->GetSlotCount()); + unsigned slotsCount = layout1->GetSlotCount(); + + for (unsigned i = 0; i < slotsCount; ++i) + { + if (layout1->GetGCPtrType(i) != layout2->GetGCPtrType(i)) + { + return false; + } + } + return true; +} diff --git a/src/coreclr/src/jit/layout.h b/src/coreclr/src/jit/layout.h index 315a19452a5a..6a74949cfd21 100644 --- a/src/coreclr/src/jit/layout.h +++ b/src/coreclr/src/jit/layout.h @@ -195,6 +195,8 @@ class ClassLayout } } + static bool AreCompatible(const ClassLayout* layout1, const ClassLayout* layout2); + private: const BYTE* GetGCPtrs() const { diff --git a/src/coreclr/src/jit/lclvars.cpp b/src/coreclr/src/jit/lclvars.cpp index ae8408df6e0c..3cf7f4c14091 100644 --- a/src/coreclr/src/jit/lclvars.cpp +++ b/src/coreclr/src/jit/lclvars.cpp @@ -909,12 +909,12 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo* varDscInfo) #if defined(UNIX_AMD64_ABI) if (varTypeIsStruct(argType) && (structDesc.eightByteCount >= 1)) { - isFloat = varTypeIsFloating(firstEightByteType); + isFloat = varTypeUsesFloatReg(firstEightByteType); } else #endif // !UNIX_AMD64_ABI { - isFloat = varTypeIsFloating(argType); + isFloat = varTypeUsesFloatReg(argType); } #if defined(UNIX_AMD64_ABI) @@ -940,13 +940,13 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo* varDscInfo) { printf(", secondEightByte: %s", getRegName(genMapRegArgNumToRegNum(secondAllocatedRegArgNum, secondEightByteType), - varTypeIsFloating(secondEightByteType))); + varTypeUsesFloatReg(secondEightByteType))); } } else #endif // defined(UNIX_AMD64_ABI) { - isFloat = varTypeIsFloating(argType); + isFloat = varTypeUsesFloatReg(argType); unsigned regArgNum = genMapRegNumToRegArgNum(varDsc->GetArgReg(), argType); for (unsigned ix = 0; ix < cSlots; ix++, regArgNum++) @@ -998,7 +998,7 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo* varDscInfo) { #if defined(TARGET_ARM) varDscInfo->setAllRegArgUsed(argType); - if (varTypeIsFloating(argType)) + if (varTypeUsesFloatReg(argType)) { varDscInfo->setAnyFloatStackArgs(); } @@ -2194,7 +2194,7 @@ void Compiler::StructPromotionHelper::PromoteStructVar(unsigned lclNum) { const lvaStructFieldInfo* pFieldInfo = &structPromotionInfo.fields[index]; - if (varTypeIsFloating(pFieldInfo->fldType) || varTypeIsSIMD(pFieldInfo->fldType)) + if (varTypeUsesFloatReg(pFieldInfo->fldType)) { // Whenever we promote a struct that contains a floating point field // it's possible we transition from a method that originally only had integer @@ -5131,10 +5131,26 @@ bool Compiler::lvaIsPreSpilled(unsigned lclNum, regMaskTP preSpillMask) } #endif // TARGET_ARM -/***************************************************************************** - * lvaUpdateArgsWithInitialReg() : For each argument variable descriptor, update - * its current register with the initial register as assigned by LSRA. - */ +//------------------------------------------------------------------------ +// UpdateLifeFieldVar: Update live sets for only the given field of a multi-reg LclVar node. +// +// Arguments: +// lclNode - the GT_LCL_VAR node. +// +void Compiler::lvaUpdateArgWithInitialReg(LclVarDsc* varDsc) +{ + noway_assert(varDsc->lvIsParam); + + if (varDsc->lvIsRegCandidate()) + { + varDsc->SetRegNum(varDsc->GetArgInitReg()); + } +} + +//------------------------------------------------------------------------ +// lvaUpdateArgsWithInitialReg() : For each argument variable descriptor, update +// its current register with the initial register as assigned by LSRA. +// void Compiler::lvaUpdateArgsWithInitialReg() { if (!compLSRADone) @@ -5144,7 +5160,7 @@ void Compiler::lvaUpdateArgsWithInitialReg() for (unsigned lclNum = 0; lclNum < info.compArgsCount; lclNum++) { - LclVarDsc* varDsc = lvaTable + lclNum; + LclVarDsc* varDsc = lvaGetDesc(lclNum); if (varDsc->lvPromotedStruct()) { @@ -5158,7 +5174,7 @@ void Compiler::lvaUpdateArgsWithInitialReg() if (varDsc->lvIsRegCandidate()) { - varDsc->SetRegNum(varDsc->GetArgInitReg()); + lvaUpdateArgWithInitialReg(varDsc); } } } @@ -5378,23 +5394,7 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, unsigned fieldVarNum = BAD_VAR_NUM; noway_assert(lclNum < lvaCount); - LclVarDsc* varDsc = lvaTable + lclNum; - - if (varDsc->lvPromotedStruct()) - { - noway_assert(varDsc->lvFieldCnt == 1); // We only handle one field here - fieldVarNum = varDsc->lvFieldLclStart; - - lvaPromotionType promotionType = lvaGetPromotionType(varDsc); - - if (promotionType == PROMOTION_TYPE_INDEPENDENT) - { - lclNum = fieldVarNum; - noway_assert(lclNum < lvaCount); - varDsc = lvaTable + lclNum; - assert(varDsc->lvIsStructField); - } - } + LclVarDsc* varDsc = lvaGetDesc(lclNum); noway_assert(varDsc->lvIsParam); @@ -5440,19 +5440,18 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, } } - // For struct promoted parameters we need to set the offsets for both LclVars. + // For struct promoted parameters we need to set the offsets for the field lclVars. // - // For a dependent promoted struct we also assign the struct fields stack offset + // For a promoted struct we also assign the struct fields stack offset if (varDsc->lvPromotedStruct()) { - lvaPromotionType promotionType = lvaGetPromotionType(varDsc); - - if (promotionType == PROMOTION_TYPE_DEPENDENT) + unsigned firstFieldNum = varDsc->lvFieldLclStart; + int offset = varDsc->lvStkOffs; + for (unsigned i = 0; i < varDsc->lvFieldCnt; i++) { - noway_assert(varDsc->lvFieldCnt == 1); // We only handle one field here - - assert(fieldVarNum == varDsc->lvFieldLclStart); - lvaTable[fieldVarNum].lvStkOffs = varDsc->lvStkOffs; + LclVarDsc* fieldVarDsc = lvaGetDesc(firstFieldNum + i); + fieldVarDsc->lvStkOffs = offset; + offset += fieldVarDsc->lvFldOffset; } } // For an independent promoted struct field we also assign the parent struct stack offset @@ -5495,23 +5494,7 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, unsigned fieldVarNum = BAD_VAR_NUM; noway_assert(lclNum < lvaCount); - LclVarDsc* varDsc = lvaTable + lclNum; - - if (varDsc->lvPromotedStruct()) - { - noway_assert(varDsc->lvFieldCnt == 1); // We only handle one field here - fieldVarNum = varDsc->lvFieldLclStart; - - lvaPromotionType promotionType = lvaGetPromotionType(varDsc); - - if (promotionType == PROMOTION_TYPE_INDEPENDENT) - { - lclNum = fieldVarNum; - noway_assert(lclNum < lvaCount); - varDsc = lvaTable + lclNum; - assert(varDsc->lvIsStructField); - } - } + LclVarDsc* varDsc = lvaGetDesc(lclNum); noway_assert(varDsc->lvIsParam); @@ -5767,22 +5750,13 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, #endif // !defined(TARGET_64BIT) if (varDsc->lvPromotedStruct()) { - lvaPromotionType promotionType = lvaGetPromotionType(varDsc); - - if (promotionType == PROMOTION_TYPE_DEPENDENT) + unsigned firstFieldNum = varDsc->lvFieldLclStart; + for (unsigned i = 0; i < varDsc->lvFieldCnt; i++) { - noway_assert(varDsc->lvFieldCnt == 1); // We only handle one field here - - assert(fieldVarNum == varDsc->lvFieldLclStart); - lvaTable[fieldVarNum].lvStkOffs = varDsc->lvStkOffs; + LclVarDsc* fieldVarDsc = lvaGetDesc(firstFieldNum + i); + fieldVarDsc->lvStkOffs = varDsc->lvStkOffs + fieldVarDsc->lvFldOffset; } } - // For an independent promoted struct field we also assign the parent struct stack offset - else if (varDsc->lvIsStructField) - { - noway_assert(varDsc->lvParentLcl < lvaCount); - lvaTable[varDsc->lvParentLcl].lvStkOffs = varDsc->lvStkOffs; - } if (Target::g_tgtArgOrder == Target::ARG_ORDER_R2L && !varDsc->lvIsRegArg) { diff --git a/src/coreclr/src/jit/lower.cpp b/src/coreclr/src/jit/lower.cpp index 69cfbbe34a99..cc9e2891e9a4 100644 --- a/src/coreclr/src/jit/lower.cpp +++ b/src/coreclr/src/jit/lower.cpp @@ -4983,7 +4983,7 @@ GenTree* Lowering::LowerAdd(GenTreeOp* node) GenTree* next = node->gtNext; BlockRange().Remove(op2); BlockRange().Remove(node); - JITDUMP("Remove [06%u], [06%u]\n", op2->gtTreeID, node->gtTreeID); + JITDUMP("Remove [%06u], [%06u]\n", op2->gtTreeID, node->gtTreeID); return next; } @@ -6530,8 +6530,11 @@ void Lowering::LowerBlockStoreCommon(GenTreeBlk* blkNode) bool Lowering::TryTransformStoreObjAsStoreInd(GenTreeBlk* blkNode) { assert(blkNode->OperIs(GT_STORE_BLK, GT_STORE_DYN_BLK, GT_STORE_OBJ)); - return false; -#if 0 // the optimization is temporary disabled due to https://github.com/dotnet/wpf/issues/3226 issue. + if (comp->opts.OptimizationEnabled()) + { + return false; + } + if (blkNode->OperIs(GT_STORE_DYN_BLK)) { return false; @@ -6575,6 +6578,7 @@ bool Lowering::TryTransformStoreObjAsStoreInd(GenTreeBlk* blkNode) return false; } + JITDUMP("Replacing STORE_OBJ with STOREIND for [06%u]", blkNode->gtTreeID); blkNode->ChangeOper(GT_STOREIND); blkNode->ChangeType(regType); @@ -6597,7 +6601,10 @@ bool Lowering::TryTransformStoreObjAsStoreInd(GenTreeBlk* blkNode) blkNode->SetData(src); BlockRange().Remove(initVal); } + else + { + assert(src->TypeIs(regType) || src->IsCnsIntOrI() || src->IsCall()); + } LowerStoreIndirCommon(blkNode); return true; -#endif } diff --git a/src/coreclr/src/jit/lsra.h b/src/coreclr/src/jit/lsra.h index 7050e5f069a2..c2adcf29a40a 100644 --- a/src/coreclr/src/jit/lsra.h +++ b/src/coreclr/src/jit/lsra.h @@ -44,13 +44,7 @@ typedef var_types RegisterType; template RegisterType regType(T type) { -#ifdef FEATURE_SIMD - if (varTypeIsSIMD(type)) - { - return FloatRegisterType; - } -#endif // FEATURE_SIMD - return varTypeIsFloating(TypeGet(type)) ? FloatRegisterType : IntRegisterType; + return varTypeUsesFloatReg(TypeGet(type)) ? FloatRegisterType : IntRegisterType; } //------------------------------------------------------------------------ diff --git a/src/coreclr/src/jit/lsrabuild.cpp b/src/coreclr/src/jit/lsrabuild.cpp index 549a463b3ea2..d902b3a1ab4e 100644 --- a/src/coreclr/src/jit/lsrabuild.cpp +++ b/src/coreclr/src/jit/lsrabuild.cpp @@ -1150,6 +1150,8 @@ bool LinearScan::buildKillPositionsForNode(GenTree* tree, LsraLocation currentLo // many of which appear to be regressions (because there is more spill on the infrequently path), // but are not really because the frequent path becomes smaller. Validating these diffs will need // to be done before making this change. + // Also note that we avoid setting callee-save preferences for floating point. This may need + // revisiting, and note that it doesn't currently apply to SIMD types, only float or double. // if (!blockSequence[curBBSeqNum]->isRunRarely()) if (enregisterLocalVars) { @@ -2533,7 +2535,7 @@ void LinearScan::buildIntervals() // across a call in the non-EH code, we'll be extra conservative about this. // Note that for writeThru intervals we don't update the preferences to be only callee-save. unsigned calleeSaveCount = - (varTypeIsFloating(interval->registerType)) ? CNT_CALLEE_SAVED_FLOAT : CNT_CALLEE_ENREG; + (varTypeUsesFloatReg(interval->registerType)) ? CNT_CALLEE_SAVED_FLOAT : CNT_CALLEE_ENREG; if ((weight <= (BB_UNITY_WEIGHT * 7)) || varDsc->lvVarIndex >= calleeSaveCount) { // If this is relatively low weight, don't prefer callee-save at all. @@ -2710,7 +2712,7 @@ RefPosition* LinearScan::BuildDef(GenTree* tree, regMaskTP dstCandidates, int mu type = tree->GetRegTypeByIndex(multiRegIdx); } - if (varTypeIsFloating(type) || varTypeIsSIMD(type)) + if (varTypeUsesFloatReg(type)) { compiler->compFloatingPointUsed = true; } @@ -3487,7 +3489,7 @@ int LinearScan::BuildReturn(GenTree* tree) { hasMismatchedRegTypes = true; regMaskTP dstRegMask = genRegMask(pRetTypeDesc->GetABIReturnReg(i)); - if (varTypeIsFloating(dstType)) + if (varTypeUsesFloatReg(dstType)) { buildInternalFloatRegisterDefForNode(tree, dstRegMask); } diff --git a/src/coreclr/src/jit/lsraxarch.cpp b/src/coreclr/src/jit/lsraxarch.cpp index 780d959a9e93..8895dc95ecec 100644 --- a/src/coreclr/src/jit/lsraxarch.cpp +++ b/src/coreclr/src/jit/lsraxarch.cpp @@ -70,7 +70,7 @@ int LinearScan::BuildNode(GenTree* tree) } // floating type generates AVX instruction (vmovss etc.), set the flag - if (varTypeIsFloating(tree->TypeGet())) + if (varTypeUsesFloatReg(tree->TypeGet())) { SetContainsAVXFlags(); } @@ -1042,7 +1042,7 @@ int LinearScan::BuildCall(GenTreeCall* call) ctrlExpr = call->gtCallAddr; } - RegisterType registerType = call->TypeGet(); + RegisterType registerType = regType(call); // Set destination candidates for return value of the call. CLANG_FORMAT_COMMENT_ANCHOR; @@ -1063,7 +1063,7 @@ int LinearScan::BuildCall(GenTreeCall* call) dstCandidates = retTypeDesc->GetABIReturnRegs(); assert((int)genCountBits(dstCandidates) == dstCount); } - else if (varTypeIsFloating(registerType)) + else if (varTypeUsesFloatReg(registerType)) { #ifdef TARGET_X86 // The return value will be on the X87 stack, and we will need to move it. diff --git a/src/coreclr/src/jit/morph.cpp b/src/coreclr/src/jit/morph.cpp index 8fd2c69a4413..4d420dabaa80 100644 --- a/src/coreclr/src/jit/morph.cpp +++ b/src/coreclr/src/jit/morph.cpp @@ -2881,7 +2881,7 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) #endif // FEATURE_HFA #ifdef TARGET_ARM - passUsingFloatRegs = !callIsVararg && (isHfaArg || varTypeIsFloating(argx)) && !opts.compUseSoftFP; + passUsingFloatRegs = !callIsVararg && (isHfaArg || varTypeUsesFloatReg(argx)) && !opts.compUseSoftFP; bool passUsingIntRegs = passUsingFloatRegs ? false : (intArgRegNum < MAX_REG_ARG); // We don't use the "size" return value from InferOpSizeAlign(). @@ -2918,7 +2918,7 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) #elif defined(TARGET_ARM64) assert(!callIsVararg || !isHfaArg); - passUsingFloatRegs = !callIsVararg && (isHfaArg || varTypeIsFloating(argx)); + passUsingFloatRegs = !callIsVararg && (isHfaArg || varTypeUsesFloatReg(argx)); #elif defined(TARGET_AMD64) @@ -5281,14 +5281,31 @@ const int MAX_INDEX_COMPLEXITY = 4; GenTree* Compiler::fgMorphArrayIndex(GenTree* tree) { noway_assert(tree->gtOper == GT_INDEX); - GenTreeIndex* asIndex = tree->AsIndex(); - - var_types elemTyp = tree->TypeGet(); - unsigned elemSize = tree->AsIndex()->gtIndElemSize; - CORINFO_CLASS_HANDLE elemStructType = tree->AsIndex()->gtStructElemClass; + GenTreeIndex* asIndex = tree->AsIndex(); + var_types elemTyp = asIndex->TypeGet(); + unsigned elemSize = asIndex->gtIndElemSize; + CORINFO_CLASS_HANDLE elemStructType = asIndex->gtStructElemClass; noway_assert(elemTyp != TYP_STRUCT || elemStructType != nullptr); + // Fold "cns_str"[cns_index] to ushort constant + if (opts.OptimizationEnabled() && asIndex->Arr()->OperIs(GT_CNS_STR) && asIndex->Index()->IsIntCnsFitsInI32()) + { + const int cnsIndex = static_cast(asIndex->Index()->AsIntConCommon()->IconValue()); + if (cnsIndex >= 0) + { + int length; + LPCWSTR str = info.compCompHnd->getStringLiteral(asIndex->Arr()->AsStrCon()->gtScpHnd, + asIndex->Arr()->AsStrCon()->gtSconCPX, &length); + if ((cnsIndex < length) && (str != nullptr)) + { + GenTree* cnsCharNode = gtNewIconNode(str[cnsIndex], elemTyp); + INDEBUG(cnsCharNode->gtDebugFlags |= GTF_DEBUG_NODE_MORPHED); + return cnsCharNode; + } + } + } + #ifdef FEATURE_SIMD if (featureSIMD && varTypeIsStruct(elemTyp) && structSizeMightRepresentSIMDType(elemSize)) { @@ -5537,7 +5554,7 @@ GenTree* Compiler::fgMorphArrayIndex(GenTree* tree) // If the index node is a floating-point type, notify the compiler // we'll potentially use floating point registers at the time of codegen. - if (varTypeIsFloating(tree->gtType)) + if (varTypeUsesFloatReg(tree->gtType)) { this->compFloatingPointUsed = true; } @@ -7543,8 +7560,9 @@ GenTree* Compiler::fgMorphPotentialTailCall(GenTreeCall* call) // fgSetBlockOrder() is going to mark the method as fully interruptible // if the block containing this tail call is reachable without executing // any call. + BasicBlock* curBlock = compCurBB; if (canFastTailCall || (fgFirstBB->bbFlags & BBF_GC_SAFE_POINT) || (compCurBB->bbFlags & BBF_GC_SAFE_POINT) || - !fgCreateGCPoll(GCPOLL_INLINE, compCurBB)) + (fgCreateGCPoll(GCPOLL_INLINE, compCurBB) == curBlock)) { // We didn't insert a poll block, so we need to morph the call now // (Normally it will get morphed when we get to the split poll block) @@ -8838,12 +8856,11 @@ GenTree* Compiler::fgMorphCall(GenTreeCall* call) // Regardless of the state of the basic block with respect to GC safe point, // we will always insert a GC Poll for scenarios involving a suppressed GC - // transition. Only insert the GC Poll on the first morph. + // transition. Only mark the block for GC Poll insertion on the first morph. if (fgGlobalMorph && call->IsUnmanaged() && call->IsSuppressGCTransition()) { - // Insert a GC poll. - bool insertedBB = fgCreateGCPoll(GCPOLL_CALL, compCurBB, compCurStmt); - assert(!insertedBB); // No new block should be inserted + compCurBB->bbFlags |= (BBF_HAS_SUPPRESSGC_CALL | BBF_GC_SAFE_POINT); + optMethodFlags |= OMF_NEEDS_GCPOLLS; } // Morph Type.op_Equality, Type.op_Inequality, and Enum.HasFlag @@ -9114,6 +9131,63 @@ GenTree* Compiler::fgMorphConst(GenTree* tree) return fgMorphTree(tree); } +//------------------------------------------------------------------------ +// fgMorphTryFoldObjAsLclVar: try to fold an Obj node as a LclVar. +// +// Arguments: +// obj - the obj node. +// +// Return value: +// GenTreeLclVar if the obj can be replaced by it, null otherwise. +// +// Notes: +// TODO-CQ: currently this transformation is done only under copy block, +// but it is benefitial to do for each OBJ node. However, `PUT_ARG_STACK` +// for some platforms does not expect struct `LCL_VAR` as a source, so +// it needs more work. +// +GenTreeLclVar* Compiler::fgMorphTryFoldObjAsLclVar(GenTreeObj* obj) +{ + if (opts.OptimizationEnabled()) + { + GenTree* op1 = obj->Addr(); + if (op1->OperIs(GT_ADDR)) + { + GenTreeUnOp* addr = op1->AsUnOp(); + GenTree* addrOp = addr->gtGetOp1(); + if (addrOp->TypeIs(obj->TypeGet()) && addrOp->OperIs(GT_LCL_VAR)) + { + GenTreeLclVar* lclVar = addrOp->AsLclVar(); + + ClassLayout* lclVarLayout = lvaGetDesc(lclVar)->GetLayout(); + ClassLayout* objLayout = obj->GetLayout(); + if (ClassLayout::AreCompatible(lclVarLayout, objLayout)) + { +#ifdef DEBUG + CORINFO_CLASS_HANDLE objClsHandle = obj->GetLayout()->GetClassHandle(); + assert(objClsHandle != NO_CLASS_HANDLE); + if (verbose) + { + CORINFO_CLASS_HANDLE lclClsHnd = gtGetStructHandle(lclVar); + printf("fold OBJ(ADDR(X)) [%06u] into X [%06u], ", dspTreeID(obj), dspTreeID(lclVar)); + printf("with %s handles\n", ((lclClsHnd == objClsHandle) ? "matching" : "different")); + } +#endif + // Keep the DONT_CSE flag in sync + // (as the addr always marks it for its op1) + lclVar->gtFlags &= ~GTF_DONT_CSE; + lclVar->gtFlags |= (obj->gtFlags & GTF_DONT_CSE); + + DEBUG_DESTROY_NODE(obj); + DEBUG_DESTROY_NODE(addr); + return lclVar; + } + } + } + } + return nullptr; +} + /***************************************************************************** * * Transform the given GTK_LEAF tree for code generation. @@ -10265,13 +10339,13 @@ GenTree* Compiler::fgMorphBlockOperand(GenTree* tree, var_types asgType, unsigne if (indirTree->OperIsBlk() && !isBlkReqd) { effectiveVal->SetOper(GT_IND); - effectiveVal->gtType = asgType; } else { // If we have an indirection and a block is required, it should already be a block. assert(indirTree->OperIsBlk() || !isBlkReqd); } + effectiveVal->gtType = asgType; } else { @@ -10298,6 +10372,7 @@ GenTree* Compiler::fgMorphBlockOperand(GenTree* tree, var_types asgType, unsigne } } } + assert(effectiveVal->TypeIs(asgType) || (varTypeIsSIMD(asgType) && varTypeIsStruct(effectiveVal))); tree = effectiveVal; return tree; } @@ -10346,13 +10421,26 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) } #endif // FEATURE_MULTIREG_RET - if (src->IsCall() && dest->OperIs(GT_LCL_VAR) && !compDoOldStructRetyping()) + if (src->IsCall() && !compDoOldStructRetyping()) { - LclVarDsc* varDsc = lvaGetDesc(dest->AsLclVar()); - if (varTypeIsStruct(varDsc) && varDsc->CanBeReplacedWithItsField(this)) + if (dest->OperIs(GT_OBJ)) { - JITDUMP(" not morphing a single reg call return\n"); - return tree; + GenTreeLclVar* lclVar = fgMorphTryFoldObjAsLclVar(dest->AsObj()); + if (lclVar != nullptr) + { + dest = lclVar; + asg->gtOp1 = lclVar; + } + } + + if (dest->OperIs(GT_LCL_VAR)) + { + LclVarDsc* varDsc = lvaGetDesc(dest->AsLclVar()); + if (varTypeIsStruct(varDsc) && varDsc->CanBeReplacedWithItsField(this)) + { + JITDUMP(" not morphing a single reg call return\n"); + return tree; + } } } @@ -10890,23 +10978,23 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) addrSpill = gtCloneExpr(destAddr); // addrSpill represents the 'destAddr' noway_assert(addrSpill != nullptr); } + } + } - // TODO-CQ: this should be based on a more general - // "BaseAddress" method, that handles fields of structs, before or after - // morphing. - if (addrSpill != nullptr && addrSpill->OperGet() == GT_ADDR) - { - if (addrSpill->AsOp()->gtOp1->IsLocal()) - { - // We will *not* consider this to define the local, but rather have each individual field assign - // be a definition. - addrSpill->AsOp()->gtOp1->gtFlags &= ~(GTF_LIVENESS_MASK); - assert(lvaGetPromotionType(addrSpill->AsOp()->gtOp1->AsLclVarCommon()->GetLclNum()) != - PROMOTION_TYPE_INDEPENDENT); - addrSpillIsStackDest = true; // addrSpill represents the address of LclVar[varNum] in our - // local stack frame - } - } + // TODO-CQ: this should be based on a more general + // "BaseAddress" method, that handles fields of structs, before or after + // morphing. + if ((addrSpill != nullptr) && addrSpill->OperIs(GT_ADDR)) + { + GenTree* addrSpillOp = addrSpill->AsOp()->gtGetOp1(); + if (addrSpillOp->IsLocal()) + { + // We will *not* consider this to define the local, but rather have each individual field assign + // be a definition. + addrSpillOp->gtFlags &= ~(GTF_LIVENESS_MASK); + assert(lvaGetPromotionType(addrSpillOp->AsLclVarCommon()->GetLclNum()) != PROMOTION_TYPE_INDEPENDENT); + addrSpillIsStackDest = true; // addrSpill represents the address of LclVar[varNum] in our + // local stack frame } } diff --git a/src/coreclr/src/jit/optimizer.cpp b/src/coreclr/src/jit/optimizer.cpp index 9bd4ba9e7008..d953ecd92aed 100644 --- a/src/coreclr/src/jit/optimizer.cpp +++ b/src/coreclr/src/jit/optimizer.cpp @@ -9257,7 +9257,7 @@ void Compiler::optRemoveRedundantZeroInits() Statement* next = stmt->GetNextStmt(); for (GenTree* tree = stmt->GetTreeList(); tree != nullptr; tree = tree->gtNext) { - if (((tree->gtFlags & GTF_CALL) != 0) && (!tree->IsCall() || !tree->AsCall()->IsSuppressGCTransition())) + if (((tree->gtFlags & GTF_CALL) != 0)) { hasGCSafePoint = true; } diff --git a/src/coreclr/src/jit/target.h b/src/coreclr/src/jit/target.h index 4229d39b3266..6e79bfac3df5 100644 --- a/src/coreclr/src/jit/target.h +++ b/src/coreclr/src/jit/target.h @@ -1590,7 +1590,7 @@ C_ASSERT((FEATURE_TAILCALL_OPT == 0) || (FEATURE_FASTTAILCALL == 1)); #define BITS_PER_BYTE 8 #define REGNUM_MASK ((1 << REGNUM_BITS) - 1) // a n-bit mask use to encode multiple REGNUMs into a unsigned int -#define RBM_ALL(type) (varTypeIsFloating(type) ? RBM_ALLFLOAT : RBM_ALLINT) +#define RBM_ALL(type) (varTypeUsesFloatReg(type) ? RBM_ALLFLOAT : RBM_ALLINT) /*****************************************************************************/ @@ -1896,7 +1896,7 @@ inline regMaskTP genRegMask(regNumber regNum, var_types type) #else regMaskTP regMask = RBM_NONE; - if (varTypeIsFloating(type)) + if (varTypeUsesFloatReg(type)) { regMask = genRegMaskFloat(regNum, type); } @@ -1944,7 +1944,7 @@ inline regNumber regNextOfType(regNumber reg, var_types type) regReturn = REG_NEXT(reg); #endif - if (varTypeIsFloating(type)) + if (varTypeUsesFloatReg(type)) { if (regReturn > REG_FP_LAST) { diff --git a/src/coreclr/src/md/compiler/CMakeLists.txt b/src/coreclr/src/md/compiler/CMakeLists.txt index 6b89cfa5308d..495fa4d70ca2 100644 --- a/src/coreclr/src/md/compiler/CMakeLists.txt +++ b/src/coreclr/src/md/compiler/CMakeLists.txt @@ -17,7 +17,6 @@ set(MDCOMPILER_SOURCES regmeta_import.cpp regmeta_imetadatatables.cpp regmeta_vm.cpp - verifylayouts.cpp ) set(MDCOMPILER_HEADERS @@ -33,8 +32,6 @@ set(MDCOMPILER_HEADERS ../inc/metamodelrw.h ../inc/rwutil.h ../inc/stgio.h - ../inc/verifylayouts.h - ../inc/VerifyLayouts.h cacheload.h classfactory.h custattr.h @@ -47,18 +44,31 @@ set(MDCOMPILER_HEADERS regmeta.h ) +set(MDCOMPILER_WKS_SOURCES + ${MDCOMPILER_SOURCES} + verifylayouts.cpp +) + +set(MDCOMPILER_WKS_HEADERS + ${MDCOMPILER_HEADERS} + ../inc/verifylayouts.h +) + convert_to_absolute_path(MDCOMPILER_SOURCES ${MDCOMPILER_SOURCES}) convert_to_absolute_path(MDCOMPILER_HEADERS ${MDCOMPILER_HEADERS}) +convert_to_absolute_path(MDCOMPILER_WKS_SOURCES ${MDCOMPILER_WKS_SOURCES}) +convert_to_absolute_path(MDCOMPILER_WKS_HEADERS ${MDCOMPILER_WKS_HEADERS}) if (CLR_CMAKE_TARGET_WIN32) list(APPEND MDCOMPILER_SOURCES ${MDCOMPILER_HEADERS}) + list(APPEND MDCOMPILER_WKS_SOURCES ${MDCOMPILER_WKS_HEADERS}) endif() add_library_clr(mdcompiler_dac ${MDCOMPILER_SOURCES}) set_target_properties(mdcompiler_dac PROPERTIES DAC_COMPONENT TRUE) target_precompile_header(TARGET mdcompiler_dac HEADER stdafx.h) -add_library_clr(mdcompiler_wks OBJECT ${MDCOMPILER_SOURCES}) +add_library_clr(mdcompiler_wks OBJECT ${MDCOMPILER_WKS_SOURCES}) target_compile_definitions(mdcompiler_wks PRIVATE FEATURE_METADATA_EMIT_ALL) target_precompile_header(TARGET mdcompiler_wks HEADER stdafx.h) @@ -69,3 +79,7 @@ target_precompile_header(TARGET mdcompiler-dbi HEADER stdafx.h) add_library_clr(mdcompiler_crossgen ${MDCOMPILER_SOURCES}) set_target_properties(mdcompiler_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE) target_precompile_header(TARGET mdcompiler_crossgen HEADER stdafx.h) + +add_library_clr(mdcompiler_ppdb ${MDCOMPILER_SOURCES}) +target_compile_definitions(mdcompiler_ppdb PRIVATE FEATURE_METADATA_EMIT_ALL FEATURE_METADATA_EMIT_PORTABLE_PDB) +target_precompile_header(TARGET mdcompiler_ppdb HEADER stdafx.h) \ No newline at end of file diff --git a/src/coreclr/src/md/compiler/disp.cpp b/src/coreclr/src/md/compiler/disp.cpp index 82d09e8c2d9a..95c35063c719 100644 --- a/src/coreclr/src/md/compiler/disp.cpp +++ b/src/coreclr/src/md/compiler/disp.cpp @@ -478,6 +478,81 @@ HRESULT Disp::OpenScopeOnITypeInfo( // Return code. return E_NOTIMPL; } // Disp::OpenScopeOnITypeInfo +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB +//***************************************************************************** +// Create a brand new scope which will be used for portable PDB metadata. +// This is based on the CLSID that was used to get the dispenser. +// +// The existing DefineScope method cannot be used for the purpose of PDB +// metadata generation, since it internally creates module and type def table +// entries. +//***************************************************************************** +__checkReturn +HRESULT +Disp::DefinePortablePdbScope( + REFCLSID rclsid, // [in] What version to create. + DWORD dwCreateFlags, // [in] Flags on the create. + REFIID riid, // [in] The interface desired. + IUnknown** ppIUnk) // [out] Return interface on success. +{ +#ifdef FEATURE_METADATA_EMIT + HRESULT hr = S_OK; + + BEGIN_ENTRYPOINT_NOTHROW; + + RegMeta* pMeta = 0; + OptionValue optionForNewScope = m_OptionValue; + + LOG((LF_METADATA, LL_INFO10, "Disp::DefinePortablePdbScope(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", rclsid, dwCreateFlags, riid, ppIUnk)); + + if (dwCreateFlags) + IfFailGo(E_INVALIDARG); + + // Currently the portable PDB tables are treated as an extension to the MDVersion2 + // TODO: this extension might deserve its own version number e.g. 'MDVersion3' + if (rclsid == CLSID_CLR_v2_MetaData) + { + optionForNewScope.m_MetadataVersion = MDVersion2; + } + else + { + // If it is a version we don't understand, then we cannot continue. + IfFailGo(CLDB_E_FILE_OLDVER); + } + + // Create a new coclass for this. + pMeta = new (nothrow) RegMeta(); + IfNullGo(pMeta); + + IfFailGo(pMeta->SetOption(&optionForNewScope)); + + // Create the MiniMd-style scope for portable pdb + IfFailGo(pMeta->CreateNewPortablePdbMD()); + + // Get the requested interface. + IfFailGo(pMeta->QueryInterface(riid, (void**)ppIUnk)); + + // Add the new RegMeta to the cache. + IfFailGo(pMeta->AddToCache()); + + LOG((LOGMD, "{%08x} Created new emit scope\n", pMeta)); + +ErrExit: + if (FAILED(hr)) + { + if (pMeta != NULL) + delete pMeta; + *ppIUnk = NULL; + } + END_ENTRYPOINT_NOTHROW; + + return hr; +#else //!FEATURE_METADATA_EMIT + return E_NOTIMPL; +#endif //!FEATURE_METADATA_EMIT +} // Disp::DefineScope +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB + #ifdef FEATURE_METADATA_CUSTOM_DATA_SOURCE //***************************************************************************** @@ -595,6 +670,10 @@ HRESULT Disp::QueryInterface(REFIID riid, void **ppUnk) *ppUnk = (IMetaDataDispenser *) this; else if (riid == IID_IMetaDataDispenserEx) *ppUnk = (IMetaDataDispenserEx *) this; +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + else if (riid == IID_IMetaDataDispenserEx2) + *ppUnk = (IMetaDataDispenserEx2 *) this; +#endif #ifdef FEATURE_METADATA_CUSTOM_DATA_SOURCE else if (riid == IID_IMetaDataDispenserCustom) *ppUnk = static_cast(this); diff --git a/src/coreclr/src/md/compiler/disp.h b/src/coreclr/src/md/compiler/disp.h index 2a183051d9bf..fbca3f069c61 100644 --- a/src/coreclr/src/md/compiler/disp.h +++ b/src/coreclr/src/md/compiler/disp.h @@ -15,7 +15,11 @@ class Disp : +#ifndef FEATURE_METADATA_EMIT_PORTABLE_PDB public IMetaDataDispenserEx +#else + public IMetaDataDispenserEx2 +#endif #ifdef FEATURE_METADATA_CUSTOM_DATA_SOURCE , IMetaDataDispenserCustom #endif @@ -88,6 +92,14 @@ class Disp : ULONG cchName, // [IN] the name buffer's size ULONG *pcName); // [OUT] the number of characters returend in the buffer +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + STDMETHODIMP DefinePortablePdbScope( // Return code. + REFCLSID rclsid, // [in] What version to create. + DWORD dwCreateFlags, // [in] Flags on the create. + REFIID riid, // [in] The interface desired. + IUnknown** ppIUnk); // [out] Return interface on success. +#endif + #ifdef FEATURE_METADATA_CUSTOM_DATA_SOURCE // *** IMetaDataDispenserCustom methods *** STDMETHODIMP OpenScopeOnCustomDataSource( // S_OK or error diff --git a/src/coreclr/src/md/compiler/emit.cpp b/src/coreclr/src/md/compiler/emit.cpp index 1d380129983a..4a7cf802022b 100644 --- a/src/coreclr/src/md/compiler/emit.cpp +++ b/src/coreclr/src/md/compiler/emit.cpp @@ -2044,6 +2044,329 @@ HRESULT RegMeta::_SetGenericParamProps( // S_OK or error. #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER } // RegMeta::_SetGenericParamProps +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB +//***************************************************************************** +// Get referenced type system metadata tables. +//***************************************************************************** +STDMETHODIMP RegMeta::GetReferencedTypeSysTables( // S_OK or error. + ULONG64 *refTables, // [OUT] Bit vector of referenced type system metadata tables. + ULONG refTableRows[], // [OUT] Array of number of rows for each referenced type system table. + const ULONG maxTableRowsSize, // [IN] Max size of the rows array. + ULONG *tableRowsSize) // [OUT] Size of the rows array. +{ +#ifdef FEATURE_METADATA_EMIT_IN_DEBUGGER + return E_NOTIMPL; +#else //!FEATURE_METADATA_EMIT_IN_DEBUGGER + HRESULT hr = S_OK; + + BEGIN_ENTRYPOINT_NOTHROW; + + LOG((LOGMD, "RegMeta::GetReferencedTypeSysTables()\n")); + START_MD_PERF(); + + ULONG64 refTablesBitVector = 0; + ULONG count = 0; + ULONG* ptr = NULL; + ULONG rowsSize = 0; + + for (ULONG i = 0; i < TBL_COUNT; i++) + { + if (m_pStgdb->m_MiniMd.m_Tables[i].GetRecordCount() > 0) + { + refTablesBitVector |= (ULONG64)1UL << i; + count++; + } + } + + _ASSERTE(count <= maxTableRowsSize); + if (count > maxTableRowsSize) + { + hr = META_E_BADMETADATA; + goto ErrExit; + } + + *refTables = refTablesBitVector; + *tableRowsSize = count; + + ptr = refTableRows; + for (ULONG i = 0; i < TBL_COUNT; i++) + { + rowsSize = m_pStgdb->m_MiniMd.m_Tables[i].GetRecordCount(); + if (rowsSize > 0) + *ptr++ = rowsSize; + } + +ErrExit: + STOP_MD_PERF(GetReferencedTypeSysTables); + + END_ENTRYPOINT_NOTHROW; + return hr; +#endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER +} // RegMeta::GetReferencedTypeSysTables + + +//***************************************************************************** +// Defines PDB stream data for portable PDB metadata +//***************************************************************************** +STDMETHODIMP RegMeta::DefinePdbStream( // S_OK or error. + PORT_PDB_STREAM* pdbStream) // [IN] Portable pdb stream data. +{ +#ifdef FEATURE_METADATA_EMIT_IN_DEBUGGER + return E_NOTIMPL; +#else //!FEATURE_METADATA_EMIT_IN_DEBUGGER + HRESULT hr = S_OK; + + BEGIN_ENTRYPOINT_NOTHROW; + + LOG((LOGMD, "RegMeta::DefinePdbStream()\n")); + START_MD_PERF(); + + IfFailGo(m_pStgdb->m_pPdbHeap->SetData(pdbStream)); + +ErrExit: + STOP_MD_PERF(DefinePdbStream); + + END_ENTRYPOINT_NOTHROW; + return hr; +#endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER +} // RegMeta::DefinePdbStream + +//***************************************************************************** +// Defines a document for portable PDB metadata +//***************************************************************************** +STDMETHODIMP RegMeta::DefineDocument( // S_OK or error. + char *docName, // [IN] Document name (string will be tokenized). + GUID *hashAlg, // [IN] Hash algorithm GUID. + BYTE *hashVal, // [IN] Hash value. + ULONG hashValSize, // [IN] Hash value size. + GUID *lang, // [IN] Language GUID. + mdDocument *docMdToken) // [OUT] Token of the defined document. +{ +#ifdef FEATURE_METADATA_EMIT_IN_DEBUGGER + return E_NOTIMPL; +#else //!FEATURE_METADATA_EMIT_IN_DEBUGGER + HRESULT hr = S_OK; + char delim[2] = ""; + ULONG docNameBlobSize = 0; + ULONG docNameBlobMaxSize = 0; + BYTE* docNameBlob = NULL; + BYTE* docNameBlobPtr = NULL; + ULONG partsCount = 0; + ULONG partsIndexesCount = 0; + UINT32* partsIndexes = NULL; + UINT32* partsIndexesPtr = NULL; + char* stringToken = NULL; + + BEGIN_ENTRYPOINT_NOTHROW; + + LOG((LOGMD, "RegMeta::DefineDocument(%s)\n", docName)); + START_MD_PERF(); + LOCKWRITE(); + + IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); + + // determine separator and number of separated parts + GetPathSeparator(docName, delim, &partsCount); + delim[1] = '\0'; + + // allocate the maximum size of a document blob + // treating each compressed index to take maximum of 4 bytes. + // the actual size will be calculated once we compress each index. + docNameBlobMaxSize = sizeof(char) + sizeof(ULONG) * partsCount; // (delim + 4 * partsCount) + docNameBlob = new BYTE[docNameBlobMaxSize]; + partsIndexes = new UINT32[partsCount]; + + // add path parts to blob heap and store their indexes + partsIndexesPtr = partsIndexes; + if (*delim == *docName) + { + // if the path starts with the delimiter (e.g. /home/user/...) store an empty string + *partsIndexesPtr++ = 0; + partsIndexesCount++; + } + stringToken = strtok(docName, (const char*)delim); + while (stringToken != NULL) + { + IfFailGo(m_pStgdb->m_MiniMd.m_BlobHeap.AddBlob(MetaData::DataBlob((BYTE*)stringToken, (ULONG)strlen(stringToken)), partsIndexesPtr++)); + stringToken = strtok(NULL, (const char*)delim); + partsIndexesCount++; + } + + _ASSERTE(partsIndexesCount == partsCount); + + // build up the documentBlob ::= separator part+ + docNameBlobPtr = docNameBlob; + // put separator + *docNameBlobPtr = delim[0]; + docNameBlobPtr++; + docNameBlobSize++; + // put part+: compress and put each part index + for (ULONG i = 0; i < partsCount; i++) + { + ULONG cnt = CorSigCompressData(partsIndexes[i], docNameBlobPtr); + docNameBlobPtr += cnt; + docNameBlobSize += cnt; + } + + _ASSERTE(docNameBlobSize <= docNameBlobMaxSize); + + // Add record + ULONG docRecord; + DocumentRec* pDocument; + IfFailGo(m_pStgdb->m_MiniMd.AddDocumentRecord(&pDocument, &docRecord)); + // Name column + IfFailGo(m_pStgdb->m_MiniMd.PutBlob(TBL_Document, DocumentRec::COL_Name, pDocument, docNameBlob, docNameBlobSize)); + // HashAlgorithm column + IfFailGo(m_pStgdb->m_MiniMd.PutGuid(TBL_Document, DocumentRec::COL_HashAlgorithm, pDocument, *hashAlg)); + // HashValue column + IfFailGo(m_pStgdb->m_MiniMd.PutBlob(TBL_Document, DocumentRec::COL_Hash, pDocument, hashVal, hashValSize)); + // Language column + IfFailGo(m_pStgdb->m_MiniMd.PutGuid(TBL_Document, DocumentRec::COL_Language, pDocument, *lang)); + + *docMdToken = TokenFromRid(docRecord, mdtDocument); + +ErrExit: + if (docNameBlob != NULL) + delete[] docNameBlob; + + if (partsIndexes != NULL) + delete[] partsIndexes; + + STOP_MD_PERF(DefineDocument); + + END_ENTRYPOINT_NOTHROW; + return hr; +#endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER +} // RegMeta::DefineDocument + +//***************************************************************************** +// Defines sequence points for portable PDB metadata +//***************************************************************************** +STDMETHODIMP RegMeta::DefineSequencePoints( // S_OK or error. + ULONG docRid, // [IN] Document RID. + BYTE *sequencePtsBlob, // [IN] Sequence point blob. + ULONG sequencePtsBlobSize) // [IN] Sequence point blob size. +{ +#ifdef FEATURE_METADATA_EMIT_IN_DEBUGGER + return E_NOTIMPL; +#else //!FEATURE_METADATA_EMIT_IN_DEBUGGER + HRESULT hr = S_OK; + + BEGIN_ENTRYPOINT_NOTHROW; + + LOG((LOGMD, "RegMeta::DefineSequencePoints()\n")); + START_MD_PERF(); + + LOCKWRITE(); + + IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); + + ULONG methodDbgInfoRec; + MethodDebugInformationRec* pMethodDbgInfo; + IfFailGo(m_pStgdb->m_MiniMd.AddMethodDebugInformationRecord(&pMethodDbgInfo, &methodDbgInfoRec)); + // Document column + IfFailGo(m_pStgdb->m_MiniMd.PutCol(TBL_MethodDebugInformation, + MethodDebugInformationRec::COL_Document, pMethodDbgInfo, docRid)); + // Sequence points column + IfFailGo(m_pStgdb->m_MiniMd.PutBlob(TBL_MethodDebugInformation, + MethodDebugInformationRec::COL_SequencePoints, pMethodDbgInfo, sequencePtsBlob, sequencePtsBlobSize)); + +ErrExit: + STOP_MD_PERF(DefineSequencePoints); + + END_ENTRYPOINT_NOTHROW; + return hr; +#endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER +} // RegMeta::DefineSequencePoints + +//***************************************************************************** +// Defines a local scope for portable PDB metadata +//***************************************************************************** +STDMETHODIMP RegMeta::DefineLocalScope( // S_OK or error. + ULONG methodDefRid, // [IN] Method RID. + ULONG importScopeRid, // [IN] Import scope RID. + ULONG firstLocalVarRid, // [IN] First local variable RID (of the continous run). + ULONG firstLocalConstRid, // [IN] First local constant RID (of the continous run). + ULONG startOffset, // [IN] Start offset of the scope. + ULONG length) // [IN] Scope length. +{ +#ifdef FEATURE_METADATA_EMIT_IN_DEBUGGER + return E_NOTIMPL; +#else //!FEATURE_METADATA_EMIT_IN_DEBUGGER + HRESULT hr = S_OK; + + BEGIN_ENTRYPOINT_NOTHROW; + + LOG((LOGMD, "RegMeta::DefineLocalScope()\n")); + START_MD_PERF(); + + LOCKWRITE(); + + IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); + + ULONG localScopeRecord; + LocalScopeRec* pLocalScope; + IfFailGo(m_pStgdb->m_MiniMd.AddLocalScopeRecord(&pLocalScope, &localScopeRecord)); + IfFailGo(m_pStgdb->m_MiniMd.PutCol(TBL_LocalScope, LocalScopeRec::COL_Method, pLocalScope, methodDefRid)); + IfFailGo(m_pStgdb->m_MiniMd.PutCol(TBL_LocalScope, LocalScopeRec::COL_ImportScope, pLocalScope, importScopeRid)); + IfFailGo(m_pStgdb->m_MiniMd.PutCol(TBL_LocalScope, LocalScopeRec::COL_VariableList, pLocalScope, firstLocalVarRid)); + IfFailGo(m_pStgdb->m_MiniMd.PutCol(TBL_LocalScope, LocalScopeRec::COL_ConstantList, pLocalScope, firstLocalConstRid)); + IfFailGo(m_pStgdb->m_MiniMd.PutCol(TBL_LocalScope, LocalScopeRec::COL_StartOffset, pLocalScope, startOffset)); + IfFailGo(m_pStgdb->m_MiniMd.PutCol(TBL_LocalScope, LocalScopeRec::COL_Length, pLocalScope, length)); + + // TODO: Force set sorted tables flag, do this properly + m_pStgdb->m_MiniMd.SetSorted(TBL_LocalScope, true); + +ErrExit: + STOP_MD_PERF(DefineLocalScope); + + END_ENTRYPOINT_NOTHROW; + return hr; +#endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER +} // RegMeta::DefineLocalScope + +//***************************************************************************** +// Defines a local variable for portable PDB metadata +//***************************************************************************** +STDMETHODIMP RegMeta::DefineLocalVariable( // S_OK or error. + USHORT attribute, // [IN] Variable attribute. + USHORT index, // [IN] Variable index (slot). + char *name, // [IN] Variable name. + mdLocalVariable* locVarToken) // [OUT] Token of the defined variable. +{ +#ifdef FEATURE_METADATA_EMIT_IN_DEBUGGER + return E_NOTIMPL; +#else //!FEATURE_METADATA_EMIT_IN_DEBUGGER + HRESULT hr = S_OK; + + BEGIN_ENTRYPOINT_NOTHROW; + + LOG((LOGMD, "RegMeta::DefineLocalVariable(%s)\n", name)); + START_MD_PERF(); + + LOCKWRITE(); + + IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); + + ULONG localVariableRecord; + LocalVariableRec* pLocalVariable; + IfFailGo(m_pStgdb->m_MiniMd.AddLocalVariableRecord(&pLocalVariable, &localVariableRecord)); + IfFailGo(m_pStgdb->m_MiniMd.PutString(TBL_LocalVariable, LocalVariableRec::COL_Name, pLocalVariable, name)); + + pLocalVariable->SetAttributes(attribute); + pLocalVariable->SetIndex(index); + + *locVarToken = TokenFromRid(localVariableRecord, mdtLocalVariable); + +ErrExit: + STOP_MD_PERF(DefineLocalVariable); + + END_ENTRYPOINT_NOTHROW; + return hr; +#endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER +} // RegMeta::DefineLocalVariable +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB + //***************************************************************************** // Create and set a MethodSpec record. //***************************************************************************** diff --git a/src/coreclr/src/md/compiler/helper.cpp b/src/coreclr/src/md/compiler/helper.cpp index 8c8662c8dc5a..a4e7b10c8bed 100644 --- a/src/coreclr/src/md/compiler/helper.cpp +++ b/src/coreclr/src/md/compiler/helper.cpp @@ -369,6 +369,62 @@ HRESULT RegMeta::AddInterfaceImpl( // Return hresult. return hr; } // RegMeta::AddInterfaceImpl +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB +//******************************************************************************* +// Helper to determine path separator and number of separated parts. +// +// Implements internal API code:IMDInternalEmit::GetPathSeparator. +//******************************************************************************* +HRESULT +RegMeta::GetPathSeparator( + char *path, + char *separator, + ULONG *partsCount) +{ + const char delimiters[] = { '\\', '/', '\0'}; + ULONG tokens = 1; + + // try first + char delim = delimiters[0]; + char* charPtr = strchr(path, delim); + + if (charPtr != NULL) + { + // count tokens + while (charPtr != NULL) + { + tokens++; + charPtr = strchr(charPtr + 1, delim); + } + } + else + { + // try second + delim = delimiters[1]; + charPtr = strchr(path, delim); + if (charPtr != NULL) + { + // count tokens + while (charPtr != NULL) + { + tokens++; + charPtr = strchr(charPtr + 1, delim); + } + } + else + { + // delimiter not found - set to \0; + delim = delimiters[2]; + } + } + + *separator = delim; + *partsCount = tokens; + + return S_OK; +} // RegMeta::GetPathSeparator +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB + #endif //FEATURE_METADATA_EMIT && FEATURE_METADATA_INTERNAL_APIS #ifdef FEATURE_METADATA_INTERNAL_APIS diff --git a/src/coreclr/src/md/compiler/regmeta.cpp b/src/coreclr/src/md/compiler/regmeta.cpp index c411346c0d20..11c1974c157d 100644 --- a/src/coreclr/src/md/compiler/regmeta.cpp +++ b/src/coreclr/src/md/compiler/regmeta.cpp @@ -276,6 +276,53 @@ RegMeta::CreateNewMD() return hr; } // RegMeta::CreateNewMD +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB +//***************************************************************************** +// Create new stgdb for portable pdb +//***************************************************************************** +__checkReturn +HRESULT +RegMeta::CreateNewPortablePdbMD() +{ + HRESULT hr = NOERROR; + // TODO: move the constant to a better location + static const char* PDB_VERSION = "PDB v1.0"; + size_t len = strlen(PDB_VERSION) + 1; + + m_OpenFlags = ofWrite; + + // Allocate our m_pStgdb. + _ASSERTE(m_pStgdb == NULL); + IfNullGo(m_pStgdb = new (nothrow) CLiteWeightStgdbRW); + + // Initialize the new, empty database. + + // First tell the new database what sort of metadata to create + m_pStgdb->m_MiniMd.m_OptionValue.m_MetadataVersion = m_OptionValue.m_MetadataVersion; + m_pStgdb->m_MiniMd.m_OptionValue.m_InitialSize = m_OptionValue.m_InitialSize; + IfFailGo(m_pStgdb->InitNew()); + + // Set up the pdb version + m_OptionValue.m_RuntimeVersion = new char[len]; + strcpy_s(m_OptionValue.m_RuntimeVersion, len, PDB_VERSION); + + IfFailGo(m_pStgdb->m_MiniMd.SetOption(&m_OptionValue)); + + if (IsThreadSafetyOn()) + { + m_pSemReadWrite = new (nothrow) UTSemReadWrite(); + IfNullGo(m_pSemReadWrite); + IfFailGo(m_pSemReadWrite->Init()); + m_fOwnSem = true; + + INDEBUG(m_pStgdb->m_MiniMd.Debug_SetLock(m_pSemReadWrite);) + } + +ErrExit: + return hr; +} // RegMeta::CreateNewPortablePdbMD +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB + #endif //FEATURE_METADATA_EMIT //***************************************************************************** @@ -545,6 +592,13 @@ RegMeta::QueryInterface( *ppUnk = (IMetaDataEmit2 *)this; fIsInterfaceRW = true; } +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + else if (riid == IID_IMetaDataEmit3) + { + *ppUnk = (IMetaDataEmit3 *)this; + fIsInterfaceRW = true; + } +#endif else if (riid == IID_IMetaDataAssemblyEmit) { *ppUnk = (IMetaDataAssemblyEmit *)this; diff --git a/src/coreclr/src/md/compiler/regmeta.h b/src/coreclr/src/md/compiler/regmeta.h index 1da1afaf8bdc..82be41bbb472 100644 --- a/src/coreclr/src/md/compiler/regmeta.h +++ b/src/coreclr/src/md/compiler/regmeta.h @@ -148,7 +148,11 @@ class RegMeta : , public IMetaDataInfo #ifdef FEATURE_METADATA_EMIT +#ifndef FEATURE_METADATA_EMIT_PORTABLE_PDB , public IMetaDataEmit2 +#else + , public IMetaDataEmit3 +#endif , public IMetaDataAssemblyEmit #endif @@ -1104,6 +1108,47 @@ class RegMeta : DWORD reserved, // [IN] For future use (e.g. non-type parameters) mdToken rtkConstraints[]); // [IN] Array of type constraints (TypeDef,TypeRef,TypeSpec) +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB +//***************************************************************************** +// IMetaDataEmit3 methods +//***************************************************************************** + STDMETHODIMP GetReferencedTypeSysTables(// S_OK or error. + ULONG64 *refTables, // [OUT] Bit vector of referenced type system metadata tables. + ULONG refTableRows[], // [OUT] Array of number of rows for each referenced type system table. + const ULONG maxTableRowsSize, // [IN] Max size of the rows array. + ULONG *tableRowsSize); // [OUT] Actual size of the rows array. + + STDMETHODIMP DefinePdbStream( // S_OK or error. + PORT_PDB_STREAM* pdbStream); // [IN] Portable pdb stream data. + + STDMETHODIMP DefineDocument( // S_OK or error. + char *docName, // [IN] Document name (string will be tokenized). + GUID *hashAlg, // [IN] Hash algorithm GUID. + BYTE *hashVal, // [IN] Hash value. + ULONG hashValSize, // [IN] Hash value size. + GUID *lang, // [IN] Language GUID. + mdDocument *docMdToken); // [OUT] Token of the defined document. + + STDMETHODIMP DefineSequencePoints( // S_OK or error. + ULONG docRid, // [IN] Document RID. + BYTE *sequencePtsBlob, // [IN] Sequence point blob. + ULONG sequencePtsBlobSize); // [IN] Sequence point blob size. + + STDMETHODIMP DefineLocalScope( // S_OK or error. + ULONG methodDefRid, // [IN] Method RID. + ULONG importScopeRid, // [IN] Import scope RID. + ULONG firstLocalVarRid, // [IN] First local variable RID (of the continous run). + ULONG firstLocalConstRid, // [IN] First local constant RID (of the continous run). + ULONG startOffset, // [IN] Start offset of the scope. + ULONG length); // [IN] Scope length. + + STDMETHODIMP DefineLocalVariable( // S_OK or error. + USHORT attribute, // [IN] Variable attribute. + USHORT index, // [IN] Variable index (slot). + char *name, // [IN] Variable name. + mdLocalVariable *locVarToken); // [OUT] Token of the defined variable. +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB + //***************************************************************************** // IMetaDataAssemblyEmit //***************************************************************************** @@ -1255,6 +1300,13 @@ class RegMeta : STDMETHOD(SetMDUpdateMode)( ULONG updateMode, ULONG *pPreviousUpdateMode); +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + STDMETHODIMP GetPathSeparator( // S_OK or error. + char *path, // [IN] Path string to search. + char *separator, // [OUT] Separator used in path string, NULL if none. + ULONG *partsCount); // [OUT] Number of parts separated by the separator. +#endif + //***************************************************************************** // IMetaDataHelper //***************************************************************************** @@ -1561,6 +1613,10 @@ class RegMeta : HRESULT CreateNewMD(); +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + HRESULT CreateNewPortablePdbMD(); +#endif + HRESULT OpenExistingMD( LPCWSTR szDatabase, // Name of database. void *pbData, // Data to open on top of, 0 default. @@ -1924,6 +1980,9 @@ class RegMeta : #undef MiniMdTable #define MiniMdTable(x) HRESULT Validate##x(RID rid); MiniMdTables() +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + PortablePdbMiniMdTables() +#endif // Validate a record in a generic sense using Meta-Meta data. STDMETHODIMP ValidateRecord(ULONG ixTbl, ULONG ulRow); diff --git a/src/coreclr/src/md/enc/CMakeLists.txt b/src/coreclr/src/md/enc/CMakeLists.txt index bf209317d032..14ed0a267fae 100644 --- a/src/coreclr/src/md/enc/CMakeLists.txt +++ b/src/coreclr/src/md/enc/CMakeLists.txt @@ -8,6 +8,7 @@ set(MDRUNTIMERW_SOURCES stgtiggerstorage.cpp stgtiggerstream.cpp mdinternalrw.cpp + pdbheap.cpp ) set(MDRUNTIMERW_HEADERS @@ -29,6 +30,9 @@ set(MDRUNTIMERW_HEADERS ../inc/metamodel.h ../inc/metamodelro.h ../inc/metamodelrw.h + ../inc/pdbheap.h + ../inc/portablepdbmdds.h + ../inc/portablepdbmdi.h ../inc/rwutil.h ../inc/stgio.h ../inc/stgtiggerstorage.h @@ -59,3 +63,7 @@ target_precompile_header(TARGET mdruntimerw-dbi HEADER stdafx.h) add_library_clr(mdruntimerw_crossgen ${MDRUNTIMERW_SOURCES}) set_target_properties(mdruntimerw_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE) target_precompile_header(TARGET mdruntimerw_crossgen HEADER stdafx.h) + +add_library_clr(mdruntimerw_ppdb ${MDRUNTIMERW_SOURCES}) +target_compile_definitions(mdruntimerw_ppdb PRIVATE FEATURE_METADATA_EMIT_ALL FEATURE_METADATA_EMIT_PORTABLE_PDB) +target_precompile_header(TARGET mdruntimerw_ppdb HEADER stdafx.h) \ No newline at end of file diff --git a/src/coreclr/src/md/enc/liteweightstgdbrw.cpp b/src/coreclr/src/md/enc/liteweightstgdbrw.cpp index 5e5fbe9314ff..236c051706cd 100644 --- a/src/coreclr/src/md/enc/liteweightstgdbrw.cpp +++ b/src/coreclr/src/md/enc/liteweightstgdbrw.cpp @@ -126,6 +126,13 @@ CLiteWeightStgdbRW::~CLiteWeightStgdbRW() { delete [] m_wszFileName; } +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + if (m_pPdbHeap != NULL) + { + delete m_pPdbHeap; + m_pPdbHeap = NULL; + } +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB } //***************************************************************************** @@ -506,7 +513,9 @@ HRESULT CLiteWeightStgdbRW::InitNew() { InitializeLogging(); LOG((LF_METADATA, LL_INFO10, "Metadata logging enabled\n")); - +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + m_pPdbHeap = new PdbHeap(); +#endif //@FUTURE: should probably init the pools here instead of in the MiniMd. return m_MiniMd.InitNew(); } @@ -553,6 +562,24 @@ HRESULT CLiteWeightStgdbRW::GetSaveSize(// S_OK or error. } } +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + // [IMPORTANT]: + // Apparently, string pool must exist in the portable PDB metadata in order to be recognized + // by the VS debugger. For this purpose, we are adding a dummy " " value in cases when + // the string pool is empty. + // Interestingly enough, similar is done for user string pool (check above #549). + // TODO: do this in a more clever way, and check if/why/when this is necessary + if (m_MiniMd.m_StringHeap.GetUnalignedSize() <= 1) + { + if (!IsENCDelta(m_MiniMd.m_OptionValue.m_UpdateMode) && + !m_MiniMd.IsMinimalDelta()) + { + UINT32 nIndex_Ignore; + IfFailGo(m_MiniMd.m_StringHeap.AddString(" ", &nIndex_Ignore)); + } + } +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB + // If we're saving a delta metadata, figure out how much space it will take to // save the minimal metadata stream (used only to identify that we have a delta // metadata... nothing should be in that stream. @@ -614,6 +641,10 @@ HRESULT CLiteWeightStgdbRW::GetSaveSize(// S_OK or error. cbTotal += cbSize; IfFailGo(GetPoolSaveSize(BLOB_POOL_STREAM, MDPoolBlobs, &cbSize)); cbTotal += cbSize; +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + IfFailGo(GetPoolSaveSize(PDB_STREAM, NULL, &cbSize)); + cbTotal += cbSize; +#endif // Finally, ask the storage system to add fixed overhead it needs for the // file format. The overhead of each stream has already be calculated as @@ -655,31 +686,51 @@ CLiteWeightStgdbRW::GetPoolSaveSize( { UINT32 cbSize = 0; // Size of pool data. UINT32 cbStream; // Size of just the stream. - HRESULT hr; + HRESULT hr = S_OK; *pcbSaveSize = 0; - // If there is no data, then don't bother. - if (m_MiniMd.IsPoolEmpty(iPool)) - return (S_OK); +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + // Treat PDB stream differently since we are not using StgPools + if (wcscmp(PDB_STREAM, szHeap) == 0) + { + if (m_pPdbHeap && !m_pPdbHeap->IsEmpty()) + { + cbSize = m_pPdbHeap->GetSize(); + IfFailGo(AddStreamToList(cbSize, szHeap)); + IfFailGo(TiggerStorage::GetStreamSaveSize(szHeap, cbSize, &cbSize)); + *pcbSaveSize = cbSize; + } + else + { + goto ErrExit; + } + } + else +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB + { + // If there is no data, then don't bother. + if (m_MiniMd.IsPoolEmpty(iPool)) + return (S_OK); - // Ask the pool to size its data. - IfFailGo(m_MiniMd.GetPoolSaveSize(iPool, &cbSize)); - cbStream = cbSize; + // Ask the pool to size its data. + IfFailGo(m_MiniMd.GetPoolSaveSize(iPool, &cbSize)); + cbStream = cbSize; - // Add this item to the save list. - IfFailGo(AddStreamToList(cbSize, szHeap)); + // Add this item to the save list. + IfFailGo(AddStreamToList(cbSize, szHeap)); - // Ask the storage system to add stream fixed overhead. - IfFailGo(TiggerStorage::GetStreamSaveSize(szHeap, cbSize, &cbSize)); + // Ask the storage system to add stream fixed overhead. + IfFailGo(TiggerStorage::GetStreamSaveSize(szHeap, cbSize, &cbSize)); - // Log the size info. - LOG((LF_METADATA, LL_INFO10, "Metadata: GetSaveSize for %ls: %d data, %d total.\n", - szHeap, cbStream, cbSize)); + // Log the size info. + LOG((LF_METADATA, LL_INFO10, "Metadata: GetSaveSize for %ls: %d data, %d total.\n", + szHeap, cbStream, cbSize)); - // Give the size of the pool to the caller's total. - *pcbSaveSize = cbSize; + // Give the size of the pool to the caller's total. + *pcbSaveSize = cbSize; + } ErrExit: return hr; @@ -896,6 +947,9 @@ HRESULT CLiteWeightStgdbRW::SaveToStorage( IfFailGo(SavePool(US_BLOB_POOL_STREAM, pStorage, MDPoolUSBlobs)); IfFailGo(SavePool(GUID_POOL_STREAM, pStorage, MDPoolGuids)); IfFailGo(SavePool(BLOB_POOL_STREAM, pStorage, MDPoolBlobs)); +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + IfFailGo(SavePool(PDB_STREAM, pStorage, NULL)); +#endif // Write the header to disk. OptionValue ov; @@ -929,17 +983,37 @@ HRESULT CLiteWeightStgdbRW::SavePool( // Return code. int iPool) // The pool to save. { IStream *pIStream=0; // For writing. - HRESULT hr; + HRESULT hr = S_OK; - // If there is no data, then don't bother. - if (m_MiniMd.IsPoolEmpty(iPool)) - return (S_OK); +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + // Treat PDB stream differently since we are not using StgPools + if (wcscmp(PDB_STREAM, szName) == 0) + { + if (m_pPdbHeap && !m_pPdbHeap->IsEmpty()) + { + IfFailGo(pStorage->CreateStream(szName, + STGM_DIRECT | STGM_READWRITE | STGM_SHARE_EXCLUSIVE, + 0, 0, &pIStream)); + IfFailGo(m_pPdbHeap->SaveToStream(pIStream)); + } + else + { + goto ErrExit; + } + } + else +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB + { + // If there is no data, then don't bother. + if (m_MiniMd.IsPoolEmpty(iPool)) + return (S_OK); - // Create the new stream to hold this table and save it. - IfFailGo(pStorage->CreateStream(szName, + // Create the new stream to hold this table and save it. + IfFailGo(pStorage->CreateStream(szName, STGM_DIRECT | STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &pIStream)); - IfFailGo(m_MiniMd.SavePoolToStream(iPool, pIStream)); + IfFailGo(m_MiniMd.SavePoolToStream(iPool, pIStream)); + } ErrExit: if (pIStream) diff --git a/src/coreclr/src/md/enc/metamodelrw.cpp b/src/coreclr/src/md/enc/metamodelrw.cpp index ac0e400be4e2..c48dc5a36b31 100644 --- a/src/coreclr/src/md/enc/metamodelrw.cpp +++ b/src/coreclr/src/md/enc/metamodelrw.cpp @@ -146,6 +146,22 @@ g_TblSizeInfo[MDSizeIndex_Count][TBL_COUNT] = 0, // GenericParam 0, // MethodSpec 0, // GenericParamConstraint +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + /* Dummy tables to fill the gap to 0x30 */ + 0, // Dummy1 + 0, // Dummy2 + 0, // Dummy3 + /* Actual portable PDB tables */ + 0, // Document + 0, // MethodDebugInformation + 0, // LocalScope + 0, // LocalVariable + 0, // LocalConstant + 0, // ImportScope + // TODO: + // 0, // StateMachineMethod + // 0, // CustomDebugInformation +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB }, // Minimal table sizes (code:MDSizeIndex_Minimal). { @@ -194,6 +210,22 @@ g_TblSizeInfo[MDSizeIndex_Count][TBL_COUNT] = 0, // GenericParam 0, // MethodSpec 0, // GenericParamConstraint +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + /* Dummy tables to fill the gap to 0x30 */ + 0, // Dummy1 + 0, // Dummy2 + 0, // Dummy3 + /* Actual portable PDB tables */ + 0, // Document + 0, // MethodDebugInformation + 0, // LocalScope + 0, // LocalVariable + 0, // LocalConstant + 0, // ImportScope + // TODO: + // 0, // StateMachineMethod + // 0, // CustomDebugInformation +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB } }; // g_TblSizeInfo @@ -252,6 +284,22 @@ const TblIndex g_TblIndex[TBL_COUNT] = {(ULONG) -1, (ULONG) -1, mdtGenericParam}, // GenericParam {(ULONG) -1, (ULONG) -1, mdtMethodSpec}, // MethodSpec {(ULONG) -1, (ULONG) -1, mdtGenericParamConstraint},// GenericParamConstraint +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + /* Dummy tables to fill the gap to 0x30 */ + {(ULONG)-1, (ULONG)-1, (ULONG)-1}, // Dummy1 + {(ULONG)-1, (ULONG)-1, (ULONG)-1}, // Dummy2 + {(ULONG)-1, (ULONG)-1, (ULONG)-1}, // Dummy3 + /* Actual portable PDB tables */ + {(ULONG)-1, (ULONG)-1, mdtDocument}, // Document + {(ULONG)-1, (ULONG)-1, mdtMethodDebugInformation},// MethodDebugInformation + {(ULONG)-1, (ULONG)-1, mdtLocalScope}, // LocalScope + {(ULONG)-1, (ULONG)-1, mdtLocalVariable}, // LocalVariable + {(ULONG)-1, (ULONG)-1, mdtLocalConstant}, // LocalConstant + {(ULONG) -1, (ULONG) -1, mdtImportScope}, // ImportScope + // TODO: + // {(ULONG) -1, (ULONG) -1, mdtStateMachineMethod},// StateMachineMethod + // {(ULONG) -1, (ULONG) -1, mdtCustomDebugInformation},// CustomDebugInformation +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB }; ULONG CMiniMdRW::m_TruncatedEncTables[] = diff --git a/src/coreclr/src/md/enc/pdbheap.cpp b/src/coreclr/src/md/enc/pdbheap.cpp new file mode 100644 index 000000000000..8305986f8c0c --- /dev/null +++ b/src/coreclr/src/md/enc/pdbheap.cpp @@ -0,0 +1,73 @@ +// 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. + +#include "stdafx.h" +#include "pdbheap.h" + +PdbHeap::PdbHeap() : m_data(NULL), m_size(0) +{ +} + +PdbHeap::~PdbHeap() +{ + if (m_data != NULL) + { + delete[] m_data; + m_data = NULL; + } +} + +__checkReturn +HRESULT PdbHeap::SetData(PORT_PDB_STREAM* data) +{ + m_size = sizeof(data->id) + + sizeof(data->entryPoint) + + sizeof(data->referencedTypeSystemTables) + + (sizeof(ULONG) * data->typeSystemTableRowsSize); + m_data = new BYTE[m_size]; + + ULONG offset = 0; + if (memcpy_s(m_data + offset, m_size, &data->id, sizeof(data->id))) + return E_FAIL; + offset += sizeof(data->id); + + if (memcpy_s(m_data + offset, m_size, &data->entryPoint, sizeof(data->entryPoint))) + return E_FAIL; + offset += sizeof(data->entryPoint); + + if (memcpy_s(m_data + offset, m_size, &data->referencedTypeSystemTables, sizeof(data->referencedTypeSystemTables))) + return E_FAIL; + offset += sizeof(data->referencedTypeSystemTables); + + if (memcpy_s(m_data + offset, m_size, data->typeSystemTableRows, sizeof(ULONG) * data->typeSystemTableRowsSize)) + return E_FAIL; + offset += sizeof(ULONG) * data->typeSystemTableRowsSize; + + _ASSERTE(offset == m_size); + + return S_OK; +} + +__checkReturn +HRESULT PdbHeap::SaveToStream(IStream* stream) +{ + HRESULT hr = S_OK; + if (!IsEmpty()) + { + ULONG written = 0; + hr = stream->Write(m_data, m_size, &written); + _ASSERTE(m_size == written); + } + return hr; +} + +BOOL PdbHeap::IsEmpty() +{ + return m_size == 0; +} + +ULONG PdbHeap::GetSize() +{ + return m_size; +} diff --git a/src/coreclr/src/md/hotdata/CMakeLists.txt b/src/coreclr/src/md/hotdata/CMakeLists.txt index 6f7a2891d20c..03430e292c75 100644 --- a/src/coreclr/src/md/hotdata/CMakeLists.txt +++ b/src/coreclr/src/md/hotdata/CMakeLists.txt @@ -44,3 +44,7 @@ if(CLR_CMAKE_HOST_WIN32) add_library_clr(mdhotdata-staticcrt ${MDHOTDATA_SOURCES}) target_precompile_header(TARGET mdhotdata-staticcrt HEADER external.h) endif(CLR_CMAKE_HOST_WIN32) + +add_library_clr(mdhotdata_ppdb ${MDHOTDATA_SOURCES}) +target_compile_definitions(mdhotdata_ppdb PRIVATE FEATURE_METADATA_EMIT_PORTABLE_PDB) +target_precompile_header(TARGET mdhotdata_ppdb HEADER external.h) \ No newline at end of file diff --git a/src/coreclr/src/md/inc/liteweightstgdb.h b/src/coreclr/src/md/inc/liteweightstgdb.h index 1e35df09cccb..062dee00a591 100644 --- a/src/coreclr/src/md/inc/liteweightstgdb.h +++ b/src/coreclr/src/md/inc/liteweightstgdb.h @@ -21,6 +21,9 @@ class StgIO; #include "mdcommon.h" +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB +#include "pdbheap.h" +#endif #ifdef _PREFAST_ #pragma warning(push) @@ -109,6 +112,9 @@ class CLiteWeightStgdbRW : public CLiteWeightStgdb m_dwPEKind = (DWORD)(-1); m_dwDatabaseLFS = 0; m_dwDatabaseLFT = 0; +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + m_pPdbHeap = NULL; +#endif } ~CLiteWeightStgdbRW(); @@ -250,7 +256,9 @@ class CLiteWeightStgdbRW : public CLiteWeightStgdb DWORD m_dwDatabaseLFT; // Low bytes of the database file's last write time DWORD m_dwDatabaseLFS; // Low bytes of the database file's size StgIO * m_pStgIO; // For file i/o. - +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + PdbHeap *m_pPdbHeap; +#endif }; // class CLiteWeightStgdbRW #endif // __LiteWeightStgdb_h__ diff --git a/src/coreclr/src/md/inc/mdcolumndescriptors.h b/src/coreclr/src/md/inc/mdcolumndescriptors.h index 21a46afec72b..496aa6c33e28 100644 --- a/src/coreclr/src/md/inc/mdcolumndescriptors.h +++ b/src/coreclr/src/md/inc/mdcolumndescriptors.h @@ -48,3 +48,19 @@ static const BYTE s_NestedClassCol[]; static const BYTE s_GenericParamCol[]; static const BYTE s_MethodSpecCol[]; static const BYTE s_GenericParamConstraintCol[]; +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB +// Dummy descriptors to fill the gap to 0x30 +static const BYTE s_Dummy1Col[]; +static const BYTE s_Dummy2Col[]; +static const BYTE s_Dummy3Col[]; +// Actual portable PDB tables descriptors +static const BYTE s_DocumentCol[]; +static const BYTE s_MethodDebugInformationCol[]; +static const BYTE s_LocalScopeCol[]; +static const BYTE s_LocalVariableCol[]; +static const BYTE s_LocalConstantCol[]; +static const BYTE s_ImportScopeCol[]; +// TODO: +// static const BYTE s_StateMachineMethodCol[]; +// static const BYTE s_CustomDebugInformationCol[]; +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB diff --git a/src/coreclr/src/md/inc/metamodel.h b/src/coreclr/src/md/inc/metamodel.h index c48a69872488..d06932e10110 100644 --- a/src/coreclr/src/md/inc/metamodel.h +++ b/src/coreclr/src/md/inc/metamodel.h @@ -21,6 +21,11 @@ #include "../datablob.h" #include "../debug_metadata.h" +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB +#include "portablepdbmdds.h" +#include "portablepdbmdi.h" +#endif + #define ALLOCATED_MEMORY_MARKER 0xff // Version numbers for metadata format. @@ -1595,6 +1600,9 @@ template class CMiniMdTemplate : public CMiniMdBase #undef MiniMdTable #define MiniMdTable(tbl) ULONG getCount##tbl##s() { return _TBLCNT(tbl); } MiniMdTables(); +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + PortablePdbMiniMdTables(); +#endif // macro misspells some names. ULONG getCountProperties() {return getCountPropertys();} ULONG getCountMethodSemantics() {return getCountMethodSemanticss();} @@ -1607,6 +1615,9 @@ template class CMiniMdTemplate : public CMiniMdBase #define MiniMdTable(tbl) __checkReturn HRESULT Get##tbl##Record(RID rid, tbl##Rec **ppRecord) { \ return getRow(TBL_##tbl, rid, reinterpret_cast(ppRecord)); } MiniMdTables(); +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + PortablePdbMiniMdTables(); +#endif //************************************************************************* // These are specialized searching functions. Mostly generic (ie, find diff --git a/src/coreclr/src/md/inc/metamodelrw.h b/src/coreclr/src/md/inc/metamodelrw.h index 87917890da83..51cb0707c891 100644 --- a/src/coreclr/src/md/inc/metamodelrw.h +++ b/src/coreclr/src/md/inc/metamodelrw.h @@ -381,6 +381,18 @@ class CMiniMdRW : public CMiniMdTemplate AddTblRecord(MethodSpec) AddTblRecord(GenericParamConstraint) +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + AddTblRecord(Document) + AddTblRecord(MethodDebugInformation) + AddTblRecord(LocalScope) + AddTblRecord(LocalVariable) + AddTblRecord(LocalConstant) + AddTblRecord(ImportScope) + // TODO: + // AddTblRecord(StateMachineMethod) + // AddTblRecord(CustomDebugInformation) +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB + // Specialized AddXxxToYyy() functions. __checkReturn HRESULT AddMethodToTypeDef(RID td, RID md); __checkReturn HRESULT AddFieldToTypeDef(RID td, RID md); diff --git a/src/coreclr/src/md/inc/pdbheap.h b/src/coreclr/src/md/inc/pdbheap.h new file mode 100644 index 000000000000..0f5d25a91b20 --- /dev/null +++ b/src/coreclr/src/md/inc/pdbheap.h @@ -0,0 +1,34 @@ +// 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. + +#ifndef _PDBHEAP_H_ +#define _PDBHEAP_H_ + +#if _MSC_VER >= 1100 +#pragma once +#endif + +#include "metamodel.h" +#include "portablepdbmdds.h" + +/* Simple storage class (similar to StgPool) holding pdbstream data +** for portable PDB metadata. +*/ +class PdbHeap +{ +public: + PdbHeap(); + ~PdbHeap(); + + __checkReturn HRESULT SetData(PORT_PDB_STREAM* data); + __checkReturn HRESULT SaveToStream(IStream* stream); + BOOL IsEmpty(); + ULONG GetSize(); + +private: + BYTE* m_data; + ULONG m_size; +}; + +#endif diff --git a/src/coreclr/src/md/inc/portablepdbmdds.h b/src/coreclr/src/md/inc/portablepdbmdds.h new file mode 100644 index 000000000000..ddaa8a8c74bd --- /dev/null +++ b/src/coreclr/src/md/inc/portablepdbmdds.h @@ -0,0 +1,79 @@ +// 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. + +/***************************************************************************** + ** ** + ** portablepdbmdds.h - contains data structures and types used for ** + ** portable PDB metadata generation. ** + ** ** + *****************************************************************************/ + +#ifndef _PORTABLEPDBMDDS_H_ +#define _PORTABLEPDBMDDS_H_ + +#if _MSC_VER >= 1100 +#pragma once +#endif + +#include "corhdr.h" + +//------------------------------------- +//--- PDB stream data structure +//------------------------------------- +typedef struct _PDB_ID +{ + GUID pdbGuid; + ULONG pdbTimeStamp; +} PDB_ID; + +typedef struct _PORT_PDB_STREAM +{ + PDB_ID id; + mdMethodDef entryPoint; + ULONG64 referencedTypeSystemTables; + ULONG *typeSystemTableRows; + ULONG typeSystemTableRowsSize; +} PORT_PDB_STREAM; + +//------------------------------------- +//--- Portable PDB table tokens +//------------------------------------- + +// PPdb token definitions +typedef mdToken mdDocument; +typedef mdToken mdMethodDebugInformation; +typedef mdToken mdLocalScope; +typedef mdToken mdLocalVariable; +typedef mdToken mdLocalConstant; +typedef mdToken mdImportScope; +// TODO: +// typedef mdToken mdStateMachineMethod; +// typedef mdToken mdCustomDebugInformation; + +// PPdb token tags +typedef enum PPdbCorTokenType +{ + mdtDocument = 0x30000000, + mdtMethodDebugInformation = 0x31000000, + mdtLocalScope = 0x32000000, + mdtLocalVariable = 0x33000000, + mdtLocalConstant = 0x34000000, + mdtImportScope = 0x35000000, + // TODO: + // mdtStateMachineMethod = 0x36000000, + // mdtCustomDebugInformation = 0x37000000, +} PPdbCorTokenType; + +// PPdb Nil tokens +#define mdDocumentNil ((mdDocument)mdtDocument) +#define mdMethodDebugInformationNil ((mdMethodDebugInformation)mdtMethodDebugInformation) +#define mdLocalScopeNil ((mdLocalScope)mdtLocalScope) +#define mdLocalVariableNil ((mdLocalVariable)mdtLocalVariable) +#define mdLocalConstantNil ((mdLocalConstant)mdtLocalConstant) +#define mdImportScopeNil ((mdImportScope)mdtImportScope) +// TODO: +// #define mdStateMachineMethodNil ((mdStateMachineMethod)mdtStateMachineMethod) +// #define mdCustomDebugInformationNil ((mdCustomDebugInformation)mdtCustomDebugInformation) + +#endif // _PORTABLEPDBMDDS_H_ diff --git a/src/coreclr/src/md/inc/portablepdbmdi.h b/src/coreclr/src/md/inc/portablepdbmdi.h new file mode 100644 index 000000000000..26a1cb916f43 --- /dev/null +++ b/src/coreclr/src/md/inc/portablepdbmdi.h @@ -0,0 +1,97 @@ +// 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. + +/***************************************************************************** + ** ** + ** portablepdbmdi.h - contains COM interface definitions for portable PDB ** + ** metadata generation. ** + ** ** + *****************************************************************************/ + +#ifndef _PORTABLEPDBMDI_H_ +#define _PORTABLEPDBMDI_H_ + +#if _MSC_VER >= 1100 +#pragma once +#endif + +#include "cor.h" +#include "portablepdbmdds.h" + +#ifdef __cplusplus +extern "C" { +#endif + +//------------------------------------- +//--- IMetaDataEmit3 +//------------------------------------- +// {1a5abcd7-854e-4f07-ace4-3f09e6092939} +EXTERN_GUID(IID_IMetaDataEmit3, 0x1a5abcd7, 0x854e, 0x4f07, 0xac, 0xe4, 0x3f, 0x09, 0xe6, 0x09, 0x29, 0x39); + +//--- +#undef INTERFACE +#define INTERFACE IMetaDataEmit3 +DECLARE_INTERFACE_(IMetaDataEmit3, IMetaDataEmit2) +{ + + STDMETHOD(GetReferencedTypeSysTables)( // S_OK or error. + ULONG64 *refTables, // [OUT] Bit vector of referenced type system metadata tables. + ULONG refTableRows[], // [OUT] Array of number of rows for each referenced type system table. + const ULONG maxTableRowsSize, // [IN] Max size of the rows array. + ULONG *tableRowsSize) PURE; // [OUT] Actual size of the rows array. + + STDMETHOD(DefinePdbStream)( // S_OK or error. + PORT_PDB_STREAM *pdbStream) PURE; // [IN] Portable pdb stream data. + + STDMETHOD(DefineDocument)( // S_OK or error. + char *docName, // [IN] Document name (string will be tokenized). + GUID *hashAlg, // [IN] Hash algorithm GUID. + BYTE *hashVal, // [IN] Hash value. + ULONG hashValSize, // [IN] Hash value size. + GUID *lang, // [IN] Language GUID. + mdDocument *docMdToken) PURE; // [OUT] Token of the defined document. + + STDMETHOD(DefineSequencePoints)( // S_OK or error. + ULONG docRid, // [IN] Document RID. + BYTE *sequencePtsBlob, // [IN] Sequence point blob. + ULONG sequencePtsBlobSize) PURE; // [IN] Sequence point blob size. + + STDMETHOD(DefineLocalScope)( // S_OK or error. + ULONG methodDefRid, // [IN] Method RID. + ULONG importScopeRid, // [IN] Import scope RID. + ULONG firstLocalVarRid, // [IN] First local variable RID (of the continous run). + ULONG firstLocalConstRid, // [IN] First local constant RID (of the continous run). + ULONG startOffset, // [IN] Start offset of the scope. + ULONG length) PURE; // [IN] Scope length. + + STDMETHOD(DefineLocalVariable)( // S_OK or error. + USHORT attribute, // [IN] Variable attribute. + USHORT index, // [IN] Variable index (slot). + char *name, // [IN] Variable name. + mdLocalVariable *locVarToken) PURE; // [OUT] Token of the defined variable. +}; + +//------------------------------------- +//--- IMetaDataDispenserEx2 +//------------------------------------- + +// {23aaef0d-49bf-43f0-9744-1c3e9c56322a} +EXTERN_GUID(IID_IMetaDataDispenserEx2, 0x23aaef0d, 0x49bf, 0x43f0, 0x97, 0x44, 0x1c, 0x3e, 0x9c, 0x56, 0x32, 0x2a); + +#undef INTERFACE +#define INTERFACE IMetaDataDispenserEx2 +DECLARE_INTERFACE_(IMetaDataDispenserEx2, IMetaDataDispenserEx) +{ + STDMETHOD(DefinePortablePdbScope)( // Return code. + REFCLSID rclsid, // [IN] What version to create. + DWORD dwCreateFlags, // [IN] Flags on the create. + REFIID riid, // [IN] The interface desired. + IUnknown * *ppIUnk) PURE; // [OUT] Return interface on success. +}; + +#ifdef __cplusplus +} +#endif + +#endif // _PORTABLEPDBMDI_H_ diff --git a/src/coreclr/src/md/runtime/CMakeLists.txt b/src/coreclr/src/md/runtime/CMakeLists.txt index 99b8bec54958..5753e655abf9 100644 --- a/src/coreclr/src/md/runtime/CMakeLists.txt +++ b/src/coreclr/src/md/runtime/CMakeLists.txt @@ -29,6 +29,9 @@ set(MDRUNTIME_HEADERS ../inc/mdcolumndescriptors.h ../inc/metamodel.h ../inc/metamodelro.h + ../inc/pdbheap.h + ../inc/portablepdbmdds.h + ../inc/portablepdbmdi.h ../inc/recordpool.h metamodelcolumndefs.h mdinternaldisp.h @@ -57,3 +60,7 @@ target_precompile_header(TARGET mdruntime-dbi HEADER stdafx.h) add_library_clr(mdruntime_crossgen ${MDRUNTIME_SOURCES}) set_target_properties(mdruntime_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE) target_precompile_header(TARGET mdruntime_crossgen HEADER stdafx.h) + +add_library_clr(mdruntime_ppdb ${MDRUNTIME_SOURCES}) +target_compile_definitions(mdruntime_ppdb PRIVATE FEATURE_METADATA_EMIT_ALL FEATURE_METADATA_EMIT_PORTABLE_PDB) +target_precompile_header(TARGET mdruntime_ppdb HEADER stdafx.h) \ No newline at end of file diff --git a/src/coreclr/src/md/runtime/mdcolumndescriptors.cpp b/src/coreclr/src/md/runtime/mdcolumndescriptors.cpp index 3806c93ca956..3b795df80973 100644 --- a/src/coreclr/src/md/runtime/mdcolumndescriptors.cpp +++ b/src/coreclr/src/md/runtime/mdcolumndescriptors.cpp @@ -163,6 +163,40 @@ const BYTE CMiniMdBase::s_MethodSpecCol[] = {2, const BYTE CMiniMdBase::s_GenericParamConstraintCol[] = {1, 42,0,2, 64,2,2, }; +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB +// Dummy descriptors to fill the gap to 0x30 +const BYTE CMiniMdBase::s_Dummy1Col[] = { NULL }; +const BYTE CMiniMdBase::s_Dummy2Col[] = { NULL }; +const BYTE CMiniMdBase::s_Dummy3Col[] = { NULL }; +// Actual portable PDB tables descriptors +const BYTE CMiniMdBase::s_DocumentCol[] = { 2, + 103,0,2, 102,2,2, 103,4,2, 102,6,2, + 103,0,4, 102,4,2, 103,6,2, 102,8,4, +}; +const BYTE CMiniMdBase::s_MethodDebugInformationCol[] = { 2, + 48,0,2, 103,2,2, + 48,0,2, 103,2,4, +}; +const BYTE CMiniMdBase::s_LocalScopeCol[] = { 1, + 6,0,2, 53,2,2, 51,4,2, 52,6,2, 99,8,4, 99,12,4 +}; +const BYTE CMiniMdBase::s_LocalVariableCol[] = { 2, + 97,0,2, 97,2,2, 101,4,2, + 97,0,2, 97,2,2, 101,4,4 +}; +const BYTE CMiniMdBase::s_LocalConstantCol[] = { 3, + 101,0,2, 103,2,2, + 101,0,4, 103,4,4, + 101,0,4, 103,4,2, +}; +const BYTE CMiniMdBase::s_ImportScopeCol[] = { 2, + 53,0,2, 103,2,2, + 53,0,2, 103,2,4 +}; +// TODO: +// const BYTE CMiniMdBase::s_StateMachineMethodCol[] = {}; +// const BYTE CMiniMdBase::s_CustomDebugInformationCol[] = {}; +#endif // #ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB const BYTE* const CMiniMdBase::s_TableColumnDescriptors[] = { s_ModuleCol, @@ -209,5 +243,21 @@ s_ManifestResourceCol, s_NestedClassCol, s_GenericParamCol, s_MethodSpecCol, -s_GenericParamConstraintCol +s_GenericParamConstraintCol, +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB +// Dummy descriptors to fill the gap to 0x30 +s_Dummy1Col, +s_Dummy2Col, +s_Dummy3Col, +// Actual portable PDB tables descriptors +s_DocumentCol, +s_MethodDebugInformationCol, +s_LocalScopeCol, +s_LocalVariableCol, +s_LocalConstantCol, +s_ImportScopeCol, +// TODO: +// s_StateMachineMethodCol, +// s_CustomDebugInformationCol, +#endif // #ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB }; diff --git a/src/coreclr/src/md/runtime/metamodel.cpp b/src/coreclr/src/md/runtime/metamodel.cpp index 84c091678c38..cd1ccde9cc36 100644 --- a/src/coreclr/src/md/runtime/metamodel.cpp +++ b/src/coreclr/src/md/runtime/metamodel.cpp @@ -75,6 +75,16 @@ #undef SCHEMA_ITEM_CDTKN #undef SCHEMA_TABLE_END +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB +//Dummy tables to fill the gap to 0x30 +static CMiniColDef rDummy1Cols[] = { { 0 } }; +static CMiniColDef rDummy2Cols[] = { { 0 } }; +static CMiniColDef rDummy3Cols[] = { { 0 } }; +static const char* rDummy1ColNames[] = { "" }; +static const char* rDummy2ColNames[] = { "" }; +static const char* rDummy3ColNames[] = { "" }; +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB + //----------------------------------------------------------------------------- // End of column definitions. //----------------------------------------------------------------------------- @@ -91,6 +101,9 @@ const CCodedTokenDef g_CodedTokens [] = { #define MiniMdTable(x) { { r##x##Cols, lengthof(r##x##Cols), x##Rec::COL_KEY, 0 }, r##x##ColNames, #x}, const CMiniTableDefEx g_Tables[TBL_COUNT] = { MiniMdTables() +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + PortablePdbMiniMdTables() +#endif }; // Define a table descriptor for the obsolete v1.0 GenericParam table definition. @@ -104,6 +117,9 @@ const CMiniTableDefEx g_Table_GenericParamV1_1 = { { rGenericParamV1_1Cols, leng #define MiniMdTable(x) { TBL_COUNT, 0 }, TblCol g_PtrTableIxs[TBL_COUNT] = { MiniMdTables() +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + PortablePdbMiniMdTables() +#endif }; //***************************************************************************** @@ -440,6 +456,9 @@ CMiniMdBase::CMiniMdBase() m_TableDefs[TBL_##tbl] = g_Tables[TBL_##tbl].m_Def; \ m_TableDefs[TBL_##tbl].m_pColDefs = BYTEARRAY_TO_COLDES(s_##tbl##Col); MiniMdTables() +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + PortablePdbMiniMdTables() +#endif m_TblCount = TBL_COUNT; _ASSERTE(TBL_COUNT == TBL_COUNT_V2); // v2 counts. @@ -471,6 +490,17 @@ CMiniMdBase::CMiniMdBase() _ASSERTE((TypeFromToken(mdtGenericParam) >> 24) == TBL_GenericParam); _ASSERTE((TypeFromToken(mdtMethodSpec) >> 24) == TBL_MethodSpec); _ASSERTE((TypeFromToken(mdtGenericParamConstraint) >> 24) == TBL_GenericParamConstraint); +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + _ASSERTE((TypeFromToken(mdtDocument) >> 24) == TBL_Document); + _ASSERTE((TypeFromToken(mdtMethodDebugInformation) >> 24) == TBL_MethodDebugInformation); + _ASSERTE((TypeFromToken(mdtLocalScope) >> 24) == TBL_LocalScope); + _ASSERTE((TypeFromToken(mdtLocalVariable) >> 24) == TBL_LocalVariable); + _ASSERTE((TypeFromToken(mdtLocalConstant) >> 24) == TBL_LocalConstant); + _ASSERTE((TypeFromToken(mdtImportScope) >> 24) == TBL_ImportScope); + // TODO: + // _ASSERTE((TypeFromToken(mdtStateMachineMethod) >> 24) == TBL_StateMachineMethod); + // _ASSERTE((TypeFromToken(mdtCustomDebugInformation) >> 24) == TBL_CustomDebugInformation); +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB } // CMiniMdBase::CMiniMdBase @@ -699,7 +729,7 @@ CMiniMdBase::InitColsForTable( iOffset = 0; - pTemplate = GetTableDefTemplate(ixTbl); + pTemplate = GetTableDefTemplate(ixTbl); PREFIX_ASSUME(pTemplate->m_pColDefs != NULL); @@ -745,22 +775,39 @@ CMiniMdBase::InitColsForTable( { // Fixed type. switch (pCols[ixCol].m_Type) { +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + /* Portable PDB tables */ + // Commenting out column offset asserts. + // It makes sense to assert calculated offsets against values from the table + // definition templates, only if the fixed field columns appear at the beginning + // of a table record. + // Initializing StartOffset and Length (4th and 5th columns of the portable PDB + // LocalScope table) can cause assertion to fail at this point, since preceeding + // column sizes are determined dynamically (2 or 4 bytes for RIDs depending on the + // number of records) and cannot be compared against the static template. +#endif case iBYTE: iSize = 1; _ASSERTE(pCols[ixCol].m_cbColumn == iSize); - _ASSERTE(pCols[ixCol].m_oColumn == iOffset); +#ifndef FEATURE_METADATA_EMIT_PORTABLE_PDB + _ASSERTE(pCols[ixCol].m_oColumn == iOffset); +#endif break; case iSHORT: case iUSHORT: iSize = 2; _ASSERTE(pCols[ixCol].m_cbColumn == iSize); +#ifndef FEATURE_METADATA_EMIT_PORTABLE_PDB _ASSERTE(pCols[ixCol].m_oColumn == iOffset); +#endif break; case iLONG: case iULONG: iSize = 4; _ASSERTE(pCols[ixCol].m_cbColumn == iSize); +#ifndef FEATURE_METADATA_EMIT_PORTABLE_PDB _ASSERTE(pCols[ixCol].m_oColumn == iOffset); +#endif break; case iSTRING: iSize = (Schema.m_heaps & CMiniMdSchema::HEAP_STRING_4) ? 4 : 2; diff --git a/src/coreclr/src/md/runtime/metamodelcolumndefs.h b/src/coreclr/src/md/runtime/metamodelcolumndefs.h index ad4f8071e943..6790252d8255 100644 --- a/src/coreclr/src/md/runtime/metamodelcolumndefs.h +++ b/src/coreclr/src/md/runtime/metamodelcolumndefs.h @@ -397,4 +397,58 @@ SCHEMA_ITEM_CDTKN(GenericParamConstraint, Constraint, TypeDefOrRef) SCHEMA_TABLE_END(GenericParamConstraint) +#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB + //------------------------------------------------------------------------- + //Document + SCHEMA_TABLE_START(Document) + SCHEMA_ITEM_BLOB(Document, Name) + SCHEMA_ITEM_GUID(Document, HashAlgorithm) + SCHEMA_ITEM_BLOB(Document, Hash) + SCHEMA_ITEM_GUID(Document, Language) + SCHEMA_TABLE_END(Document) + + //------------------------------------------------------------------------- + //MethodDebugInformation + SCHEMA_TABLE_START(MethodDebugInformation) + SCHEMA_ITEM_RID(MethodDebugInformation, Document, Document) + SCHEMA_ITEM_BLOB(MethodDebugInformation, SequencePoints) + SCHEMA_TABLE_END(MethodDebugInformation) + + //------------------------------------------------------------------------- + //LocalScope + SCHEMA_TABLE_START(LocalScope) + SCHEMA_ITEM_RID(LocalScope, Method, Method) + SCHEMA_ITEM_RID(LocalScope, ImportScope, ImportScope) + SCHEMA_ITEM_RID(LocalScope, VariableList, LocalVariable) + SCHEMA_ITEM_RID(LocalScope, ConstantList, LocalConstant) + SCHEMA_ITEM(LocalScope, ULONG, StartOffset) + SCHEMA_ITEM(LocalScope, ULONG, Length) + SCHEMA_TABLE_END(LocalScope) + + //------------------------------------------------------------------------- + //LocalVariable + SCHEMA_TABLE_START(LocalVariable) + SCHEMA_ITEM(LocalVariable, USHORT, Attributes) + SCHEMA_ITEM(LocalVariable, USHORT, Index) + SCHEMA_ITEM_STRING(LocalVariable, Name) + SCHEMA_TABLE_END(LocalVariable) + + //------------------------------------------------------------------------- + //LocalConstant + SCHEMA_TABLE_START(LocalConstant) + SCHEMA_ITEM_STRING(LocalConstant, Name) + SCHEMA_ITEM_BLOB(LocalConstant, Signature) + SCHEMA_TABLE_END(LocalConstant) + + //------------------------------------------------------------------------- + //ImportScope + SCHEMA_TABLE_START(ImportScope) + SCHEMA_ITEM_RID(ImportScope, Parent, ImportScope) + SCHEMA_ITEM_BLOB(ImportScope, Imports) + SCHEMA_TABLE_END(ImportScope) + + // TODO: + // StateMachineMethod + // CustomDebugInformation +#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB // eof ------------------------------------------------------------------------ diff --git a/src/coreclr/src/md/staticmd/CMakeLists.txt b/src/coreclr/src/md/staticmd/CMakeLists.txt index c3726a80812d..99612f824aba 100644 --- a/src/coreclr/src/md/staticmd/CMakeLists.txt +++ b/src/coreclr/src/md/staticmd/CMakeLists.txt @@ -10,4 +10,7 @@ add_definitions(-DFEATURE_METADATA_EMIT_ALL) add_definitions(-DFEATURE_METADATA_EMIT) add_definitions(-DFEATURE_METADATA_INTERNAL_APIS) -add_library_clr(mdstaticapi ${STATICMD_SOURCES}) \ No newline at end of file +add_library_clr(mdstaticapi ${STATICMD_SOURCES}) + +add_library_clr(mdstaticapi_ppdb ${STATICMD_SOURCES}) +target_compile_definitions(mdstaticapi_ppdb PRIVATE FEATURE_METADATA_EMIT_PORTABLE_PDB) \ No newline at end of file diff --git a/src/coreclr/src/pal/prebuilt/idl/cordebug_i.cpp b/src/coreclr/src/pal/prebuilt/idl/cordebug_i.cpp index c6b8512eb0a8..85d7ab575a51 100644 --- a/src/coreclr/src/pal/prebuilt/idl/cordebug_i.cpp +++ b/src/coreclr/src/pal/prebuilt/idl/cordebug_i.cpp @@ -1,6 +1,3 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - /* this ALWAYS GENERATED file contains the IIDs and CLSIDs */ @@ -9,6 +6,16 @@ /* File created by MIDL compiler version 8.01.0622 */ +/* at Mon Jan 18 19:14:07 2038 + */ +/* Compiler settings for E:/repos/runtime2/src/coreclr/src/inc/cordebug.idl: + Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0622 + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ /* @@MIDL_FILE_HEADING( ) */ #pragma warning( disable: 4049 ) /* more than 64k source lines */ @@ -16,7 +23,7 @@ #ifdef __cplusplus extern "C"{ -#endif +#endif #include @@ -198,6 +205,12 @@ MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess8,0x2E6F28C1,0x85EB,0x4141,0x80,0xAD,0 MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess10,0x8F378F6F,0x1017,0x4461,0x98,0x90,0xEC,0xF6,0x4C,0x54,0x07,0x9F); +MIDL_DEFINE_GUID(IID, IID_ICorDebugMemoryRangeEnum,0xD1A0BCFC,0x5865,0x4437,0xBE,0x3F,0x36,0xF0,0x22,0x95,0x1F,0x8A); + + +MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess11,0x344B37AA,0xF2C0,0x4D3B,0x99,0x09,0x91,0xCC,0xF7,0x87,0xDA,0x8C); + + MIDL_DEFINE_GUID(IID, IID_ICorDebugModuleDebugEvent,0x51A15E8D,0x9FFF,0x4864,0x9B,0x87,0xF4,0xFB,0xDE,0xA7,0x47,0xA2); @@ -463,6 +476,3 @@ MIDL_DEFINE_GUID(CLSID, CLSID_EmbeddedCLRCorDebug,0x211f1254,0xbc7e,0x4af5,0xb9, #ifdef __cplusplus } #endif - - - diff --git a/src/coreclr/src/pal/prebuilt/inc/cordebug.h b/src/coreclr/src/pal/prebuilt/inc/cordebug.h index 7b68842d2c9d..3418b8cf9b30 100644 --- a/src/coreclr/src/pal/prebuilt/inc/cordebug.h +++ b/src/coreclr/src/pal/prebuilt/inc/cordebug.h @@ -6,7 +6,7 @@ /* File created by MIDL compiler version 8.01.0622 */ /* at Mon Jan 18 19:14:07 2038 */ -/* Compiler settings for C:/git/runtime/src/coreclr/src/inc/cordebug.idl: +/* Compiler settings for E:/repos/runtime2/src/coreclr/src/inc/cordebug.idl: Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0622 protocol : dce , ms_ext, c_ext, robust error checks: allocation ref bounds_check enum stub_data @@ -49,910 +49,924 @@ #define __ICorDebugDataTarget_FWD_DEFINED__ typedef interface ICorDebugDataTarget ICorDebugDataTarget; -#endif /* __ICorDebugDataTarget_FWD_DEFINED__ */ +#endif /* __ICorDebugDataTarget_FWD_DEFINED__ */ #ifndef __ICorDebugStaticFieldSymbol_FWD_DEFINED__ #define __ICorDebugStaticFieldSymbol_FWD_DEFINED__ typedef interface ICorDebugStaticFieldSymbol ICorDebugStaticFieldSymbol; -#endif /* __ICorDebugStaticFieldSymbol_FWD_DEFINED__ */ +#endif /* __ICorDebugStaticFieldSymbol_FWD_DEFINED__ */ #ifndef __ICorDebugInstanceFieldSymbol_FWD_DEFINED__ #define __ICorDebugInstanceFieldSymbol_FWD_DEFINED__ typedef interface ICorDebugInstanceFieldSymbol ICorDebugInstanceFieldSymbol; -#endif /* __ICorDebugInstanceFieldSymbol_FWD_DEFINED__ */ +#endif /* __ICorDebugInstanceFieldSymbol_FWD_DEFINED__ */ #ifndef __ICorDebugVariableSymbol_FWD_DEFINED__ #define __ICorDebugVariableSymbol_FWD_DEFINED__ typedef interface ICorDebugVariableSymbol ICorDebugVariableSymbol; -#endif /* __ICorDebugVariableSymbol_FWD_DEFINED__ */ +#endif /* __ICorDebugVariableSymbol_FWD_DEFINED__ */ #ifndef __ICorDebugMemoryBuffer_FWD_DEFINED__ #define __ICorDebugMemoryBuffer_FWD_DEFINED__ typedef interface ICorDebugMemoryBuffer ICorDebugMemoryBuffer; -#endif /* __ICorDebugMemoryBuffer_FWD_DEFINED__ */ +#endif /* __ICorDebugMemoryBuffer_FWD_DEFINED__ */ #ifndef __ICorDebugMergedAssemblyRecord_FWD_DEFINED__ #define __ICorDebugMergedAssemblyRecord_FWD_DEFINED__ typedef interface ICorDebugMergedAssemblyRecord ICorDebugMergedAssemblyRecord; -#endif /* __ICorDebugMergedAssemblyRecord_FWD_DEFINED__ */ +#endif /* __ICorDebugMergedAssemblyRecord_FWD_DEFINED__ */ #ifndef __ICorDebugSymbolProvider_FWD_DEFINED__ #define __ICorDebugSymbolProvider_FWD_DEFINED__ typedef interface ICorDebugSymbolProvider ICorDebugSymbolProvider; -#endif /* __ICorDebugSymbolProvider_FWD_DEFINED__ */ +#endif /* __ICorDebugSymbolProvider_FWD_DEFINED__ */ #ifndef __ICorDebugSymbolProvider2_FWD_DEFINED__ #define __ICorDebugSymbolProvider2_FWD_DEFINED__ typedef interface ICorDebugSymbolProvider2 ICorDebugSymbolProvider2; -#endif /* __ICorDebugSymbolProvider2_FWD_DEFINED__ */ +#endif /* __ICorDebugSymbolProvider2_FWD_DEFINED__ */ #ifndef __ICorDebugVirtualUnwinder_FWD_DEFINED__ #define __ICorDebugVirtualUnwinder_FWD_DEFINED__ typedef interface ICorDebugVirtualUnwinder ICorDebugVirtualUnwinder; -#endif /* __ICorDebugVirtualUnwinder_FWD_DEFINED__ */ +#endif /* __ICorDebugVirtualUnwinder_FWD_DEFINED__ */ #ifndef __ICorDebugDataTarget2_FWD_DEFINED__ #define __ICorDebugDataTarget2_FWD_DEFINED__ typedef interface ICorDebugDataTarget2 ICorDebugDataTarget2; -#endif /* __ICorDebugDataTarget2_FWD_DEFINED__ */ +#endif /* __ICorDebugDataTarget2_FWD_DEFINED__ */ #ifndef __ICorDebugLoadedModule_FWD_DEFINED__ #define __ICorDebugLoadedModule_FWD_DEFINED__ typedef interface ICorDebugLoadedModule ICorDebugLoadedModule; -#endif /* __ICorDebugLoadedModule_FWD_DEFINED__ */ +#endif /* __ICorDebugLoadedModule_FWD_DEFINED__ */ #ifndef __ICorDebugDataTarget3_FWD_DEFINED__ #define __ICorDebugDataTarget3_FWD_DEFINED__ typedef interface ICorDebugDataTarget3 ICorDebugDataTarget3; -#endif /* __ICorDebugDataTarget3_FWD_DEFINED__ */ +#endif /* __ICorDebugDataTarget3_FWD_DEFINED__ */ #ifndef __ICorDebugDataTarget4_FWD_DEFINED__ #define __ICorDebugDataTarget4_FWD_DEFINED__ typedef interface ICorDebugDataTarget4 ICorDebugDataTarget4; -#endif /* __ICorDebugDataTarget4_FWD_DEFINED__ */ +#endif /* __ICorDebugDataTarget4_FWD_DEFINED__ */ #ifndef __ICorDebugMutableDataTarget_FWD_DEFINED__ #define __ICorDebugMutableDataTarget_FWD_DEFINED__ typedef interface ICorDebugMutableDataTarget ICorDebugMutableDataTarget; -#endif /* __ICorDebugMutableDataTarget_FWD_DEFINED__ */ +#endif /* __ICorDebugMutableDataTarget_FWD_DEFINED__ */ #ifndef __ICorDebugMetaDataLocator_FWD_DEFINED__ #define __ICorDebugMetaDataLocator_FWD_DEFINED__ typedef interface ICorDebugMetaDataLocator ICorDebugMetaDataLocator; -#endif /* __ICorDebugMetaDataLocator_FWD_DEFINED__ */ +#endif /* __ICorDebugMetaDataLocator_FWD_DEFINED__ */ #ifndef __ICorDebugManagedCallback_FWD_DEFINED__ #define __ICorDebugManagedCallback_FWD_DEFINED__ typedef interface ICorDebugManagedCallback ICorDebugManagedCallback; -#endif /* __ICorDebugManagedCallback_FWD_DEFINED__ */ +#endif /* __ICorDebugManagedCallback_FWD_DEFINED__ */ #ifndef __ICorDebugManagedCallback3_FWD_DEFINED__ #define __ICorDebugManagedCallback3_FWD_DEFINED__ typedef interface ICorDebugManagedCallback3 ICorDebugManagedCallback3; -#endif /* __ICorDebugManagedCallback3_FWD_DEFINED__ */ +#endif /* __ICorDebugManagedCallback3_FWD_DEFINED__ */ #ifndef __ICorDebugManagedCallback4_FWD_DEFINED__ #define __ICorDebugManagedCallback4_FWD_DEFINED__ typedef interface ICorDebugManagedCallback4 ICorDebugManagedCallback4; -#endif /* __ICorDebugManagedCallback4_FWD_DEFINED__ */ +#endif /* __ICorDebugManagedCallback4_FWD_DEFINED__ */ #ifndef __ICorDebugManagedCallback2_FWD_DEFINED__ #define __ICorDebugManagedCallback2_FWD_DEFINED__ typedef interface ICorDebugManagedCallback2 ICorDebugManagedCallback2; -#endif /* __ICorDebugManagedCallback2_FWD_DEFINED__ */ +#endif /* __ICorDebugManagedCallback2_FWD_DEFINED__ */ #ifndef __ICorDebugUnmanagedCallback_FWD_DEFINED__ #define __ICorDebugUnmanagedCallback_FWD_DEFINED__ typedef interface ICorDebugUnmanagedCallback ICorDebugUnmanagedCallback; -#endif /* __ICorDebugUnmanagedCallback_FWD_DEFINED__ */ +#endif /* __ICorDebugUnmanagedCallback_FWD_DEFINED__ */ #ifndef __ICorDebug_FWD_DEFINED__ #define __ICorDebug_FWD_DEFINED__ typedef interface ICorDebug ICorDebug; -#endif /* __ICorDebug_FWD_DEFINED__ */ +#endif /* __ICorDebug_FWD_DEFINED__ */ #ifndef __ICorDebugRemoteTarget_FWD_DEFINED__ #define __ICorDebugRemoteTarget_FWD_DEFINED__ typedef interface ICorDebugRemoteTarget ICorDebugRemoteTarget; -#endif /* __ICorDebugRemoteTarget_FWD_DEFINED__ */ +#endif /* __ICorDebugRemoteTarget_FWD_DEFINED__ */ #ifndef __ICorDebugRemote_FWD_DEFINED__ #define __ICorDebugRemote_FWD_DEFINED__ typedef interface ICorDebugRemote ICorDebugRemote; -#endif /* __ICorDebugRemote_FWD_DEFINED__ */ +#endif /* __ICorDebugRemote_FWD_DEFINED__ */ #ifndef __ICorDebug2_FWD_DEFINED__ #define __ICorDebug2_FWD_DEFINED__ typedef interface ICorDebug2 ICorDebug2; -#endif /* __ICorDebug2_FWD_DEFINED__ */ +#endif /* __ICorDebug2_FWD_DEFINED__ */ #ifndef __ICorDebugController_FWD_DEFINED__ #define __ICorDebugController_FWD_DEFINED__ typedef interface ICorDebugController ICorDebugController; -#endif /* __ICorDebugController_FWD_DEFINED__ */ +#endif /* __ICorDebugController_FWD_DEFINED__ */ #ifndef __ICorDebugAppDomain_FWD_DEFINED__ #define __ICorDebugAppDomain_FWD_DEFINED__ typedef interface ICorDebugAppDomain ICorDebugAppDomain; -#endif /* __ICorDebugAppDomain_FWD_DEFINED__ */ +#endif /* __ICorDebugAppDomain_FWD_DEFINED__ */ #ifndef __ICorDebugAppDomain2_FWD_DEFINED__ #define __ICorDebugAppDomain2_FWD_DEFINED__ typedef interface ICorDebugAppDomain2 ICorDebugAppDomain2; -#endif /* __ICorDebugAppDomain2_FWD_DEFINED__ */ +#endif /* __ICorDebugAppDomain2_FWD_DEFINED__ */ #ifndef __ICorDebugEnum_FWD_DEFINED__ #define __ICorDebugEnum_FWD_DEFINED__ typedef interface ICorDebugEnum ICorDebugEnum; -#endif /* __ICorDebugEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugEnum_FWD_DEFINED__ */ #ifndef __ICorDebugGuidToTypeEnum_FWD_DEFINED__ #define __ICorDebugGuidToTypeEnum_FWD_DEFINED__ typedef interface ICorDebugGuidToTypeEnum ICorDebugGuidToTypeEnum; -#endif /* __ICorDebugGuidToTypeEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugGuidToTypeEnum_FWD_DEFINED__ */ #ifndef __ICorDebugAppDomain3_FWD_DEFINED__ #define __ICorDebugAppDomain3_FWD_DEFINED__ typedef interface ICorDebugAppDomain3 ICorDebugAppDomain3; -#endif /* __ICorDebugAppDomain3_FWD_DEFINED__ */ +#endif /* __ICorDebugAppDomain3_FWD_DEFINED__ */ #ifndef __ICorDebugAppDomain4_FWD_DEFINED__ #define __ICorDebugAppDomain4_FWD_DEFINED__ typedef interface ICorDebugAppDomain4 ICorDebugAppDomain4; -#endif /* __ICorDebugAppDomain4_FWD_DEFINED__ */ +#endif /* __ICorDebugAppDomain4_FWD_DEFINED__ */ #ifndef __ICorDebugAssembly_FWD_DEFINED__ #define __ICorDebugAssembly_FWD_DEFINED__ typedef interface ICorDebugAssembly ICorDebugAssembly; -#endif /* __ICorDebugAssembly_FWD_DEFINED__ */ +#endif /* __ICorDebugAssembly_FWD_DEFINED__ */ #ifndef __ICorDebugAssembly2_FWD_DEFINED__ #define __ICorDebugAssembly2_FWD_DEFINED__ typedef interface ICorDebugAssembly2 ICorDebugAssembly2; -#endif /* __ICorDebugAssembly2_FWD_DEFINED__ */ +#endif /* __ICorDebugAssembly2_FWD_DEFINED__ */ #ifndef __ICorDebugAssembly3_FWD_DEFINED__ #define __ICorDebugAssembly3_FWD_DEFINED__ typedef interface ICorDebugAssembly3 ICorDebugAssembly3; -#endif /* __ICorDebugAssembly3_FWD_DEFINED__ */ +#endif /* __ICorDebugAssembly3_FWD_DEFINED__ */ #ifndef __ICorDebugHeapEnum_FWD_DEFINED__ #define __ICorDebugHeapEnum_FWD_DEFINED__ typedef interface ICorDebugHeapEnum ICorDebugHeapEnum; -#endif /* __ICorDebugHeapEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugHeapEnum_FWD_DEFINED__ */ #ifndef __ICorDebugHeapSegmentEnum_FWD_DEFINED__ #define __ICorDebugHeapSegmentEnum_FWD_DEFINED__ typedef interface ICorDebugHeapSegmentEnum ICorDebugHeapSegmentEnum; -#endif /* __ICorDebugHeapSegmentEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugHeapSegmentEnum_FWD_DEFINED__ */ #ifndef __ICorDebugGCReferenceEnum_FWD_DEFINED__ #define __ICorDebugGCReferenceEnum_FWD_DEFINED__ typedef interface ICorDebugGCReferenceEnum ICorDebugGCReferenceEnum; -#endif /* __ICorDebugGCReferenceEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugGCReferenceEnum_FWD_DEFINED__ */ #ifndef __ICorDebugProcess_FWD_DEFINED__ #define __ICorDebugProcess_FWD_DEFINED__ typedef interface ICorDebugProcess ICorDebugProcess; -#endif /* __ICorDebugProcess_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess_FWD_DEFINED__ */ #ifndef __ICorDebugProcess2_FWD_DEFINED__ #define __ICorDebugProcess2_FWD_DEFINED__ typedef interface ICorDebugProcess2 ICorDebugProcess2; -#endif /* __ICorDebugProcess2_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess2_FWD_DEFINED__ */ #ifndef __ICorDebugProcess3_FWD_DEFINED__ #define __ICorDebugProcess3_FWD_DEFINED__ typedef interface ICorDebugProcess3 ICorDebugProcess3; -#endif /* __ICorDebugProcess3_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess3_FWD_DEFINED__ */ #ifndef __ICorDebugProcess5_FWD_DEFINED__ #define __ICorDebugProcess5_FWD_DEFINED__ typedef interface ICorDebugProcess5 ICorDebugProcess5; -#endif /* __ICorDebugProcess5_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess5_FWD_DEFINED__ */ #ifndef __ICorDebugDebugEvent_FWD_DEFINED__ #define __ICorDebugDebugEvent_FWD_DEFINED__ typedef interface ICorDebugDebugEvent ICorDebugDebugEvent; -#endif /* __ICorDebugDebugEvent_FWD_DEFINED__ */ +#endif /* __ICorDebugDebugEvent_FWD_DEFINED__ */ #ifndef __ICorDebugProcess6_FWD_DEFINED__ #define __ICorDebugProcess6_FWD_DEFINED__ typedef interface ICorDebugProcess6 ICorDebugProcess6; -#endif /* __ICorDebugProcess6_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess6_FWD_DEFINED__ */ #ifndef __ICorDebugProcess7_FWD_DEFINED__ #define __ICorDebugProcess7_FWD_DEFINED__ typedef interface ICorDebugProcess7 ICorDebugProcess7; -#endif /* __ICorDebugProcess7_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess7_FWD_DEFINED__ */ #ifndef __ICorDebugProcess8_FWD_DEFINED__ #define __ICorDebugProcess8_FWD_DEFINED__ typedef interface ICorDebugProcess8 ICorDebugProcess8; -#endif /* __ICorDebugProcess8_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess8_FWD_DEFINED__ */ #ifndef __ICorDebugProcess10_FWD_DEFINED__ #define __ICorDebugProcess10_FWD_DEFINED__ typedef interface ICorDebugProcess10 ICorDebugProcess10; -#endif /* __ICorDebugProcess10_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess10_FWD_DEFINED__ */ + + +#ifndef __ICorDebugMemoryRangeEnum_FWD_DEFINED__ +#define __ICorDebugMemoryRangeEnum_FWD_DEFINED__ +typedef interface ICorDebugMemoryRangeEnum ICorDebugMemoryRangeEnum; + +#endif /* __ICorDebugMemoryRangeEnum_FWD_DEFINED__ */ + + +#ifndef __ICorDebugProcess11_FWD_DEFINED__ +#define __ICorDebugProcess11_FWD_DEFINED__ +typedef interface ICorDebugProcess11 ICorDebugProcess11; + +#endif /* __ICorDebugProcess11_FWD_DEFINED__ */ #ifndef __ICorDebugModuleDebugEvent_FWD_DEFINED__ #define __ICorDebugModuleDebugEvent_FWD_DEFINED__ typedef interface ICorDebugModuleDebugEvent ICorDebugModuleDebugEvent; -#endif /* __ICorDebugModuleDebugEvent_FWD_DEFINED__ */ +#endif /* __ICorDebugModuleDebugEvent_FWD_DEFINED__ */ #ifndef __ICorDebugExceptionDebugEvent_FWD_DEFINED__ #define __ICorDebugExceptionDebugEvent_FWD_DEFINED__ typedef interface ICorDebugExceptionDebugEvent ICorDebugExceptionDebugEvent; -#endif /* __ICorDebugExceptionDebugEvent_FWD_DEFINED__ */ +#endif /* __ICorDebugExceptionDebugEvent_FWD_DEFINED__ */ #ifndef __ICorDebugBreakpoint_FWD_DEFINED__ #define __ICorDebugBreakpoint_FWD_DEFINED__ typedef interface ICorDebugBreakpoint ICorDebugBreakpoint; -#endif /* __ICorDebugBreakpoint_FWD_DEFINED__ */ +#endif /* __ICorDebugBreakpoint_FWD_DEFINED__ */ #ifndef __ICorDebugFunctionBreakpoint_FWD_DEFINED__ #define __ICorDebugFunctionBreakpoint_FWD_DEFINED__ typedef interface ICorDebugFunctionBreakpoint ICorDebugFunctionBreakpoint; -#endif /* __ICorDebugFunctionBreakpoint_FWD_DEFINED__ */ +#endif /* __ICorDebugFunctionBreakpoint_FWD_DEFINED__ */ #ifndef __ICorDebugModuleBreakpoint_FWD_DEFINED__ #define __ICorDebugModuleBreakpoint_FWD_DEFINED__ typedef interface ICorDebugModuleBreakpoint ICorDebugModuleBreakpoint; -#endif /* __ICorDebugModuleBreakpoint_FWD_DEFINED__ */ +#endif /* __ICorDebugModuleBreakpoint_FWD_DEFINED__ */ #ifndef __ICorDebugValueBreakpoint_FWD_DEFINED__ #define __ICorDebugValueBreakpoint_FWD_DEFINED__ typedef interface ICorDebugValueBreakpoint ICorDebugValueBreakpoint; -#endif /* __ICorDebugValueBreakpoint_FWD_DEFINED__ */ +#endif /* __ICorDebugValueBreakpoint_FWD_DEFINED__ */ #ifndef __ICorDebugStepper_FWD_DEFINED__ #define __ICorDebugStepper_FWD_DEFINED__ typedef interface ICorDebugStepper ICorDebugStepper; -#endif /* __ICorDebugStepper_FWD_DEFINED__ */ +#endif /* __ICorDebugStepper_FWD_DEFINED__ */ #ifndef __ICorDebugStepper2_FWD_DEFINED__ #define __ICorDebugStepper2_FWD_DEFINED__ typedef interface ICorDebugStepper2 ICorDebugStepper2; -#endif /* __ICorDebugStepper2_FWD_DEFINED__ */ +#endif /* __ICorDebugStepper2_FWD_DEFINED__ */ #ifndef __ICorDebugRegisterSet_FWD_DEFINED__ #define __ICorDebugRegisterSet_FWD_DEFINED__ typedef interface ICorDebugRegisterSet ICorDebugRegisterSet; -#endif /* __ICorDebugRegisterSet_FWD_DEFINED__ */ +#endif /* __ICorDebugRegisterSet_FWD_DEFINED__ */ #ifndef __ICorDebugRegisterSet2_FWD_DEFINED__ #define __ICorDebugRegisterSet2_FWD_DEFINED__ typedef interface ICorDebugRegisterSet2 ICorDebugRegisterSet2; -#endif /* __ICorDebugRegisterSet2_FWD_DEFINED__ */ +#endif /* __ICorDebugRegisterSet2_FWD_DEFINED__ */ #ifndef __ICorDebugThread_FWD_DEFINED__ #define __ICorDebugThread_FWD_DEFINED__ typedef interface ICorDebugThread ICorDebugThread; -#endif /* __ICorDebugThread_FWD_DEFINED__ */ +#endif /* __ICorDebugThread_FWD_DEFINED__ */ #ifndef __ICorDebugThread2_FWD_DEFINED__ #define __ICorDebugThread2_FWD_DEFINED__ typedef interface ICorDebugThread2 ICorDebugThread2; -#endif /* __ICorDebugThread2_FWD_DEFINED__ */ +#endif /* __ICorDebugThread2_FWD_DEFINED__ */ #ifndef __ICorDebugThread3_FWD_DEFINED__ #define __ICorDebugThread3_FWD_DEFINED__ typedef interface ICorDebugThread3 ICorDebugThread3; -#endif /* __ICorDebugThread3_FWD_DEFINED__ */ +#endif /* __ICorDebugThread3_FWD_DEFINED__ */ #ifndef __ICorDebugThread4_FWD_DEFINED__ #define __ICorDebugThread4_FWD_DEFINED__ typedef interface ICorDebugThread4 ICorDebugThread4; -#endif /* __ICorDebugThread4_FWD_DEFINED__ */ +#endif /* __ICorDebugThread4_FWD_DEFINED__ */ #ifndef __ICorDebugStackWalk_FWD_DEFINED__ #define __ICorDebugStackWalk_FWD_DEFINED__ typedef interface ICorDebugStackWalk ICorDebugStackWalk; -#endif /* __ICorDebugStackWalk_FWD_DEFINED__ */ +#endif /* __ICorDebugStackWalk_FWD_DEFINED__ */ #ifndef __ICorDebugChain_FWD_DEFINED__ #define __ICorDebugChain_FWD_DEFINED__ typedef interface ICorDebugChain ICorDebugChain; -#endif /* __ICorDebugChain_FWD_DEFINED__ */ +#endif /* __ICorDebugChain_FWD_DEFINED__ */ #ifndef __ICorDebugFrame_FWD_DEFINED__ #define __ICorDebugFrame_FWD_DEFINED__ typedef interface ICorDebugFrame ICorDebugFrame; -#endif /* __ICorDebugFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugFrame_FWD_DEFINED__ */ #ifndef __ICorDebugInternalFrame_FWD_DEFINED__ #define __ICorDebugInternalFrame_FWD_DEFINED__ typedef interface ICorDebugInternalFrame ICorDebugInternalFrame; -#endif /* __ICorDebugInternalFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugInternalFrame_FWD_DEFINED__ */ #ifndef __ICorDebugInternalFrame2_FWD_DEFINED__ #define __ICorDebugInternalFrame2_FWD_DEFINED__ typedef interface ICorDebugInternalFrame2 ICorDebugInternalFrame2; -#endif /* __ICorDebugInternalFrame2_FWD_DEFINED__ */ +#endif /* __ICorDebugInternalFrame2_FWD_DEFINED__ */ #ifndef __ICorDebugILFrame_FWD_DEFINED__ #define __ICorDebugILFrame_FWD_DEFINED__ typedef interface ICorDebugILFrame ICorDebugILFrame; -#endif /* __ICorDebugILFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugILFrame_FWD_DEFINED__ */ #ifndef __ICorDebugILFrame2_FWD_DEFINED__ #define __ICorDebugILFrame2_FWD_DEFINED__ typedef interface ICorDebugILFrame2 ICorDebugILFrame2; -#endif /* __ICorDebugILFrame2_FWD_DEFINED__ */ +#endif /* __ICorDebugILFrame2_FWD_DEFINED__ */ #ifndef __ICorDebugILFrame3_FWD_DEFINED__ #define __ICorDebugILFrame3_FWD_DEFINED__ typedef interface ICorDebugILFrame3 ICorDebugILFrame3; -#endif /* __ICorDebugILFrame3_FWD_DEFINED__ */ +#endif /* __ICorDebugILFrame3_FWD_DEFINED__ */ #ifndef __ICorDebugILFrame4_FWD_DEFINED__ #define __ICorDebugILFrame4_FWD_DEFINED__ typedef interface ICorDebugILFrame4 ICorDebugILFrame4; -#endif /* __ICorDebugILFrame4_FWD_DEFINED__ */ +#endif /* __ICorDebugILFrame4_FWD_DEFINED__ */ #ifndef __ICorDebugNativeFrame_FWD_DEFINED__ #define __ICorDebugNativeFrame_FWD_DEFINED__ typedef interface ICorDebugNativeFrame ICorDebugNativeFrame; -#endif /* __ICorDebugNativeFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugNativeFrame_FWD_DEFINED__ */ #ifndef __ICorDebugNativeFrame2_FWD_DEFINED__ #define __ICorDebugNativeFrame2_FWD_DEFINED__ typedef interface ICorDebugNativeFrame2 ICorDebugNativeFrame2; -#endif /* __ICorDebugNativeFrame2_FWD_DEFINED__ */ +#endif /* __ICorDebugNativeFrame2_FWD_DEFINED__ */ #ifndef __ICorDebugModule3_FWD_DEFINED__ #define __ICorDebugModule3_FWD_DEFINED__ typedef interface ICorDebugModule3 ICorDebugModule3; -#endif /* __ICorDebugModule3_FWD_DEFINED__ */ +#endif /* __ICorDebugModule3_FWD_DEFINED__ */ #ifndef __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ #define __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ typedef interface ICorDebugRuntimeUnwindableFrame ICorDebugRuntimeUnwindableFrame; -#endif /* __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ */ #ifndef __ICorDebugModule_FWD_DEFINED__ #define __ICorDebugModule_FWD_DEFINED__ typedef interface ICorDebugModule ICorDebugModule; -#endif /* __ICorDebugModule_FWD_DEFINED__ */ +#endif /* __ICorDebugModule_FWD_DEFINED__ */ #ifndef __ICorDebugModule2_FWD_DEFINED__ #define __ICorDebugModule2_FWD_DEFINED__ typedef interface ICorDebugModule2 ICorDebugModule2; -#endif /* __ICorDebugModule2_FWD_DEFINED__ */ +#endif /* __ICorDebugModule2_FWD_DEFINED__ */ #ifndef __ICorDebugFunction_FWD_DEFINED__ #define __ICorDebugFunction_FWD_DEFINED__ typedef interface ICorDebugFunction ICorDebugFunction; -#endif /* __ICorDebugFunction_FWD_DEFINED__ */ +#endif /* __ICorDebugFunction_FWD_DEFINED__ */ #ifndef __ICorDebugFunction2_FWD_DEFINED__ #define __ICorDebugFunction2_FWD_DEFINED__ typedef interface ICorDebugFunction2 ICorDebugFunction2; -#endif /* __ICorDebugFunction2_FWD_DEFINED__ */ +#endif /* __ICorDebugFunction2_FWD_DEFINED__ */ #ifndef __ICorDebugFunction3_FWD_DEFINED__ #define __ICorDebugFunction3_FWD_DEFINED__ typedef interface ICorDebugFunction3 ICorDebugFunction3; -#endif /* __ICorDebugFunction3_FWD_DEFINED__ */ +#endif /* __ICorDebugFunction3_FWD_DEFINED__ */ #ifndef __ICorDebugFunction4_FWD_DEFINED__ #define __ICorDebugFunction4_FWD_DEFINED__ typedef interface ICorDebugFunction4 ICorDebugFunction4; -#endif /* __ICorDebugFunction4_FWD_DEFINED__ */ +#endif /* __ICorDebugFunction4_FWD_DEFINED__ */ #ifndef __ICorDebugCode_FWD_DEFINED__ #define __ICorDebugCode_FWD_DEFINED__ typedef interface ICorDebugCode ICorDebugCode; -#endif /* __ICorDebugCode_FWD_DEFINED__ */ +#endif /* __ICorDebugCode_FWD_DEFINED__ */ #ifndef __ICorDebugCode2_FWD_DEFINED__ #define __ICorDebugCode2_FWD_DEFINED__ typedef interface ICorDebugCode2 ICorDebugCode2; -#endif /* __ICorDebugCode2_FWD_DEFINED__ */ +#endif /* __ICorDebugCode2_FWD_DEFINED__ */ #ifndef __ICorDebugCode3_FWD_DEFINED__ #define __ICorDebugCode3_FWD_DEFINED__ typedef interface ICorDebugCode3 ICorDebugCode3; -#endif /* __ICorDebugCode3_FWD_DEFINED__ */ +#endif /* __ICorDebugCode3_FWD_DEFINED__ */ #ifndef __ICorDebugCode4_FWD_DEFINED__ #define __ICorDebugCode4_FWD_DEFINED__ typedef interface ICorDebugCode4 ICorDebugCode4; -#endif /* __ICorDebugCode4_FWD_DEFINED__ */ +#endif /* __ICorDebugCode4_FWD_DEFINED__ */ #ifndef __ICorDebugILCode_FWD_DEFINED__ #define __ICorDebugILCode_FWD_DEFINED__ typedef interface ICorDebugILCode ICorDebugILCode; -#endif /* __ICorDebugILCode_FWD_DEFINED__ */ +#endif /* __ICorDebugILCode_FWD_DEFINED__ */ #ifndef __ICorDebugILCode2_FWD_DEFINED__ #define __ICorDebugILCode2_FWD_DEFINED__ typedef interface ICorDebugILCode2 ICorDebugILCode2; -#endif /* __ICorDebugILCode2_FWD_DEFINED__ */ +#endif /* __ICorDebugILCode2_FWD_DEFINED__ */ #ifndef __ICorDebugClass_FWD_DEFINED__ #define __ICorDebugClass_FWD_DEFINED__ typedef interface ICorDebugClass ICorDebugClass; -#endif /* __ICorDebugClass_FWD_DEFINED__ */ +#endif /* __ICorDebugClass_FWD_DEFINED__ */ #ifndef __ICorDebugClass2_FWD_DEFINED__ #define __ICorDebugClass2_FWD_DEFINED__ typedef interface ICorDebugClass2 ICorDebugClass2; -#endif /* __ICorDebugClass2_FWD_DEFINED__ */ +#endif /* __ICorDebugClass2_FWD_DEFINED__ */ #ifndef __ICorDebugEval_FWD_DEFINED__ #define __ICorDebugEval_FWD_DEFINED__ typedef interface ICorDebugEval ICorDebugEval; -#endif /* __ICorDebugEval_FWD_DEFINED__ */ +#endif /* __ICorDebugEval_FWD_DEFINED__ */ #ifndef __ICorDebugEval2_FWD_DEFINED__ #define __ICorDebugEval2_FWD_DEFINED__ typedef interface ICorDebugEval2 ICorDebugEval2; -#endif /* __ICorDebugEval2_FWD_DEFINED__ */ +#endif /* __ICorDebugEval2_FWD_DEFINED__ */ #ifndef __ICorDebugValue_FWD_DEFINED__ #define __ICorDebugValue_FWD_DEFINED__ typedef interface ICorDebugValue ICorDebugValue; -#endif /* __ICorDebugValue_FWD_DEFINED__ */ +#endif /* __ICorDebugValue_FWD_DEFINED__ */ #ifndef __ICorDebugValue2_FWD_DEFINED__ #define __ICorDebugValue2_FWD_DEFINED__ typedef interface ICorDebugValue2 ICorDebugValue2; -#endif /* __ICorDebugValue2_FWD_DEFINED__ */ +#endif /* __ICorDebugValue2_FWD_DEFINED__ */ #ifndef __ICorDebugValue3_FWD_DEFINED__ #define __ICorDebugValue3_FWD_DEFINED__ typedef interface ICorDebugValue3 ICorDebugValue3; -#endif /* __ICorDebugValue3_FWD_DEFINED__ */ +#endif /* __ICorDebugValue3_FWD_DEFINED__ */ #ifndef __ICorDebugGenericValue_FWD_DEFINED__ #define __ICorDebugGenericValue_FWD_DEFINED__ typedef interface ICorDebugGenericValue ICorDebugGenericValue; -#endif /* __ICorDebugGenericValue_FWD_DEFINED__ */ +#endif /* __ICorDebugGenericValue_FWD_DEFINED__ */ #ifndef __ICorDebugReferenceValue_FWD_DEFINED__ #define __ICorDebugReferenceValue_FWD_DEFINED__ typedef interface ICorDebugReferenceValue ICorDebugReferenceValue; -#endif /* __ICorDebugReferenceValue_FWD_DEFINED__ */ +#endif /* __ICorDebugReferenceValue_FWD_DEFINED__ */ #ifndef __ICorDebugHeapValue_FWD_DEFINED__ #define __ICorDebugHeapValue_FWD_DEFINED__ typedef interface ICorDebugHeapValue ICorDebugHeapValue; -#endif /* __ICorDebugHeapValue_FWD_DEFINED__ */ +#endif /* __ICorDebugHeapValue_FWD_DEFINED__ */ #ifndef __ICorDebugHeapValue2_FWD_DEFINED__ #define __ICorDebugHeapValue2_FWD_DEFINED__ typedef interface ICorDebugHeapValue2 ICorDebugHeapValue2; -#endif /* __ICorDebugHeapValue2_FWD_DEFINED__ */ +#endif /* __ICorDebugHeapValue2_FWD_DEFINED__ */ #ifndef __ICorDebugHeapValue3_FWD_DEFINED__ #define __ICorDebugHeapValue3_FWD_DEFINED__ typedef interface ICorDebugHeapValue3 ICorDebugHeapValue3; -#endif /* __ICorDebugHeapValue3_FWD_DEFINED__ */ +#endif /* __ICorDebugHeapValue3_FWD_DEFINED__ */ #ifndef __ICorDebugObjectValue_FWD_DEFINED__ #define __ICorDebugObjectValue_FWD_DEFINED__ typedef interface ICorDebugObjectValue ICorDebugObjectValue; -#endif /* __ICorDebugObjectValue_FWD_DEFINED__ */ +#endif /* __ICorDebugObjectValue_FWD_DEFINED__ */ #ifndef __ICorDebugObjectValue2_FWD_DEFINED__ #define __ICorDebugObjectValue2_FWD_DEFINED__ typedef interface ICorDebugObjectValue2 ICorDebugObjectValue2; -#endif /* __ICorDebugObjectValue2_FWD_DEFINED__ */ +#endif /* __ICorDebugObjectValue2_FWD_DEFINED__ */ #ifndef __ICorDebugDelegateObjectValue_FWD_DEFINED__ #define __ICorDebugDelegateObjectValue_FWD_DEFINED__ typedef interface ICorDebugDelegateObjectValue ICorDebugDelegateObjectValue; -#endif /* __ICorDebugDelegateObjectValue_FWD_DEFINED__ */ +#endif /* __ICorDebugDelegateObjectValue_FWD_DEFINED__ */ #ifndef __ICorDebugBoxValue_FWD_DEFINED__ #define __ICorDebugBoxValue_FWD_DEFINED__ typedef interface ICorDebugBoxValue ICorDebugBoxValue; -#endif /* __ICorDebugBoxValue_FWD_DEFINED__ */ +#endif /* __ICorDebugBoxValue_FWD_DEFINED__ */ #ifndef __ICorDebugStringValue_FWD_DEFINED__ #define __ICorDebugStringValue_FWD_DEFINED__ typedef interface ICorDebugStringValue ICorDebugStringValue; -#endif /* __ICorDebugStringValue_FWD_DEFINED__ */ +#endif /* __ICorDebugStringValue_FWD_DEFINED__ */ #ifndef __ICorDebugArrayValue_FWD_DEFINED__ #define __ICorDebugArrayValue_FWD_DEFINED__ typedef interface ICorDebugArrayValue ICorDebugArrayValue; -#endif /* __ICorDebugArrayValue_FWD_DEFINED__ */ +#endif /* __ICorDebugArrayValue_FWD_DEFINED__ */ #ifndef __ICorDebugVariableHome_FWD_DEFINED__ #define __ICorDebugVariableHome_FWD_DEFINED__ typedef interface ICorDebugVariableHome ICorDebugVariableHome; -#endif /* __ICorDebugVariableHome_FWD_DEFINED__ */ +#endif /* __ICorDebugVariableHome_FWD_DEFINED__ */ #ifndef __ICorDebugHandleValue_FWD_DEFINED__ #define __ICorDebugHandleValue_FWD_DEFINED__ typedef interface ICorDebugHandleValue ICorDebugHandleValue; -#endif /* __ICorDebugHandleValue_FWD_DEFINED__ */ +#endif /* __ICorDebugHandleValue_FWD_DEFINED__ */ #ifndef __ICorDebugContext_FWD_DEFINED__ #define __ICorDebugContext_FWD_DEFINED__ typedef interface ICorDebugContext ICorDebugContext; -#endif /* __ICorDebugContext_FWD_DEFINED__ */ +#endif /* __ICorDebugContext_FWD_DEFINED__ */ #ifndef __ICorDebugComObjectValue_FWD_DEFINED__ #define __ICorDebugComObjectValue_FWD_DEFINED__ typedef interface ICorDebugComObjectValue ICorDebugComObjectValue; -#endif /* __ICorDebugComObjectValue_FWD_DEFINED__ */ +#endif /* __ICorDebugComObjectValue_FWD_DEFINED__ */ #ifndef __ICorDebugObjectEnum_FWD_DEFINED__ #define __ICorDebugObjectEnum_FWD_DEFINED__ typedef interface ICorDebugObjectEnum ICorDebugObjectEnum; -#endif /* __ICorDebugObjectEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugObjectEnum_FWD_DEFINED__ */ #ifndef __ICorDebugBreakpointEnum_FWD_DEFINED__ #define __ICorDebugBreakpointEnum_FWD_DEFINED__ typedef interface ICorDebugBreakpointEnum ICorDebugBreakpointEnum; -#endif /* __ICorDebugBreakpointEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugBreakpointEnum_FWD_DEFINED__ */ #ifndef __ICorDebugStepperEnum_FWD_DEFINED__ #define __ICorDebugStepperEnum_FWD_DEFINED__ typedef interface ICorDebugStepperEnum ICorDebugStepperEnum; -#endif /* __ICorDebugStepperEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugStepperEnum_FWD_DEFINED__ */ #ifndef __ICorDebugProcessEnum_FWD_DEFINED__ #define __ICorDebugProcessEnum_FWD_DEFINED__ typedef interface ICorDebugProcessEnum ICorDebugProcessEnum; -#endif /* __ICorDebugProcessEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugProcessEnum_FWD_DEFINED__ */ #ifndef __ICorDebugThreadEnum_FWD_DEFINED__ #define __ICorDebugThreadEnum_FWD_DEFINED__ typedef interface ICorDebugThreadEnum ICorDebugThreadEnum; -#endif /* __ICorDebugThreadEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugThreadEnum_FWD_DEFINED__ */ #ifndef __ICorDebugFrameEnum_FWD_DEFINED__ #define __ICorDebugFrameEnum_FWD_DEFINED__ typedef interface ICorDebugFrameEnum ICorDebugFrameEnum; -#endif /* __ICorDebugFrameEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugFrameEnum_FWD_DEFINED__ */ #ifndef __ICorDebugChainEnum_FWD_DEFINED__ #define __ICorDebugChainEnum_FWD_DEFINED__ typedef interface ICorDebugChainEnum ICorDebugChainEnum; -#endif /* __ICorDebugChainEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugChainEnum_FWD_DEFINED__ */ #ifndef __ICorDebugModuleEnum_FWD_DEFINED__ #define __ICorDebugModuleEnum_FWD_DEFINED__ typedef interface ICorDebugModuleEnum ICorDebugModuleEnum; -#endif /* __ICorDebugModuleEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugModuleEnum_FWD_DEFINED__ */ #ifndef __ICorDebugValueEnum_FWD_DEFINED__ #define __ICorDebugValueEnum_FWD_DEFINED__ typedef interface ICorDebugValueEnum ICorDebugValueEnum; -#endif /* __ICorDebugValueEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugValueEnum_FWD_DEFINED__ */ #ifndef __ICorDebugVariableHomeEnum_FWD_DEFINED__ #define __ICorDebugVariableHomeEnum_FWD_DEFINED__ typedef interface ICorDebugVariableHomeEnum ICorDebugVariableHomeEnum; -#endif /* __ICorDebugVariableHomeEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugVariableHomeEnum_FWD_DEFINED__ */ #ifndef __ICorDebugCodeEnum_FWD_DEFINED__ #define __ICorDebugCodeEnum_FWD_DEFINED__ typedef interface ICorDebugCodeEnum ICorDebugCodeEnum; -#endif /* __ICorDebugCodeEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugCodeEnum_FWD_DEFINED__ */ #ifndef __ICorDebugTypeEnum_FWD_DEFINED__ #define __ICorDebugTypeEnum_FWD_DEFINED__ typedef interface ICorDebugTypeEnum ICorDebugTypeEnum; -#endif /* __ICorDebugTypeEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugTypeEnum_FWD_DEFINED__ */ #ifndef __ICorDebugType_FWD_DEFINED__ #define __ICorDebugType_FWD_DEFINED__ typedef interface ICorDebugType ICorDebugType; -#endif /* __ICorDebugType_FWD_DEFINED__ */ +#endif /* __ICorDebugType_FWD_DEFINED__ */ #ifndef __ICorDebugType2_FWD_DEFINED__ #define __ICorDebugType2_FWD_DEFINED__ typedef interface ICorDebugType2 ICorDebugType2; -#endif /* __ICorDebugType2_FWD_DEFINED__ */ +#endif /* __ICorDebugType2_FWD_DEFINED__ */ #ifndef __ICorDebugErrorInfoEnum_FWD_DEFINED__ #define __ICorDebugErrorInfoEnum_FWD_DEFINED__ typedef interface ICorDebugErrorInfoEnum ICorDebugErrorInfoEnum; -#endif /* __ICorDebugErrorInfoEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugErrorInfoEnum_FWD_DEFINED__ */ #ifndef __ICorDebugAppDomainEnum_FWD_DEFINED__ #define __ICorDebugAppDomainEnum_FWD_DEFINED__ typedef interface ICorDebugAppDomainEnum ICorDebugAppDomainEnum; -#endif /* __ICorDebugAppDomainEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugAppDomainEnum_FWD_DEFINED__ */ #ifndef __ICorDebugAssemblyEnum_FWD_DEFINED__ #define __ICorDebugAssemblyEnum_FWD_DEFINED__ typedef interface ICorDebugAssemblyEnum ICorDebugAssemblyEnum; -#endif /* __ICorDebugAssemblyEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugAssemblyEnum_FWD_DEFINED__ */ #ifndef __ICorDebugBlockingObjectEnum_FWD_DEFINED__ #define __ICorDebugBlockingObjectEnum_FWD_DEFINED__ typedef interface ICorDebugBlockingObjectEnum ICorDebugBlockingObjectEnum; -#endif /* __ICorDebugBlockingObjectEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugBlockingObjectEnum_FWD_DEFINED__ */ #ifndef __ICorDebugMDA_FWD_DEFINED__ #define __ICorDebugMDA_FWD_DEFINED__ typedef interface ICorDebugMDA ICorDebugMDA; -#endif /* __ICorDebugMDA_FWD_DEFINED__ */ +#endif /* __ICorDebugMDA_FWD_DEFINED__ */ #ifndef __ICorDebugEditAndContinueErrorInfo_FWD_DEFINED__ #define __ICorDebugEditAndContinueErrorInfo_FWD_DEFINED__ typedef interface ICorDebugEditAndContinueErrorInfo ICorDebugEditAndContinueErrorInfo; -#endif /* __ICorDebugEditAndContinueErrorInfo_FWD_DEFINED__ */ +#endif /* __ICorDebugEditAndContinueErrorInfo_FWD_DEFINED__ */ #ifndef __ICorDebugEditAndContinueSnapshot_FWD_DEFINED__ #define __ICorDebugEditAndContinueSnapshot_FWD_DEFINED__ typedef interface ICorDebugEditAndContinueSnapshot ICorDebugEditAndContinueSnapshot; -#endif /* __ICorDebugEditAndContinueSnapshot_FWD_DEFINED__ */ +#endif /* __ICorDebugEditAndContinueSnapshot_FWD_DEFINED__ */ #ifndef __ICorDebugExceptionObjectCallStackEnum_FWD_DEFINED__ #define __ICorDebugExceptionObjectCallStackEnum_FWD_DEFINED__ typedef interface ICorDebugExceptionObjectCallStackEnum ICorDebugExceptionObjectCallStackEnum; -#endif /* __ICorDebugExceptionObjectCallStackEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugExceptionObjectCallStackEnum_FWD_DEFINED__ */ #ifndef __ICorDebugExceptionObjectValue_FWD_DEFINED__ #define __ICorDebugExceptionObjectValue_FWD_DEFINED__ typedef interface ICorDebugExceptionObjectValue ICorDebugExceptionObjectValue; -#endif /* __ICorDebugExceptionObjectValue_FWD_DEFINED__ */ +#endif /* __ICorDebugExceptionObjectValue_FWD_DEFINED__ */ #ifndef __CorDebug_FWD_DEFINED__ @@ -964,7 +978,7 @@ typedef class CorDebug CorDebug; typedef struct CorDebug CorDebug; #endif /* __cplusplus */ -#endif /* __CorDebug_FWD_DEFINED__ */ +#endif /* __CorDebug_FWD_DEFINED__ */ #ifndef __EmbeddedCLRCorDebug_FWD_DEFINED__ @@ -976,238 +990,238 @@ typedef class EmbeddedCLRCorDebug EmbeddedCLRCorDebug; typedef struct EmbeddedCLRCorDebug EmbeddedCLRCorDebug; #endif /* __cplusplus */ -#endif /* __EmbeddedCLRCorDebug_FWD_DEFINED__ */ +#endif /* __EmbeddedCLRCorDebug_FWD_DEFINED__ */ #ifndef __ICorDebugValue_FWD_DEFINED__ #define __ICorDebugValue_FWD_DEFINED__ typedef interface ICorDebugValue ICorDebugValue; -#endif /* __ICorDebugValue_FWD_DEFINED__ */ +#endif /* __ICorDebugValue_FWD_DEFINED__ */ #ifndef __ICorDebugReferenceValue_FWD_DEFINED__ #define __ICorDebugReferenceValue_FWD_DEFINED__ typedef interface ICorDebugReferenceValue ICorDebugReferenceValue; -#endif /* __ICorDebugReferenceValue_FWD_DEFINED__ */ +#endif /* __ICorDebugReferenceValue_FWD_DEFINED__ */ #ifndef __ICorDebugHeapValue_FWD_DEFINED__ #define __ICorDebugHeapValue_FWD_DEFINED__ typedef interface ICorDebugHeapValue ICorDebugHeapValue; -#endif /* __ICorDebugHeapValue_FWD_DEFINED__ */ +#endif /* __ICorDebugHeapValue_FWD_DEFINED__ */ #ifndef __ICorDebugStringValue_FWD_DEFINED__ #define __ICorDebugStringValue_FWD_DEFINED__ typedef interface ICorDebugStringValue ICorDebugStringValue; -#endif /* __ICorDebugStringValue_FWD_DEFINED__ */ +#endif /* __ICorDebugStringValue_FWD_DEFINED__ */ #ifndef __ICorDebugGenericValue_FWD_DEFINED__ #define __ICorDebugGenericValue_FWD_DEFINED__ typedef interface ICorDebugGenericValue ICorDebugGenericValue; -#endif /* __ICorDebugGenericValue_FWD_DEFINED__ */ +#endif /* __ICorDebugGenericValue_FWD_DEFINED__ */ #ifndef __ICorDebugBoxValue_FWD_DEFINED__ #define __ICorDebugBoxValue_FWD_DEFINED__ typedef interface ICorDebugBoxValue ICorDebugBoxValue; -#endif /* __ICorDebugBoxValue_FWD_DEFINED__ */ +#endif /* __ICorDebugBoxValue_FWD_DEFINED__ */ #ifndef __ICorDebugArrayValue_FWD_DEFINED__ #define __ICorDebugArrayValue_FWD_DEFINED__ typedef interface ICorDebugArrayValue ICorDebugArrayValue; -#endif /* __ICorDebugArrayValue_FWD_DEFINED__ */ +#endif /* __ICorDebugArrayValue_FWD_DEFINED__ */ #ifndef __ICorDebugFrame_FWD_DEFINED__ #define __ICorDebugFrame_FWD_DEFINED__ typedef interface ICorDebugFrame ICorDebugFrame; -#endif /* __ICorDebugFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugFrame_FWD_DEFINED__ */ #ifndef __ICorDebugILFrame_FWD_DEFINED__ #define __ICorDebugILFrame_FWD_DEFINED__ typedef interface ICorDebugILFrame ICorDebugILFrame; -#endif /* __ICorDebugILFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugILFrame_FWD_DEFINED__ */ #ifndef __ICorDebugInternalFrame_FWD_DEFINED__ #define __ICorDebugInternalFrame_FWD_DEFINED__ typedef interface ICorDebugInternalFrame ICorDebugInternalFrame; -#endif /* __ICorDebugInternalFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugInternalFrame_FWD_DEFINED__ */ #ifndef __ICorDebugInternalFrame2_FWD_DEFINED__ #define __ICorDebugInternalFrame2_FWD_DEFINED__ typedef interface ICorDebugInternalFrame2 ICorDebugInternalFrame2; -#endif /* __ICorDebugInternalFrame2_FWD_DEFINED__ */ +#endif /* __ICorDebugInternalFrame2_FWD_DEFINED__ */ #ifndef __ICorDebugNativeFrame_FWD_DEFINED__ #define __ICorDebugNativeFrame_FWD_DEFINED__ typedef interface ICorDebugNativeFrame ICorDebugNativeFrame; -#endif /* __ICorDebugNativeFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugNativeFrame_FWD_DEFINED__ */ #ifndef __ICorDebugNativeFrame2_FWD_DEFINED__ #define __ICorDebugNativeFrame2_FWD_DEFINED__ typedef interface ICorDebugNativeFrame2 ICorDebugNativeFrame2; -#endif /* __ICorDebugNativeFrame2_FWD_DEFINED__ */ +#endif /* __ICorDebugNativeFrame2_FWD_DEFINED__ */ #ifndef __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ #define __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ typedef interface ICorDebugRuntimeUnwindableFrame ICorDebugRuntimeUnwindableFrame; -#endif /* __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ */ #ifndef __ICorDebugManagedCallback2_FWD_DEFINED__ #define __ICorDebugManagedCallback2_FWD_DEFINED__ typedef interface ICorDebugManagedCallback2 ICorDebugManagedCallback2; -#endif /* __ICorDebugManagedCallback2_FWD_DEFINED__ */ +#endif /* __ICorDebugManagedCallback2_FWD_DEFINED__ */ #ifndef __ICorDebugAppDomain2_FWD_DEFINED__ #define __ICorDebugAppDomain2_FWD_DEFINED__ typedef interface ICorDebugAppDomain2 ICorDebugAppDomain2; -#endif /* __ICorDebugAppDomain2_FWD_DEFINED__ */ +#endif /* __ICorDebugAppDomain2_FWD_DEFINED__ */ #ifndef __ICorDebugAppDomain3_FWD_DEFINED__ #define __ICorDebugAppDomain3_FWD_DEFINED__ typedef interface ICorDebugAppDomain3 ICorDebugAppDomain3; -#endif /* __ICorDebugAppDomain3_FWD_DEFINED__ */ +#endif /* __ICorDebugAppDomain3_FWD_DEFINED__ */ #ifndef __ICorDebugAssembly2_FWD_DEFINED__ #define __ICorDebugAssembly2_FWD_DEFINED__ typedef interface ICorDebugAssembly2 ICorDebugAssembly2; -#endif /* __ICorDebugAssembly2_FWD_DEFINED__ */ +#endif /* __ICorDebugAssembly2_FWD_DEFINED__ */ #ifndef __ICorDebugProcess2_FWD_DEFINED__ #define __ICorDebugProcess2_FWD_DEFINED__ typedef interface ICorDebugProcess2 ICorDebugProcess2; -#endif /* __ICorDebugProcess2_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess2_FWD_DEFINED__ */ #ifndef __ICorDebugStepper2_FWD_DEFINED__ #define __ICorDebugStepper2_FWD_DEFINED__ typedef interface ICorDebugStepper2 ICorDebugStepper2; -#endif /* __ICorDebugStepper2_FWD_DEFINED__ */ +#endif /* __ICorDebugStepper2_FWD_DEFINED__ */ #ifndef __ICorDebugThread2_FWD_DEFINED__ #define __ICorDebugThread2_FWD_DEFINED__ typedef interface ICorDebugThread2 ICorDebugThread2; -#endif /* __ICorDebugThread2_FWD_DEFINED__ */ +#endif /* __ICorDebugThread2_FWD_DEFINED__ */ #ifndef __ICorDebugThread3_FWD_DEFINED__ #define __ICorDebugThread3_FWD_DEFINED__ typedef interface ICorDebugThread3 ICorDebugThread3; -#endif /* __ICorDebugThread3_FWD_DEFINED__ */ +#endif /* __ICorDebugThread3_FWD_DEFINED__ */ #ifndef __ICorDebugILFrame2_FWD_DEFINED__ #define __ICorDebugILFrame2_FWD_DEFINED__ typedef interface ICorDebugILFrame2 ICorDebugILFrame2; -#endif /* __ICorDebugILFrame2_FWD_DEFINED__ */ +#endif /* __ICorDebugILFrame2_FWD_DEFINED__ */ #ifndef __ICorDebugModule2_FWD_DEFINED__ #define __ICorDebugModule2_FWD_DEFINED__ typedef interface ICorDebugModule2 ICorDebugModule2; -#endif /* __ICorDebugModule2_FWD_DEFINED__ */ +#endif /* __ICorDebugModule2_FWD_DEFINED__ */ #ifndef __ICorDebugFunction2_FWD_DEFINED__ #define __ICorDebugFunction2_FWD_DEFINED__ typedef interface ICorDebugFunction2 ICorDebugFunction2; -#endif /* __ICorDebugFunction2_FWD_DEFINED__ */ +#endif /* __ICorDebugFunction2_FWD_DEFINED__ */ #ifndef __ICorDebugClass2_FWD_DEFINED__ #define __ICorDebugClass2_FWD_DEFINED__ typedef interface ICorDebugClass2 ICorDebugClass2; -#endif /* __ICorDebugClass2_FWD_DEFINED__ */ +#endif /* __ICorDebugClass2_FWD_DEFINED__ */ #ifndef __ICorDebugEval2_FWD_DEFINED__ #define __ICorDebugEval2_FWD_DEFINED__ typedef interface ICorDebugEval2 ICorDebugEval2; -#endif /* __ICorDebugEval2_FWD_DEFINED__ */ +#endif /* __ICorDebugEval2_FWD_DEFINED__ */ #ifndef __ICorDebugValue2_FWD_DEFINED__ #define __ICorDebugValue2_FWD_DEFINED__ typedef interface ICorDebugValue2 ICorDebugValue2; -#endif /* __ICorDebugValue2_FWD_DEFINED__ */ +#endif /* __ICorDebugValue2_FWD_DEFINED__ */ #ifndef __ICorDebugObjectValue2_FWD_DEFINED__ #define __ICorDebugObjectValue2_FWD_DEFINED__ typedef interface ICorDebugObjectValue2 ICorDebugObjectValue2; -#endif /* __ICorDebugObjectValue2_FWD_DEFINED__ */ +#endif /* __ICorDebugObjectValue2_FWD_DEFINED__ */ #ifndef __ICorDebugHandleValue_FWD_DEFINED__ #define __ICorDebugHandleValue_FWD_DEFINED__ typedef interface ICorDebugHandleValue ICorDebugHandleValue; -#endif /* __ICorDebugHandleValue_FWD_DEFINED__ */ +#endif /* __ICorDebugHandleValue_FWD_DEFINED__ */ #ifndef __ICorDebugHeapValue2_FWD_DEFINED__ #define __ICorDebugHeapValue2_FWD_DEFINED__ typedef interface ICorDebugHeapValue2 ICorDebugHeapValue2; -#endif /* __ICorDebugHeapValue2_FWD_DEFINED__ */ +#endif /* __ICorDebugHeapValue2_FWD_DEFINED__ */ #ifndef __ICorDebugComObjectValue_FWD_DEFINED__ #define __ICorDebugComObjectValue_FWD_DEFINED__ typedef interface ICorDebugComObjectValue ICorDebugComObjectValue; -#endif /* __ICorDebugComObjectValue_FWD_DEFINED__ */ +#endif /* __ICorDebugComObjectValue_FWD_DEFINED__ */ #ifndef __ICorDebugModule3_FWD_DEFINED__ #define __ICorDebugModule3_FWD_DEFINED__ typedef interface ICorDebugModule3 ICorDebugModule3; -#endif /* __ICorDebugModule3_FWD_DEFINED__ */ +#endif /* __ICorDebugModule3_FWD_DEFINED__ */ /* header files for imported files */ @@ -1269,7 +1283,7 @@ typedef struct _COR_IL_MAP ULONG32 oldOffset; ULONG32 newOffset; BOOL fAccurate; - } COR_IL_MAP; + } COR_IL_MAP; #endif //_COR_IL_MAP #ifndef _COR_DEBUG_IL_TO_NATIVE_MAP_ @@ -1277,39 +1291,39 @@ typedef struct _COR_IL_MAP typedef enum CorDebugIlToNativeMappingTypes { - NO_MAPPING = -1, - PROLOG = -2, - EPILOG = -3 - } CorDebugIlToNativeMappingTypes; + NO_MAPPING = -1, + PROLOG = -2, + EPILOG = -3 + } CorDebugIlToNativeMappingTypes; typedef struct COR_DEBUG_IL_TO_NATIVE_MAP { ULONG32 ilOffset; ULONG32 nativeStartOffset; ULONG32 nativeEndOffset; - } COR_DEBUG_IL_TO_NATIVE_MAP; + } COR_DEBUG_IL_TO_NATIVE_MAP; #endif // _COR_DEBUG_IL_TO_NATIVE_MAP_ #define REMOTE_DEBUGGING_DLL_ENTRY L"Software\\Microsoft\\.NETFramework\\Debugger\\ActivateRemoteDebugging" typedef enum CorDebugJITCompilerFlags { - CORDEBUG_JIT_DEFAULT = 0x1, - CORDEBUG_JIT_DISABLE_OPTIMIZATION = 0x3, - CORDEBUG_JIT_ENABLE_ENC = 0x7 - } CorDebugJITCompilerFlags; + CORDEBUG_JIT_DEFAULT = 0x1, + CORDEBUG_JIT_DISABLE_OPTIMIZATION = 0x3, + CORDEBUG_JIT_ENABLE_ENC = 0x7 + } CorDebugJITCompilerFlags; typedef enum CorDebugJITCompilerFlagsDecprecated { - CORDEBUG_JIT_TRACK_DEBUG_INFO = 0x1 - } CorDebugJITCompilerFlagsDeprecated; + CORDEBUG_JIT_TRACK_DEBUG_INFO = 0x1 + } CorDebugJITCompilerFlagsDeprecated; typedef enum CorDebugNGENPolicy { - DISABLE_LOCAL_NIC = 1 - } CorDebugNGENPolicy; + DISABLE_LOCAL_NIC = 1 + } CorDebugNGENPolicy; #pragma warning(push) #pragma warning(disable:28718) @@ -1388,17 +1402,17 @@ typedef DWORD CORDB_CONTINUE_STATUS; typedef enum CorDebugBlockingReason { - BLOCKING_NONE = 0, - BLOCKING_MONITOR_CRITICAL_SECTION = 0x1, - BLOCKING_MONITOR_EVENT = 0x2 - } CorDebugBlockingReason; + BLOCKING_NONE = 0, + BLOCKING_MONITOR_CRITICAL_SECTION = 0x1, + BLOCKING_MONITOR_EVENT = 0x2 + } CorDebugBlockingReason; typedef struct CorDebugBlockingObject { ICorDebugValue *pBlockingObject; DWORD dwTimeout; CorDebugBlockingReason blockingReason; - } CorDebugBlockingObject; + } CorDebugBlockingObject; typedef struct CorDebugExceptionObjectStackFrame { @@ -1406,13 +1420,13 @@ typedef struct CorDebugExceptionObjectStackFrame CORDB_ADDRESS ip; mdMethodDef methodDef; BOOL isLastForeignExceptionFrame; - } CorDebugExceptionObjectStackFrame; + } CorDebugExceptionObjectStackFrame; typedef struct CorDebugGuidToTypeMapping { GUID iid; ICorDebugType *pType; - } CorDebugGuidToTypeMapping; + } CorDebugGuidToTypeMapping; @@ -1428,19 +1442,19 @@ extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0000_v0_0_s_ifspec; typedef enum CorDebugPlatform { - CORDB_PLATFORM_WINDOWS_X86 = 0, - CORDB_PLATFORM_WINDOWS_AMD64 = ( CORDB_PLATFORM_WINDOWS_X86 + 1 ) , - CORDB_PLATFORM_WINDOWS_IA64 = ( CORDB_PLATFORM_WINDOWS_AMD64 + 1 ) , - CORDB_PLATFORM_MAC_PPC = ( CORDB_PLATFORM_WINDOWS_IA64 + 1 ) , - CORDB_PLATFORM_MAC_X86 = ( CORDB_PLATFORM_MAC_PPC + 1 ) , - CORDB_PLATFORM_WINDOWS_ARM = ( CORDB_PLATFORM_MAC_X86 + 1 ) , - CORDB_PLATFORM_MAC_AMD64 = ( CORDB_PLATFORM_WINDOWS_ARM + 1 ) , - CORDB_PLATFORM_WINDOWS_ARM64 = ( CORDB_PLATFORM_MAC_AMD64 + 1 ) , - CORDB_PLATFORM_POSIX_AMD64 = ( CORDB_PLATFORM_WINDOWS_ARM64 + 1 ) , - CORDB_PLATFORM_POSIX_X86 = ( CORDB_PLATFORM_POSIX_AMD64 + 1 ) , - CORDB_PLATFORM_POSIX_ARM = ( CORDB_PLATFORM_POSIX_X86 + 1 ) , - CORDB_PLATFORM_POSIX_ARM64 = ( CORDB_PLATFORM_POSIX_ARM + 1 ) - } CorDebugPlatform; + CORDB_PLATFORM_WINDOWS_X86 = 0, + CORDB_PLATFORM_WINDOWS_AMD64 = ( CORDB_PLATFORM_WINDOWS_X86 + 1 ) , + CORDB_PLATFORM_WINDOWS_IA64 = ( CORDB_PLATFORM_WINDOWS_AMD64 + 1 ) , + CORDB_PLATFORM_MAC_PPC = ( CORDB_PLATFORM_WINDOWS_IA64 + 1 ) , + CORDB_PLATFORM_MAC_X86 = ( CORDB_PLATFORM_MAC_PPC + 1 ) , + CORDB_PLATFORM_WINDOWS_ARM = ( CORDB_PLATFORM_MAC_X86 + 1 ) , + CORDB_PLATFORM_MAC_AMD64 = ( CORDB_PLATFORM_WINDOWS_ARM + 1 ) , + CORDB_PLATFORM_WINDOWS_ARM64 = ( CORDB_PLATFORM_MAC_AMD64 + 1 ) , + CORDB_PLATFORM_POSIX_AMD64 = ( CORDB_PLATFORM_WINDOWS_ARM64 + 1 ) , + CORDB_PLATFORM_POSIX_X86 = ( CORDB_PLATFORM_POSIX_AMD64 + 1 ) , + CORDB_PLATFORM_POSIX_ARM = ( CORDB_PLATFORM_POSIX_X86 + 1 ) , + CORDB_PLATFORM_POSIX_ARM64 = ( CORDB_PLATFORM_POSIX_ARM + 1 ) + } CorDebugPlatform; EXTERN_C const IID IID_ICorDebugDataTarget; @@ -1469,7 +1483,7 @@ EXTERN_C const IID IID_ICorDebugDataTarget; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugDataTargetVtbl { @@ -1518,34 +1532,34 @@ EXTERN_C const IID IID_ICorDebugDataTarget; #ifdef COBJMACROS -#define ICorDebugDataTarget_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugDataTarget_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugDataTarget_AddRef(This) \ +#define ICorDebugDataTarget_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugDataTarget_Release(This) \ +#define ICorDebugDataTarget_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugDataTarget_GetPlatform(This,pTargetPlatform) \ +#define ICorDebugDataTarget_GetPlatform(This,pTargetPlatform) \ ( (This)->lpVtbl -> GetPlatform(This,pTargetPlatform) ) -#define ICorDebugDataTarget_ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) \ +#define ICorDebugDataTarget_ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) \ ( (This)->lpVtbl -> ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) ) -#define ICorDebugDataTarget_GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) \ +#define ICorDebugDataTarget_GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) \ ( (This)->lpVtbl -> GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugDataTarget_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugDataTarget_INTERFACE_DEFINED__ */ #ifndef __ICorDebugStaticFieldSymbol_INTERFACE_DEFINED__ @@ -1577,7 +1591,7 @@ EXTERN_C const IID IID_ICorDebugStaticFieldSymbol; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugStaticFieldSymbolVtbl { @@ -1622,34 +1636,34 @@ EXTERN_C const IID IID_ICorDebugStaticFieldSymbol; #ifdef COBJMACROS -#define ICorDebugStaticFieldSymbol_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugStaticFieldSymbol_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugStaticFieldSymbol_AddRef(This) \ +#define ICorDebugStaticFieldSymbol_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugStaticFieldSymbol_Release(This) \ +#define ICorDebugStaticFieldSymbol_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugStaticFieldSymbol_GetName(This,cchName,pcchName,szName) \ +#define ICorDebugStaticFieldSymbol_GetName(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) -#define ICorDebugStaticFieldSymbol_GetSize(This,pcbSize) \ +#define ICorDebugStaticFieldSymbol_GetSize(This,pcbSize) \ ( (This)->lpVtbl -> GetSize(This,pcbSize) ) -#define ICorDebugStaticFieldSymbol_GetAddress(This,pRVA) \ +#define ICorDebugStaticFieldSymbol_GetAddress(This,pRVA) \ ( (This)->lpVtbl -> GetAddress(This,pRVA) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugStaticFieldSymbol_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugStaticFieldSymbol_INTERFACE_DEFINED__ */ #ifndef __ICorDebugInstanceFieldSymbol_INTERFACE_DEFINED__ @@ -1681,7 +1695,7 @@ EXTERN_C const IID IID_ICorDebugInstanceFieldSymbol; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugInstanceFieldSymbolVtbl { @@ -1726,34 +1740,34 @@ EXTERN_C const IID IID_ICorDebugInstanceFieldSymbol; #ifdef COBJMACROS -#define ICorDebugInstanceFieldSymbol_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugInstanceFieldSymbol_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugInstanceFieldSymbol_AddRef(This) \ +#define ICorDebugInstanceFieldSymbol_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugInstanceFieldSymbol_Release(This) \ +#define ICorDebugInstanceFieldSymbol_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugInstanceFieldSymbol_GetName(This,cchName,pcchName,szName) \ +#define ICorDebugInstanceFieldSymbol_GetName(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) -#define ICorDebugInstanceFieldSymbol_GetSize(This,pcbSize) \ +#define ICorDebugInstanceFieldSymbol_GetSize(This,pcbSize) \ ( (This)->lpVtbl -> GetSize(This,pcbSize) ) -#define ICorDebugInstanceFieldSymbol_GetOffset(This,pcbOffset) \ +#define ICorDebugInstanceFieldSymbol_GetOffset(This,pcbOffset) \ ( (This)->lpVtbl -> GetOffset(This,pcbOffset) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugInstanceFieldSymbol_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugInstanceFieldSymbol_INTERFACE_DEFINED__ */ #ifndef __ICorDebugVariableSymbol_INTERFACE_DEFINED__ @@ -1801,7 +1815,7 @@ EXTERN_C const IID IID_ICorDebugVariableSymbol; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugVariableSymbolVtbl { @@ -1864,40 +1878,40 @@ EXTERN_C const IID IID_ICorDebugVariableSymbol; #ifdef COBJMACROS -#define ICorDebugVariableSymbol_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugVariableSymbol_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugVariableSymbol_AddRef(This) \ +#define ICorDebugVariableSymbol_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugVariableSymbol_Release(This) \ +#define ICorDebugVariableSymbol_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugVariableSymbol_GetName(This,cchName,pcchName,szName) \ +#define ICorDebugVariableSymbol_GetName(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) -#define ICorDebugVariableSymbol_GetSize(This,pcbValue) \ +#define ICorDebugVariableSymbol_GetSize(This,pcbValue) \ ( (This)->lpVtbl -> GetSize(This,pcbValue) ) -#define ICorDebugVariableSymbol_GetValue(This,offset,cbContext,context,cbValue,pcbValue,pValue) \ +#define ICorDebugVariableSymbol_GetValue(This,offset,cbContext,context,cbValue,pcbValue,pValue) \ ( (This)->lpVtbl -> GetValue(This,offset,cbContext,context,cbValue,pcbValue,pValue) ) -#define ICorDebugVariableSymbol_SetValue(This,offset,threadID,cbContext,context,cbValue,pValue) \ +#define ICorDebugVariableSymbol_SetValue(This,offset,threadID,cbContext,context,cbValue,pValue) \ ( (This)->lpVtbl -> SetValue(This,offset,threadID,cbContext,context,cbValue,pValue) ) -#define ICorDebugVariableSymbol_GetSlotIndex(This,pSlotIndex) \ +#define ICorDebugVariableSymbol_GetSlotIndex(This,pSlotIndex) \ ( (This)->lpVtbl -> GetSlotIndex(This,pSlotIndex) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugVariableSymbol_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugVariableSymbol_INTERFACE_DEFINED__ */ #ifndef __ICorDebugMemoryBuffer_INTERFACE_DEFINED__ @@ -1924,7 +1938,7 @@ EXTERN_C const IID IID_ICorDebugMemoryBuffer; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugMemoryBufferVtbl { @@ -1963,31 +1977,31 @@ EXTERN_C const IID IID_ICorDebugMemoryBuffer; #ifdef COBJMACROS -#define ICorDebugMemoryBuffer_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugMemoryBuffer_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugMemoryBuffer_AddRef(This) \ +#define ICorDebugMemoryBuffer_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugMemoryBuffer_Release(This) \ +#define ICorDebugMemoryBuffer_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugMemoryBuffer_GetStartAddress(This,address) \ +#define ICorDebugMemoryBuffer_GetStartAddress(This,address) \ ( (This)->lpVtbl -> GetStartAddress(This,address) ) -#define ICorDebugMemoryBuffer_GetSize(This,pcbBufferLength) \ +#define ICorDebugMemoryBuffer_GetSize(This,pcbBufferLength) \ ( (This)->lpVtbl -> GetSize(This,pcbBufferLength) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugMemoryBuffer_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugMemoryBuffer_INTERFACE_DEFINED__ */ #ifndef __ICorDebugMergedAssemblyRecord_INTERFACE_DEFINED__ @@ -2037,7 +2051,7 @@ EXTERN_C const IID IID_ICorDebugMergedAssemblyRecord; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugMergedAssemblyRecordVtbl { @@ -2103,43 +2117,43 @@ EXTERN_C const IID IID_ICorDebugMergedAssemblyRecord; #ifdef COBJMACROS -#define ICorDebugMergedAssemblyRecord_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugMergedAssemblyRecord_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugMergedAssemblyRecord_AddRef(This) \ +#define ICorDebugMergedAssemblyRecord_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugMergedAssemblyRecord_Release(This) \ +#define ICorDebugMergedAssemblyRecord_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugMergedAssemblyRecord_GetSimpleName(This,cchName,pcchName,szName) \ +#define ICorDebugMergedAssemblyRecord_GetSimpleName(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetSimpleName(This,cchName,pcchName,szName) ) -#define ICorDebugMergedAssemblyRecord_GetVersion(This,pMajor,pMinor,pBuild,pRevision) \ +#define ICorDebugMergedAssemblyRecord_GetVersion(This,pMajor,pMinor,pBuild,pRevision) \ ( (This)->lpVtbl -> GetVersion(This,pMajor,pMinor,pBuild,pRevision) ) -#define ICorDebugMergedAssemblyRecord_GetCulture(This,cchCulture,pcchCulture,szCulture) \ +#define ICorDebugMergedAssemblyRecord_GetCulture(This,cchCulture,pcchCulture,szCulture) \ ( (This)->lpVtbl -> GetCulture(This,cchCulture,pcchCulture,szCulture) ) -#define ICorDebugMergedAssemblyRecord_GetPublicKey(This,cbPublicKey,pcbPublicKey,pbPublicKey) \ +#define ICorDebugMergedAssemblyRecord_GetPublicKey(This,cbPublicKey,pcbPublicKey,pbPublicKey) \ ( (This)->lpVtbl -> GetPublicKey(This,cbPublicKey,pcbPublicKey,pbPublicKey) ) -#define ICorDebugMergedAssemblyRecord_GetPublicKeyToken(This,cbPublicKeyToken,pcbPublicKeyToken,pbPublicKeyToken) \ +#define ICorDebugMergedAssemblyRecord_GetPublicKeyToken(This,cbPublicKeyToken,pcbPublicKeyToken,pbPublicKeyToken) \ ( (This)->lpVtbl -> GetPublicKeyToken(This,cbPublicKeyToken,pcbPublicKeyToken,pbPublicKeyToken) ) -#define ICorDebugMergedAssemblyRecord_GetIndex(This,pIndex) \ +#define ICorDebugMergedAssemblyRecord_GetIndex(This,pIndex) \ ( (This)->lpVtbl -> GetIndex(This,pIndex) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugMergedAssemblyRecord_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugMergedAssemblyRecord_INTERFACE_DEFINED__ */ #ifndef __ICorDebugSymbolProvider_INTERFACE_DEFINED__ @@ -2223,7 +2237,7 @@ EXTERN_C const IID IID_ICorDebugSymbolProvider; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugSymbolProviderVtbl { @@ -2328,58 +2342,58 @@ EXTERN_C const IID IID_ICorDebugSymbolProvider; #ifdef COBJMACROS -#define ICorDebugSymbolProvider_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugSymbolProvider_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugSymbolProvider_AddRef(This) \ +#define ICorDebugSymbolProvider_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugSymbolProvider_Release(This) \ +#define ICorDebugSymbolProvider_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugSymbolProvider_GetStaticFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) \ +#define ICorDebugSymbolProvider_GetStaticFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) \ ( (This)->lpVtbl -> GetStaticFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) ) -#define ICorDebugSymbolProvider_GetInstanceFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) \ +#define ICorDebugSymbolProvider_GetInstanceFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) \ ( (This)->lpVtbl -> GetInstanceFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) ) -#define ICorDebugSymbolProvider_GetMethodLocalSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) \ +#define ICorDebugSymbolProvider_GetMethodLocalSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) \ ( (This)->lpVtbl -> GetMethodLocalSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) ) -#define ICorDebugSymbolProvider_GetMethodParameterSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) \ +#define ICorDebugSymbolProvider_GetMethodParameterSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) \ ( (This)->lpVtbl -> GetMethodParameterSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) ) -#define ICorDebugSymbolProvider_GetMergedAssemblyRecords(This,cRequestedRecords,pcFetchedRecords,pRecords) \ +#define ICorDebugSymbolProvider_GetMergedAssemblyRecords(This,cRequestedRecords,pcFetchedRecords,pRecords) \ ( (This)->lpVtbl -> GetMergedAssemblyRecords(This,cRequestedRecords,pcFetchedRecords,pRecords) ) -#define ICorDebugSymbolProvider_GetMethodProps(This,codeRva,pMethodToken,pcGenericParams,cbSignature,pcbSignature,signature) \ +#define ICorDebugSymbolProvider_GetMethodProps(This,codeRva,pMethodToken,pcGenericParams,cbSignature,pcbSignature,signature) \ ( (This)->lpVtbl -> GetMethodProps(This,codeRva,pMethodToken,pcGenericParams,cbSignature,pcbSignature,signature) ) -#define ICorDebugSymbolProvider_GetTypeProps(This,vtableRva,cbSignature,pcbSignature,signature) \ +#define ICorDebugSymbolProvider_GetTypeProps(This,vtableRva,cbSignature,pcbSignature,signature) \ ( (This)->lpVtbl -> GetTypeProps(This,vtableRva,cbSignature,pcbSignature,signature) ) -#define ICorDebugSymbolProvider_GetCodeRange(This,codeRva,pCodeStartAddress,pCodeSize) \ +#define ICorDebugSymbolProvider_GetCodeRange(This,codeRva,pCodeStartAddress,pCodeSize) \ ( (This)->lpVtbl -> GetCodeRange(This,codeRva,pCodeStartAddress,pCodeSize) ) -#define ICorDebugSymbolProvider_GetAssemblyImageBytes(This,rva,length,ppMemoryBuffer) \ +#define ICorDebugSymbolProvider_GetAssemblyImageBytes(This,rva,length,ppMemoryBuffer) \ ( (This)->lpVtbl -> GetAssemblyImageBytes(This,rva,length,ppMemoryBuffer) ) -#define ICorDebugSymbolProvider_GetObjectSize(This,cbSignature,typeSig,pObjectSize) \ +#define ICorDebugSymbolProvider_GetObjectSize(This,cbSignature,typeSig,pObjectSize) \ ( (This)->lpVtbl -> GetObjectSize(This,cbSignature,typeSig,pObjectSize) ) -#define ICorDebugSymbolProvider_GetAssemblyImageMetadata(This,ppMemoryBuffer) \ +#define ICorDebugSymbolProvider_GetAssemblyImageMetadata(This,ppMemoryBuffer) \ ( (This)->lpVtbl -> GetAssemblyImageMetadata(This,ppMemoryBuffer) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugSymbolProvider_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugSymbolProvider_INTERFACE_DEFINED__ */ #ifndef __ICorDebugSymbolProvider2_INTERFACE_DEFINED__ @@ -2408,7 +2422,7 @@ EXTERN_C const IID IID_ICorDebugSymbolProvider2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugSymbolProvider2Vtbl { @@ -2449,31 +2463,31 @@ EXTERN_C const IID IID_ICorDebugSymbolProvider2; #ifdef COBJMACROS -#define ICorDebugSymbolProvider2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugSymbolProvider2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugSymbolProvider2_AddRef(This) \ +#define ICorDebugSymbolProvider2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugSymbolProvider2_Release(This) \ +#define ICorDebugSymbolProvider2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugSymbolProvider2_GetGenericDictionaryInfo(This,ppMemoryBuffer) \ +#define ICorDebugSymbolProvider2_GetGenericDictionaryInfo(This,ppMemoryBuffer) \ ( (This)->lpVtbl -> GetGenericDictionaryInfo(This,ppMemoryBuffer) ) -#define ICorDebugSymbolProvider2_GetFrameProps(This,codeRva,pCodeStartRva,pParentFrameStartRva) \ +#define ICorDebugSymbolProvider2_GetFrameProps(This,codeRva,pCodeStartRva,pParentFrameStartRva) \ ( (This)->lpVtbl -> GetFrameProps(This,codeRva,pCodeStartRva,pParentFrameStartRva) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugSymbolProvider2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugSymbolProvider2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugVirtualUnwinder_INTERFACE_DEFINED__ @@ -2502,7 +2516,7 @@ EXTERN_C const IID IID_ICorDebugVirtualUnwinder; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugVirtualUnwinderVtbl { @@ -2543,31 +2557,31 @@ EXTERN_C const IID IID_ICorDebugVirtualUnwinder; #ifdef COBJMACROS -#define ICorDebugVirtualUnwinder_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugVirtualUnwinder_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugVirtualUnwinder_AddRef(This) \ +#define ICorDebugVirtualUnwinder_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugVirtualUnwinder_Release(This) \ +#define ICorDebugVirtualUnwinder_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugVirtualUnwinder_GetContext(This,contextFlags,cbContextBuf,contextSize,contextBuf) \ +#define ICorDebugVirtualUnwinder_GetContext(This,contextFlags,cbContextBuf,contextSize,contextBuf) \ ( (This)->lpVtbl -> GetContext(This,contextFlags,cbContextBuf,contextSize,contextBuf) ) -#define ICorDebugVirtualUnwinder_Next(This) \ +#define ICorDebugVirtualUnwinder_Next(This) \ ( (This)->lpVtbl -> Next(This) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugVirtualUnwinder_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugVirtualUnwinder_INTERFACE_DEFINED__ */ #ifndef __ICorDebugDataTarget2_INTERFACE_DEFINED__ @@ -2615,7 +2629,7 @@ EXTERN_C const IID IID_ICorDebugDataTarget2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugDataTarget2Vtbl { @@ -2678,40 +2692,40 @@ EXTERN_C const IID IID_ICorDebugDataTarget2; #ifdef COBJMACROS -#define ICorDebugDataTarget2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugDataTarget2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugDataTarget2_AddRef(This) \ +#define ICorDebugDataTarget2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugDataTarget2_Release(This) \ +#define ICorDebugDataTarget2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugDataTarget2_GetImageFromPointer(This,addr,pImageBase,pSize) \ +#define ICorDebugDataTarget2_GetImageFromPointer(This,addr,pImageBase,pSize) \ ( (This)->lpVtbl -> GetImageFromPointer(This,addr,pImageBase,pSize) ) -#define ICorDebugDataTarget2_GetImageLocation(This,baseAddress,cchName,pcchName,szName) \ +#define ICorDebugDataTarget2_GetImageLocation(This,baseAddress,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetImageLocation(This,baseAddress,cchName,pcchName,szName) ) -#define ICorDebugDataTarget2_GetSymbolProviderForImage(This,imageBaseAddress,ppSymProvider) \ +#define ICorDebugDataTarget2_GetSymbolProviderForImage(This,imageBaseAddress,ppSymProvider) \ ( (This)->lpVtbl -> GetSymbolProviderForImage(This,imageBaseAddress,ppSymProvider) ) -#define ICorDebugDataTarget2_EnumerateThreadIDs(This,cThreadIds,pcThreadIds,pThreadIds) \ +#define ICorDebugDataTarget2_EnumerateThreadIDs(This,cThreadIds,pcThreadIds,pThreadIds) \ ( (This)->lpVtbl -> EnumerateThreadIDs(This,cThreadIds,pcThreadIds,pThreadIds) ) -#define ICorDebugDataTarget2_CreateVirtualUnwinder(This,nativeThreadID,contextFlags,cbContext,initialContext,ppUnwinder) \ +#define ICorDebugDataTarget2_CreateVirtualUnwinder(This,nativeThreadID,contextFlags,cbContext,initialContext,ppUnwinder) \ ( (This)->lpVtbl -> CreateVirtualUnwinder(This,nativeThreadID,contextFlags,cbContext,initialContext,ppUnwinder) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugDataTarget2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugDataTarget2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugLoadedModule_INTERFACE_DEFINED__ @@ -2743,7 +2757,7 @@ EXTERN_C const IID IID_ICorDebugLoadedModule; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugLoadedModuleVtbl { @@ -2788,34 +2802,34 @@ EXTERN_C const IID IID_ICorDebugLoadedModule; #ifdef COBJMACROS -#define ICorDebugLoadedModule_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugLoadedModule_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugLoadedModule_AddRef(This) \ +#define ICorDebugLoadedModule_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugLoadedModule_Release(This) \ +#define ICorDebugLoadedModule_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugLoadedModule_GetBaseAddress(This,pAddress) \ +#define ICorDebugLoadedModule_GetBaseAddress(This,pAddress) \ ( (This)->lpVtbl -> GetBaseAddress(This,pAddress) ) -#define ICorDebugLoadedModule_GetName(This,cchName,pcchName,szName) \ +#define ICorDebugLoadedModule_GetName(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) -#define ICorDebugLoadedModule_GetSize(This,pcBytes) \ +#define ICorDebugLoadedModule_GetSize(This,pcBytes) \ ( (This)->lpVtbl -> GetSize(This,pcBytes) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugLoadedModule_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugLoadedModule_INTERFACE_DEFINED__ */ #ifndef __ICorDebugDataTarget3_INTERFACE_DEFINED__ @@ -2841,7 +2855,7 @@ EXTERN_C const IID IID_ICorDebugDataTarget3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugDataTarget3Vtbl { @@ -2878,28 +2892,28 @@ EXTERN_C const IID IID_ICorDebugDataTarget3; #ifdef COBJMACROS -#define ICorDebugDataTarget3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugDataTarget3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugDataTarget3_AddRef(This) \ +#define ICorDebugDataTarget3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugDataTarget3_Release(This) \ +#define ICorDebugDataTarget3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugDataTarget3_GetLoadedModules(This,cRequestedModules,pcFetchedModules,pLoadedModules) \ +#define ICorDebugDataTarget3_GetLoadedModules(This,cRequestedModules,pcFetchedModules,pLoadedModules) \ ( (This)->lpVtbl -> GetLoadedModules(This,cRequestedModules,pcFetchedModules,pLoadedModules) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugDataTarget3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugDataTarget3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugDataTarget4_INTERFACE_DEFINED__ @@ -2925,7 +2939,7 @@ EXTERN_C const IID IID_ICorDebugDataTarget4; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugDataTarget4Vtbl { @@ -2962,28 +2976,28 @@ EXTERN_C const IID IID_ICorDebugDataTarget4; #ifdef COBJMACROS -#define ICorDebugDataTarget4_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugDataTarget4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugDataTarget4_AddRef(This) \ +#define ICorDebugDataTarget4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugDataTarget4_Release(This) \ +#define ICorDebugDataTarget4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugDataTarget4_VirtualUnwind(This,threadId,contextSize,context) \ +#define ICorDebugDataTarget4_VirtualUnwind(This,threadId,contextSize,context) \ ( (This)->lpVtbl -> VirtualUnwind(This,threadId,contextSize,context) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugDataTarget4_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugDataTarget4_INTERFACE_DEFINED__ */ #ifndef __ICorDebugMutableDataTarget_INTERFACE_DEFINED__ @@ -3018,7 +3032,7 @@ EXTERN_C const IID IID_ICorDebugMutableDataTarget; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugMutableDataTargetVtbl { @@ -3084,44 +3098,44 @@ EXTERN_C const IID IID_ICorDebugMutableDataTarget; #ifdef COBJMACROS -#define ICorDebugMutableDataTarget_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugMutableDataTarget_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugMutableDataTarget_AddRef(This) \ +#define ICorDebugMutableDataTarget_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugMutableDataTarget_Release(This) \ +#define ICorDebugMutableDataTarget_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugMutableDataTarget_GetPlatform(This,pTargetPlatform) \ +#define ICorDebugMutableDataTarget_GetPlatform(This,pTargetPlatform) \ ( (This)->lpVtbl -> GetPlatform(This,pTargetPlatform) ) -#define ICorDebugMutableDataTarget_ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) \ +#define ICorDebugMutableDataTarget_ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) \ ( (This)->lpVtbl -> ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) ) -#define ICorDebugMutableDataTarget_GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) \ +#define ICorDebugMutableDataTarget_GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) \ ( (This)->lpVtbl -> GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) ) -#define ICorDebugMutableDataTarget_WriteVirtual(This,address,pBuffer,bytesRequested) \ +#define ICorDebugMutableDataTarget_WriteVirtual(This,address,pBuffer,bytesRequested) \ ( (This)->lpVtbl -> WriteVirtual(This,address,pBuffer,bytesRequested) ) -#define ICorDebugMutableDataTarget_SetThreadContext(This,dwThreadID,contextSize,pContext) \ +#define ICorDebugMutableDataTarget_SetThreadContext(This,dwThreadID,contextSize,pContext) \ ( (This)->lpVtbl -> SetThreadContext(This,dwThreadID,contextSize,pContext) ) -#define ICorDebugMutableDataTarget_ContinueStatusChanged(This,dwThreadId,continueStatus) \ +#define ICorDebugMutableDataTarget_ContinueStatusChanged(This,dwThreadId,continueStatus) \ ( (This)->lpVtbl -> ContinueStatusChanged(This,dwThreadId,continueStatus) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugMutableDataTarget_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugMutableDataTarget_INTERFACE_DEFINED__ */ #ifndef __ICorDebugMetaDataLocator_INTERFACE_DEFINED__ @@ -3152,7 +3166,7 @@ EXTERN_C const IID IID_ICorDebugMetaDataLocator; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugMetaDataLocatorVtbl { @@ -3194,28 +3208,28 @@ EXTERN_C const IID IID_ICorDebugMetaDataLocator; #ifdef COBJMACROS -#define ICorDebugMetaDataLocator_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugMetaDataLocator_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugMetaDataLocator_AddRef(This) \ +#define ICorDebugMetaDataLocator_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugMetaDataLocator_Release(This) \ +#define ICorDebugMetaDataLocator_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugMetaDataLocator_GetMetaData(This,wszImagePath,dwImageTimeStamp,dwImageSize,cchPathBuffer,pcchPathBuffer,wszPathBuffer) \ +#define ICorDebugMetaDataLocator_GetMetaData(This,wszImagePath,dwImageTimeStamp,dwImageSize,cchPathBuffer,pcchPathBuffer,wszPathBuffer) \ ( (This)->lpVtbl -> GetMetaData(This,wszImagePath,dwImageTimeStamp,dwImageSize,cchPathBuffer,pcchPathBuffer,wszPathBuffer) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugMetaDataLocator_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugMetaDataLocator_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0015 */ @@ -3237,40 +3251,40 @@ extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0015_v0_0_s_ifspec; typedef enum CorDebugStepReason { - STEP_NORMAL = 0, - STEP_RETURN = ( STEP_NORMAL + 1 ) , - STEP_CALL = ( STEP_RETURN + 1 ) , - STEP_EXCEPTION_FILTER = ( STEP_CALL + 1 ) , - STEP_EXCEPTION_HANDLER = ( STEP_EXCEPTION_FILTER + 1 ) , - STEP_INTERCEPT = ( STEP_EXCEPTION_HANDLER + 1 ) , - STEP_EXIT = ( STEP_INTERCEPT + 1 ) - } CorDebugStepReason; + STEP_NORMAL = 0, + STEP_RETURN = ( STEP_NORMAL + 1 ) , + STEP_CALL = ( STEP_RETURN + 1 ) , + STEP_EXCEPTION_FILTER = ( STEP_CALL + 1 ) , + STEP_EXCEPTION_HANDLER = ( STEP_EXCEPTION_FILTER + 1 ) , + STEP_INTERCEPT = ( STEP_EXCEPTION_HANDLER + 1 ) , + STEP_EXIT = ( STEP_INTERCEPT + 1 ) + } CorDebugStepReason; typedef enum LoggingLevelEnum { - LTraceLevel0 = 0, - LTraceLevel1 = ( LTraceLevel0 + 1 ) , - LTraceLevel2 = ( LTraceLevel1 + 1 ) , - LTraceLevel3 = ( LTraceLevel2 + 1 ) , - LTraceLevel4 = ( LTraceLevel3 + 1 ) , - LStatusLevel0 = 20, - LStatusLevel1 = ( LStatusLevel0 + 1 ) , - LStatusLevel2 = ( LStatusLevel1 + 1 ) , - LStatusLevel3 = ( LStatusLevel2 + 1 ) , - LStatusLevel4 = ( LStatusLevel3 + 1 ) , - LWarningLevel = 40, - LErrorLevel = 50, - LPanicLevel = 100 - } LoggingLevelEnum; + LTraceLevel0 = 0, + LTraceLevel1 = ( LTraceLevel0 + 1 ) , + LTraceLevel2 = ( LTraceLevel1 + 1 ) , + LTraceLevel3 = ( LTraceLevel2 + 1 ) , + LTraceLevel4 = ( LTraceLevel3 + 1 ) , + LStatusLevel0 = 20, + LStatusLevel1 = ( LStatusLevel0 + 1 ) , + LStatusLevel2 = ( LStatusLevel1 + 1 ) , + LStatusLevel3 = ( LStatusLevel2 + 1 ) , + LStatusLevel4 = ( LStatusLevel3 + 1 ) , + LWarningLevel = 40, + LErrorLevel = 50, + LPanicLevel = 100 + } LoggingLevelEnum; typedef enum LogSwitchCallReason { - SWITCH_CREATE = 0, - SWITCH_MODIFY = ( SWITCH_CREATE + 1 ) , - SWITCH_DELETE = ( SWITCH_MODIFY + 1 ) - } LogSwitchCallReason; + SWITCH_CREATE = 0, + SWITCH_MODIFY = ( SWITCH_CREATE + 1 ) , + SWITCH_DELETE = ( SWITCH_MODIFY + 1 ) + } LogSwitchCallReason; EXTERN_C const IID IID_ICorDebugManagedCallback; @@ -3404,7 +3418,7 @@ EXTERN_C const IID IID_ICorDebugManagedCallback; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugManagedCallbackVtbl { @@ -3581,103 +3595,103 @@ EXTERN_C const IID IID_ICorDebugManagedCallback; #ifdef COBJMACROS -#define ICorDebugManagedCallback_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugManagedCallback_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugManagedCallback_AddRef(This) \ +#define ICorDebugManagedCallback_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugManagedCallback_Release(This) \ +#define ICorDebugManagedCallback_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugManagedCallback_Breakpoint(This,pAppDomain,pThread,pBreakpoint) \ +#define ICorDebugManagedCallback_Breakpoint(This,pAppDomain,pThread,pBreakpoint) \ ( (This)->lpVtbl -> Breakpoint(This,pAppDomain,pThread,pBreakpoint) ) -#define ICorDebugManagedCallback_StepComplete(This,pAppDomain,pThread,pStepper,reason) \ +#define ICorDebugManagedCallback_StepComplete(This,pAppDomain,pThread,pStepper,reason) \ ( (This)->lpVtbl -> StepComplete(This,pAppDomain,pThread,pStepper,reason) ) -#define ICorDebugManagedCallback_Break(This,pAppDomain,thread) \ +#define ICorDebugManagedCallback_Break(This,pAppDomain,thread) \ ( (This)->lpVtbl -> Break(This,pAppDomain,thread) ) -#define ICorDebugManagedCallback_Exception(This,pAppDomain,pThread,unhandled) \ +#define ICorDebugManagedCallback_Exception(This,pAppDomain,pThread,unhandled) \ ( (This)->lpVtbl -> Exception(This,pAppDomain,pThread,unhandled) ) -#define ICorDebugManagedCallback_EvalComplete(This,pAppDomain,pThread,pEval) \ +#define ICorDebugManagedCallback_EvalComplete(This,pAppDomain,pThread,pEval) \ ( (This)->lpVtbl -> EvalComplete(This,pAppDomain,pThread,pEval) ) -#define ICorDebugManagedCallback_EvalException(This,pAppDomain,pThread,pEval) \ +#define ICorDebugManagedCallback_EvalException(This,pAppDomain,pThread,pEval) \ ( (This)->lpVtbl -> EvalException(This,pAppDomain,pThread,pEval) ) -#define ICorDebugManagedCallback_CreateProcess(This,pProcess) \ +#define ICorDebugManagedCallback_CreateProcess(This,pProcess) \ ( (This)->lpVtbl -> CreateProcess(This,pProcess) ) -#define ICorDebugManagedCallback_ExitProcess(This,pProcess) \ +#define ICorDebugManagedCallback_ExitProcess(This,pProcess) \ ( (This)->lpVtbl -> ExitProcess(This,pProcess) ) -#define ICorDebugManagedCallback_CreateThread(This,pAppDomain,thread) \ +#define ICorDebugManagedCallback_CreateThread(This,pAppDomain,thread) \ ( (This)->lpVtbl -> CreateThread(This,pAppDomain,thread) ) -#define ICorDebugManagedCallback_ExitThread(This,pAppDomain,thread) \ +#define ICorDebugManagedCallback_ExitThread(This,pAppDomain,thread) \ ( (This)->lpVtbl -> ExitThread(This,pAppDomain,thread) ) -#define ICorDebugManagedCallback_LoadModule(This,pAppDomain,pModule) \ +#define ICorDebugManagedCallback_LoadModule(This,pAppDomain,pModule) \ ( (This)->lpVtbl -> LoadModule(This,pAppDomain,pModule) ) -#define ICorDebugManagedCallback_UnloadModule(This,pAppDomain,pModule) \ +#define ICorDebugManagedCallback_UnloadModule(This,pAppDomain,pModule) \ ( (This)->lpVtbl -> UnloadModule(This,pAppDomain,pModule) ) -#define ICorDebugManagedCallback_LoadClass(This,pAppDomain,c) \ +#define ICorDebugManagedCallback_LoadClass(This,pAppDomain,c) \ ( (This)->lpVtbl -> LoadClass(This,pAppDomain,c) ) -#define ICorDebugManagedCallback_UnloadClass(This,pAppDomain,c) \ +#define ICorDebugManagedCallback_UnloadClass(This,pAppDomain,c) \ ( (This)->lpVtbl -> UnloadClass(This,pAppDomain,c) ) -#define ICorDebugManagedCallback_DebuggerError(This,pProcess,errorHR,errorCode) \ +#define ICorDebugManagedCallback_DebuggerError(This,pProcess,errorHR,errorCode) \ ( (This)->lpVtbl -> DebuggerError(This,pProcess,errorHR,errorCode) ) -#define ICorDebugManagedCallback_LogMessage(This,pAppDomain,pThread,lLevel,pLogSwitchName,pMessage) \ +#define ICorDebugManagedCallback_LogMessage(This,pAppDomain,pThread,lLevel,pLogSwitchName,pMessage) \ ( (This)->lpVtbl -> LogMessage(This,pAppDomain,pThread,lLevel,pLogSwitchName,pMessage) ) -#define ICorDebugManagedCallback_LogSwitch(This,pAppDomain,pThread,lLevel,ulReason,pLogSwitchName,pParentName) \ +#define ICorDebugManagedCallback_LogSwitch(This,pAppDomain,pThread,lLevel,ulReason,pLogSwitchName,pParentName) \ ( (This)->lpVtbl -> LogSwitch(This,pAppDomain,pThread,lLevel,ulReason,pLogSwitchName,pParentName) ) -#define ICorDebugManagedCallback_CreateAppDomain(This,pProcess,pAppDomain) \ +#define ICorDebugManagedCallback_CreateAppDomain(This,pProcess,pAppDomain) \ ( (This)->lpVtbl -> CreateAppDomain(This,pProcess,pAppDomain) ) -#define ICorDebugManagedCallback_ExitAppDomain(This,pProcess,pAppDomain) \ +#define ICorDebugManagedCallback_ExitAppDomain(This,pProcess,pAppDomain) \ ( (This)->lpVtbl -> ExitAppDomain(This,pProcess,pAppDomain) ) -#define ICorDebugManagedCallback_LoadAssembly(This,pAppDomain,pAssembly) \ +#define ICorDebugManagedCallback_LoadAssembly(This,pAppDomain,pAssembly) \ ( (This)->lpVtbl -> LoadAssembly(This,pAppDomain,pAssembly) ) -#define ICorDebugManagedCallback_UnloadAssembly(This,pAppDomain,pAssembly) \ +#define ICorDebugManagedCallback_UnloadAssembly(This,pAppDomain,pAssembly) \ ( (This)->lpVtbl -> UnloadAssembly(This,pAppDomain,pAssembly) ) -#define ICorDebugManagedCallback_ControlCTrap(This,pProcess) \ +#define ICorDebugManagedCallback_ControlCTrap(This,pProcess) \ ( (This)->lpVtbl -> ControlCTrap(This,pProcess) ) -#define ICorDebugManagedCallback_NameChange(This,pAppDomain,pThread) \ +#define ICorDebugManagedCallback_NameChange(This,pAppDomain,pThread) \ ( (This)->lpVtbl -> NameChange(This,pAppDomain,pThread) ) -#define ICorDebugManagedCallback_UpdateModuleSymbols(This,pAppDomain,pModule,pSymbolStream) \ +#define ICorDebugManagedCallback_UpdateModuleSymbols(This,pAppDomain,pModule,pSymbolStream) \ ( (This)->lpVtbl -> UpdateModuleSymbols(This,pAppDomain,pModule,pSymbolStream) ) -#define ICorDebugManagedCallback_EditAndContinueRemap(This,pAppDomain,pThread,pFunction,fAccurate) \ +#define ICorDebugManagedCallback_EditAndContinueRemap(This,pAppDomain,pThread,pFunction,fAccurate) \ ( (This)->lpVtbl -> EditAndContinueRemap(This,pAppDomain,pThread,pFunction,fAccurate) ) -#define ICorDebugManagedCallback_BreakpointSetError(This,pAppDomain,pThread,pBreakpoint,dwError) \ +#define ICorDebugManagedCallback_BreakpointSetError(This,pAppDomain,pThread,pBreakpoint,dwError) \ ( (This)->lpVtbl -> BreakpointSetError(This,pAppDomain,pThread,pBreakpoint,dwError) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugManagedCallback_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugManagedCallback_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0016 */ @@ -3712,7 +3726,7 @@ EXTERN_C const IID IID_ICorDebugManagedCallback3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugManagedCallback3Vtbl { @@ -3748,28 +3762,28 @@ EXTERN_C const IID IID_ICorDebugManagedCallback3; #ifdef COBJMACROS -#define ICorDebugManagedCallback3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugManagedCallback3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugManagedCallback3_AddRef(This) \ +#define ICorDebugManagedCallback3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugManagedCallback3_Release(This) \ +#define ICorDebugManagedCallback3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugManagedCallback3_CustomNotification(This,pThread,pAppDomain) \ +#define ICorDebugManagedCallback3_CustomNotification(This,pThread,pAppDomain) \ ( (This)->lpVtbl -> CustomNotification(This,pThread,pAppDomain) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugManagedCallback3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugManagedCallback3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugManagedCallback4_INTERFACE_DEFINED__ @@ -3802,7 +3816,7 @@ EXTERN_C const IID IID_ICorDebugManagedCallback4; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugManagedCallback4Vtbl { @@ -3848,34 +3862,34 @@ EXTERN_C const IID IID_ICorDebugManagedCallback4; #ifdef COBJMACROS -#define ICorDebugManagedCallback4_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugManagedCallback4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugManagedCallback4_AddRef(This) \ +#define ICorDebugManagedCallback4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugManagedCallback4_Release(This) \ +#define ICorDebugManagedCallback4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugManagedCallback4_BeforeGarbageCollection(This,pProcess) \ +#define ICorDebugManagedCallback4_BeforeGarbageCollection(This,pProcess) \ ( (This)->lpVtbl -> BeforeGarbageCollection(This,pProcess) ) -#define ICorDebugManagedCallback4_AfterGarbageCollection(This,pProcess) \ +#define ICorDebugManagedCallback4_AfterGarbageCollection(This,pProcess) \ ( (This)->lpVtbl -> AfterGarbageCollection(This,pProcess) ) -#define ICorDebugManagedCallback4_DataBreakpoint(This,pProcess,pThread,pContext,contextSize) \ +#define ICorDebugManagedCallback4_DataBreakpoint(This,pProcess,pThread,pContext,contextSize) \ ( (This)->lpVtbl -> DataBreakpoint(This,pProcess,pThread,pContext,contextSize) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugManagedCallback4_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugManagedCallback4_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0018 */ @@ -3896,25 +3910,25 @@ extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0018_v0_0_s_ifspec; typedef enum CorDebugExceptionCallbackType { - DEBUG_EXCEPTION_FIRST_CHANCE = 1, - DEBUG_EXCEPTION_USER_FIRST_CHANCE = 2, - DEBUG_EXCEPTION_CATCH_HANDLER_FOUND = 3, - DEBUG_EXCEPTION_UNHANDLED = 4 - } CorDebugExceptionCallbackType; + DEBUG_EXCEPTION_FIRST_CHANCE = 1, + DEBUG_EXCEPTION_USER_FIRST_CHANCE = 2, + DEBUG_EXCEPTION_CATCH_HANDLER_FOUND = 3, + DEBUG_EXCEPTION_UNHANDLED = 4 + } CorDebugExceptionCallbackType; typedef enum CorDebugExceptionFlags { - DEBUG_EXCEPTION_NONE = 0, - DEBUG_EXCEPTION_CAN_BE_INTERCEPTED = 0x1 - } CorDebugExceptionFlags; + DEBUG_EXCEPTION_NONE = 0, + DEBUG_EXCEPTION_CAN_BE_INTERCEPTED = 0x1 + } CorDebugExceptionFlags; typedef enum CorDebugExceptionUnwindCallbackType { - DEBUG_EXCEPTION_UNWIND_BEGIN = 1, - DEBUG_EXCEPTION_INTERCEPTED = 2 - } CorDebugExceptionUnwindCallbackType; + DEBUG_EXCEPTION_UNWIND_BEGIN = 1, + DEBUG_EXCEPTION_INTERCEPTED = 2 + } CorDebugExceptionUnwindCallbackType; EXTERN_C const IID IID_ICorDebugManagedCallback2; @@ -3972,7 +3986,7 @@ EXTERN_C const IID IID_ICorDebugManagedCallback2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugManagedCallback2Vtbl { @@ -4055,49 +4069,49 @@ EXTERN_C const IID IID_ICorDebugManagedCallback2; #ifdef COBJMACROS -#define ICorDebugManagedCallback2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugManagedCallback2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugManagedCallback2_AddRef(This) \ +#define ICorDebugManagedCallback2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugManagedCallback2_Release(This) \ +#define ICorDebugManagedCallback2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugManagedCallback2_FunctionRemapOpportunity(This,pAppDomain,pThread,pOldFunction,pNewFunction,oldILOffset) \ +#define ICorDebugManagedCallback2_FunctionRemapOpportunity(This,pAppDomain,pThread,pOldFunction,pNewFunction,oldILOffset) \ ( (This)->lpVtbl -> FunctionRemapOpportunity(This,pAppDomain,pThread,pOldFunction,pNewFunction,oldILOffset) ) -#define ICorDebugManagedCallback2_CreateConnection(This,pProcess,dwConnectionId,pConnName) \ +#define ICorDebugManagedCallback2_CreateConnection(This,pProcess,dwConnectionId,pConnName) \ ( (This)->lpVtbl -> CreateConnection(This,pProcess,dwConnectionId,pConnName) ) -#define ICorDebugManagedCallback2_ChangeConnection(This,pProcess,dwConnectionId) \ +#define ICorDebugManagedCallback2_ChangeConnection(This,pProcess,dwConnectionId) \ ( (This)->lpVtbl -> ChangeConnection(This,pProcess,dwConnectionId) ) -#define ICorDebugManagedCallback2_DestroyConnection(This,pProcess,dwConnectionId) \ +#define ICorDebugManagedCallback2_DestroyConnection(This,pProcess,dwConnectionId) \ ( (This)->lpVtbl -> DestroyConnection(This,pProcess,dwConnectionId) ) -#define ICorDebugManagedCallback2_Exception(This,pAppDomain,pThread,pFrame,nOffset,dwEventType,dwFlags) \ +#define ICorDebugManagedCallback2_Exception(This,pAppDomain,pThread,pFrame,nOffset,dwEventType,dwFlags) \ ( (This)->lpVtbl -> Exception(This,pAppDomain,pThread,pFrame,nOffset,dwEventType,dwFlags) ) -#define ICorDebugManagedCallback2_ExceptionUnwind(This,pAppDomain,pThread,dwEventType,dwFlags) \ +#define ICorDebugManagedCallback2_ExceptionUnwind(This,pAppDomain,pThread,dwEventType,dwFlags) \ ( (This)->lpVtbl -> ExceptionUnwind(This,pAppDomain,pThread,dwEventType,dwFlags) ) -#define ICorDebugManagedCallback2_FunctionRemapComplete(This,pAppDomain,pThread,pFunction) \ +#define ICorDebugManagedCallback2_FunctionRemapComplete(This,pAppDomain,pThread,pFunction) \ ( (This)->lpVtbl -> FunctionRemapComplete(This,pAppDomain,pThread,pFunction) ) -#define ICorDebugManagedCallback2_MDANotification(This,pController,pThread,pMDA) \ +#define ICorDebugManagedCallback2_MDANotification(This,pController,pThread,pMDA) \ ( (This)->lpVtbl -> MDANotification(This,pController,pThread,pMDA) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugManagedCallback2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugManagedCallback2_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0019 */ @@ -4131,7 +4145,7 @@ EXTERN_C const IID IID_ICorDebugUnmanagedCallback; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugUnmanagedCallbackVtbl { @@ -4167,28 +4181,28 @@ EXTERN_C const IID IID_ICorDebugUnmanagedCallback; #ifdef COBJMACROS -#define ICorDebugUnmanagedCallback_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugUnmanagedCallback_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugUnmanagedCallback_AddRef(This) \ +#define ICorDebugUnmanagedCallback_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugUnmanagedCallback_Release(This) \ +#define ICorDebugUnmanagedCallback_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugUnmanagedCallback_DebugEvent(This,pDebugEvent,fOutOfBand) \ +#define ICorDebugUnmanagedCallback_DebugEvent(This,pDebugEvent,fOutOfBand) \ ( (This)->lpVtbl -> DebugEvent(This,pDebugEvent,fOutOfBand) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugUnmanagedCallback_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugUnmanagedCallback_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0020 */ @@ -4197,15 +4211,15 @@ EXTERN_C const IID IID_ICorDebugUnmanagedCallback; typedef enum CorDebugCreateProcessFlags { - DEBUG_NO_SPECIAL_OPTIONS = 0 - } CorDebugCreateProcessFlags; + DEBUG_NO_SPECIAL_OPTIONS = 0 + } CorDebugCreateProcessFlags; typedef enum CorDebugHandleType { - HANDLE_STRONG = 1, - HANDLE_WEAK_TRACK_RESURRECTION = 2 - } CorDebugHandleType; + HANDLE_STRONG = 1, + HANDLE_WEAK_TRACK_RESURRECTION = 2 + } CorDebugHandleType; #pragma warning(push) #pragma warning(disable:28718) @@ -4272,7 +4286,7 @@ EXTERN_C const IID IID_ICorDebug; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugVtbl { @@ -4352,52 +4366,52 @@ EXTERN_C const IID IID_ICorDebug; #ifdef COBJMACROS -#define ICorDebug_QueryInterface(This,riid,ppvObject) \ +#define ICorDebug_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebug_AddRef(This) \ +#define ICorDebug_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebug_Release(This) \ +#define ICorDebug_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebug_Initialize(This) \ +#define ICorDebug_Initialize(This) \ ( (This)->lpVtbl -> Initialize(This) ) -#define ICorDebug_Terminate(This) \ +#define ICorDebug_Terminate(This) \ ( (This)->lpVtbl -> Terminate(This) ) -#define ICorDebug_SetManagedHandler(This,pCallback) \ +#define ICorDebug_SetManagedHandler(This,pCallback) \ ( (This)->lpVtbl -> SetManagedHandler(This,pCallback) ) -#define ICorDebug_SetUnmanagedHandler(This,pCallback) \ +#define ICorDebug_SetUnmanagedHandler(This,pCallback) \ ( (This)->lpVtbl -> SetUnmanagedHandler(This,pCallback) ) -#define ICorDebug_CreateProcess(This,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) \ +#define ICorDebug_CreateProcess(This,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) \ ( (This)->lpVtbl -> CreateProcess(This,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) ) -#define ICorDebug_DebugActiveProcess(This,id,win32Attach,ppProcess) \ +#define ICorDebug_DebugActiveProcess(This,id,win32Attach,ppProcess) \ ( (This)->lpVtbl -> DebugActiveProcess(This,id,win32Attach,ppProcess) ) -#define ICorDebug_EnumerateProcesses(This,ppProcess) \ +#define ICorDebug_EnumerateProcesses(This,ppProcess) \ ( (This)->lpVtbl -> EnumerateProcesses(This,ppProcess) ) -#define ICorDebug_GetProcess(This,dwProcessId,ppProcess) \ +#define ICorDebug_GetProcess(This,dwProcessId,ppProcess) \ ( (This)->lpVtbl -> GetProcess(This,dwProcessId,ppProcess) ) -#define ICorDebug_CanLaunchOrAttach(This,dwProcessId,win32DebuggingEnabled) \ +#define ICorDebug_CanLaunchOrAttach(This,dwProcessId,win32DebuggingEnabled) \ ( (This)->lpVtbl -> CanLaunchOrAttach(This,dwProcessId,win32DebuggingEnabled) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebug_INTERFACE_DEFINED__ */ +#endif /* __ICorDebug_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0021 */ @@ -4434,7 +4448,7 @@ EXTERN_C const IID IID_ICorDebugRemoteTarget; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugRemoteTargetVtbl { @@ -4473,28 +4487,28 @@ EXTERN_C const IID IID_ICorDebugRemoteTarget; #ifdef COBJMACROS -#define ICorDebugRemoteTarget_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugRemoteTarget_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugRemoteTarget_AddRef(This) \ +#define ICorDebugRemoteTarget_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugRemoteTarget_Release(This) \ +#define ICorDebugRemoteTarget_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugRemoteTarget_GetHostName(This,cchHostName,pcchHostName,szHostName) \ +#define ICorDebugRemoteTarget_GetHostName(This,cchHostName,pcchHostName,szHostName) \ ( (This)->lpVtbl -> GetHostName(This,cchHostName,pcchHostName,szHostName) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugRemoteTarget_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugRemoteTarget_INTERFACE_DEFINED__ */ #ifndef __ICorDebugRemote_INTERFACE_DEFINED__ @@ -4537,7 +4551,7 @@ EXTERN_C const IID IID_ICorDebugRemote; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugRemoteVtbl { @@ -4592,31 +4606,31 @@ EXTERN_C const IID IID_ICorDebugRemote; #ifdef COBJMACROS -#define ICorDebugRemote_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugRemote_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugRemote_AddRef(This) \ +#define ICorDebugRemote_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugRemote_Release(This) \ +#define ICorDebugRemote_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugRemote_CreateProcessEx(This,pRemoteTarget,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) \ +#define ICorDebugRemote_CreateProcessEx(This,pRemoteTarget,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) \ ( (This)->lpVtbl -> CreateProcessEx(This,pRemoteTarget,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) ) -#define ICorDebugRemote_DebugActiveProcessEx(This,pRemoteTarget,dwProcessId,fWin32Attach,ppProcess) \ +#define ICorDebugRemote_DebugActiveProcessEx(This,pRemoteTarget,dwProcessId,fWin32Attach,ppProcess) \ ( (This)->lpVtbl -> DebugActiveProcessEx(This,pRemoteTarget,dwProcessId,fWin32Attach,ppProcess) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugRemote_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugRemote_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0023 */ @@ -4628,7 +4642,7 @@ typedef struct _COR_VERSION DWORD dwMinor; DWORD dwBuild; DWORD dwSubBuild; - } COR_VERSION; + } COR_VERSION; @@ -4644,92 +4658,92 @@ extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0023_v0_0_s_ifspec; typedef enum CorDebugInterfaceVersion { - CorDebugInvalidVersion = 0, - CorDebugVersion_1_0 = ( CorDebugInvalidVersion + 1 ) , - ver_ICorDebugManagedCallback = CorDebugVersion_1_0, - ver_ICorDebugUnmanagedCallback = CorDebugVersion_1_0, - ver_ICorDebug = CorDebugVersion_1_0, - ver_ICorDebugController = CorDebugVersion_1_0, - ver_ICorDebugAppDomain = CorDebugVersion_1_0, - ver_ICorDebugAssembly = CorDebugVersion_1_0, - ver_ICorDebugProcess = CorDebugVersion_1_0, - ver_ICorDebugBreakpoint = CorDebugVersion_1_0, - ver_ICorDebugFunctionBreakpoint = CorDebugVersion_1_0, - ver_ICorDebugModuleBreakpoint = CorDebugVersion_1_0, - ver_ICorDebugValueBreakpoint = CorDebugVersion_1_0, - ver_ICorDebugStepper = CorDebugVersion_1_0, - ver_ICorDebugRegisterSet = CorDebugVersion_1_0, - ver_ICorDebugThread = CorDebugVersion_1_0, - ver_ICorDebugChain = CorDebugVersion_1_0, - ver_ICorDebugFrame = CorDebugVersion_1_0, - ver_ICorDebugILFrame = CorDebugVersion_1_0, - ver_ICorDebugNativeFrame = CorDebugVersion_1_0, - ver_ICorDebugModule = CorDebugVersion_1_0, - ver_ICorDebugFunction = CorDebugVersion_1_0, - ver_ICorDebugCode = CorDebugVersion_1_0, - ver_ICorDebugClass = CorDebugVersion_1_0, - ver_ICorDebugEval = CorDebugVersion_1_0, - ver_ICorDebugValue = CorDebugVersion_1_0, - ver_ICorDebugGenericValue = CorDebugVersion_1_0, - ver_ICorDebugReferenceValue = CorDebugVersion_1_0, - ver_ICorDebugHeapValue = CorDebugVersion_1_0, - ver_ICorDebugObjectValue = CorDebugVersion_1_0, - ver_ICorDebugBoxValue = CorDebugVersion_1_0, - ver_ICorDebugStringValue = CorDebugVersion_1_0, - ver_ICorDebugArrayValue = CorDebugVersion_1_0, - ver_ICorDebugContext = CorDebugVersion_1_0, - ver_ICorDebugEnum = CorDebugVersion_1_0, - ver_ICorDebugObjectEnum = CorDebugVersion_1_0, - ver_ICorDebugBreakpointEnum = CorDebugVersion_1_0, - ver_ICorDebugStepperEnum = CorDebugVersion_1_0, - ver_ICorDebugProcessEnum = CorDebugVersion_1_0, - ver_ICorDebugThreadEnum = CorDebugVersion_1_0, - ver_ICorDebugFrameEnum = CorDebugVersion_1_0, - ver_ICorDebugChainEnum = CorDebugVersion_1_0, - ver_ICorDebugModuleEnum = CorDebugVersion_1_0, - ver_ICorDebugValueEnum = CorDebugVersion_1_0, - ver_ICorDebugCodeEnum = CorDebugVersion_1_0, - ver_ICorDebugTypeEnum = CorDebugVersion_1_0, - ver_ICorDebugErrorInfoEnum = CorDebugVersion_1_0, - ver_ICorDebugAppDomainEnum = CorDebugVersion_1_0, - ver_ICorDebugAssemblyEnum = CorDebugVersion_1_0, - ver_ICorDebugEditAndContinueErrorInfo = CorDebugVersion_1_0, - ver_ICorDebugEditAndContinueSnapshot = CorDebugVersion_1_0, - CorDebugVersion_1_1 = ( CorDebugVersion_1_0 + 1 ) , - CorDebugVersion_2_0 = ( CorDebugVersion_1_1 + 1 ) , - ver_ICorDebugManagedCallback2 = CorDebugVersion_2_0, - ver_ICorDebugAppDomain2 = CorDebugVersion_2_0, - ver_ICorDebugAssembly2 = CorDebugVersion_2_0, - ver_ICorDebugProcess2 = CorDebugVersion_2_0, - ver_ICorDebugStepper2 = CorDebugVersion_2_0, - ver_ICorDebugRegisterSet2 = CorDebugVersion_2_0, - ver_ICorDebugThread2 = CorDebugVersion_2_0, - ver_ICorDebugILFrame2 = CorDebugVersion_2_0, - ver_ICorDebugInternalFrame = CorDebugVersion_2_0, - ver_ICorDebugModule2 = CorDebugVersion_2_0, - ver_ICorDebugFunction2 = CorDebugVersion_2_0, - ver_ICorDebugCode2 = CorDebugVersion_2_0, - ver_ICorDebugClass2 = CorDebugVersion_2_0, - ver_ICorDebugValue2 = CorDebugVersion_2_0, - ver_ICorDebugEval2 = CorDebugVersion_2_0, - ver_ICorDebugObjectValue2 = CorDebugVersion_2_0, - CorDebugVersion_4_0 = ( CorDebugVersion_2_0 + 1 ) , - ver_ICorDebugThread3 = CorDebugVersion_4_0, - ver_ICorDebugThread4 = CorDebugVersion_4_0, - ver_ICorDebugStackWalk = CorDebugVersion_4_0, - ver_ICorDebugNativeFrame2 = CorDebugVersion_4_0, - ver_ICorDebugInternalFrame2 = CorDebugVersion_4_0, - ver_ICorDebugRuntimeUnwindableFrame = CorDebugVersion_4_0, - ver_ICorDebugHeapValue3 = CorDebugVersion_4_0, - ver_ICorDebugBlockingObjectEnum = CorDebugVersion_4_0, - ver_ICorDebugValue3 = CorDebugVersion_4_0, - CorDebugVersion_4_5 = ( CorDebugVersion_4_0 + 1 ) , - ver_ICorDebugComObjectValue = CorDebugVersion_4_5, - ver_ICorDebugAppDomain3 = CorDebugVersion_4_5, - ver_ICorDebugCode3 = CorDebugVersion_4_5, - ver_ICorDebugILFrame3 = CorDebugVersion_4_5, - CorDebugLatestVersion = CorDebugVersion_4_5 - } CorDebugInterfaceVersion; + CorDebugInvalidVersion = 0, + CorDebugVersion_1_0 = ( CorDebugInvalidVersion + 1 ) , + ver_ICorDebugManagedCallback = CorDebugVersion_1_0, + ver_ICorDebugUnmanagedCallback = CorDebugVersion_1_0, + ver_ICorDebug = CorDebugVersion_1_0, + ver_ICorDebugController = CorDebugVersion_1_0, + ver_ICorDebugAppDomain = CorDebugVersion_1_0, + ver_ICorDebugAssembly = CorDebugVersion_1_0, + ver_ICorDebugProcess = CorDebugVersion_1_0, + ver_ICorDebugBreakpoint = CorDebugVersion_1_0, + ver_ICorDebugFunctionBreakpoint = CorDebugVersion_1_0, + ver_ICorDebugModuleBreakpoint = CorDebugVersion_1_0, + ver_ICorDebugValueBreakpoint = CorDebugVersion_1_0, + ver_ICorDebugStepper = CorDebugVersion_1_0, + ver_ICorDebugRegisterSet = CorDebugVersion_1_0, + ver_ICorDebugThread = CorDebugVersion_1_0, + ver_ICorDebugChain = CorDebugVersion_1_0, + ver_ICorDebugFrame = CorDebugVersion_1_0, + ver_ICorDebugILFrame = CorDebugVersion_1_0, + ver_ICorDebugNativeFrame = CorDebugVersion_1_0, + ver_ICorDebugModule = CorDebugVersion_1_0, + ver_ICorDebugFunction = CorDebugVersion_1_0, + ver_ICorDebugCode = CorDebugVersion_1_0, + ver_ICorDebugClass = CorDebugVersion_1_0, + ver_ICorDebugEval = CorDebugVersion_1_0, + ver_ICorDebugValue = CorDebugVersion_1_0, + ver_ICorDebugGenericValue = CorDebugVersion_1_0, + ver_ICorDebugReferenceValue = CorDebugVersion_1_0, + ver_ICorDebugHeapValue = CorDebugVersion_1_0, + ver_ICorDebugObjectValue = CorDebugVersion_1_0, + ver_ICorDebugBoxValue = CorDebugVersion_1_0, + ver_ICorDebugStringValue = CorDebugVersion_1_0, + ver_ICorDebugArrayValue = CorDebugVersion_1_0, + ver_ICorDebugContext = CorDebugVersion_1_0, + ver_ICorDebugEnum = CorDebugVersion_1_0, + ver_ICorDebugObjectEnum = CorDebugVersion_1_0, + ver_ICorDebugBreakpointEnum = CorDebugVersion_1_0, + ver_ICorDebugStepperEnum = CorDebugVersion_1_0, + ver_ICorDebugProcessEnum = CorDebugVersion_1_0, + ver_ICorDebugThreadEnum = CorDebugVersion_1_0, + ver_ICorDebugFrameEnum = CorDebugVersion_1_0, + ver_ICorDebugChainEnum = CorDebugVersion_1_0, + ver_ICorDebugModuleEnum = CorDebugVersion_1_0, + ver_ICorDebugValueEnum = CorDebugVersion_1_0, + ver_ICorDebugCodeEnum = CorDebugVersion_1_0, + ver_ICorDebugTypeEnum = CorDebugVersion_1_0, + ver_ICorDebugErrorInfoEnum = CorDebugVersion_1_0, + ver_ICorDebugAppDomainEnum = CorDebugVersion_1_0, + ver_ICorDebugAssemblyEnum = CorDebugVersion_1_0, + ver_ICorDebugEditAndContinueErrorInfo = CorDebugVersion_1_0, + ver_ICorDebugEditAndContinueSnapshot = CorDebugVersion_1_0, + CorDebugVersion_1_1 = ( CorDebugVersion_1_0 + 1 ) , + CorDebugVersion_2_0 = ( CorDebugVersion_1_1 + 1 ) , + ver_ICorDebugManagedCallback2 = CorDebugVersion_2_0, + ver_ICorDebugAppDomain2 = CorDebugVersion_2_0, + ver_ICorDebugAssembly2 = CorDebugVersion_2_0, + ver_ICorDebugProcess2 = CorDebugVersion_2_0, + ver_ICorDebugStepper2 = CorDebugVersion_2_0, + ver_ICorDebugRegisterSet2 = CorDebugVersion_2_0, + ver_ICorDebugThread2 = CorDebugVersion_2_0, + ver_ICorDebugILFrame2 = CorDebugVersion_2_0, + ver_ICorDebugInternalFrame = CorDebugVersion_2_0, + ver_ICorDebugModule2 = CorDebugVersion_2_0, + ver_ICorDebugFunction2 = CorDebugVersion_2_0, + ver_ICorDebugCode2 = CorDebugVersion_2_0, + ver_ICorDebugClass2 = CorDebugVersion_2_0, + ver_ICorDebugValue2 = CorDebugVersion_2_0, + ver_ICorDebugEval2 = CorDebugVersion_2_0, + ver_ICorDebugObjectValue2 = CorDebugVersion_2_0, + CorDebugVersion_4_0 = ( CorDebugVersion_2_0 + 1 ) , + ver_ICorDebugThread3 = CorDebugVersion_4_0, + ver_ICorDebugThread4 = CorDebugVersion_4_0, + ver_ICorDebugStackWalk = CorDebugVersion_4_0, + ver_ICorDebugNativeFrame2 = CorDebugVersion_4_0, + ver_ICorDebugInternalFrame2 = CorDebugVersion_4_0, + ver_ICorDebugRuntimeUnwindableFrame = CorDebugVersion_4_0, + ver_ICorDebugHeapValue3 = CorDebugVersion_4_0, + ver_ICorDebugBlockingObjectEnum = CorDebugVersion_4_0, + ver_ICorDebugValue3 = CorDebugVersion_4_0, + CorDebugVersion_4_5 = ( CorDebugVersion_4_0 + 1 ) , + ver_ICorDebugComObjectValue = CorDebugVersion_4_5, + ver_ICorDebugAppDomain3 = CorDebugVersion_4_5, + ver_ICorDebugCode3 = CorDebugVersion_4_5, + ver_ICorDebugILFrame3 = CorDebugVersion_4_5, + CorDebugLatestVersion = CorDebugVersion_4_5 + } CorDebugInterfaceVersion; EXTERN_C const IID IID_ICorDebug2; @@ -4743,7 +4757,7 @@ EXTERN_C const IID IID_ICorDebug2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebug2Vtbl { @@ -4774,25 +4788,25 @@ EXTERN_C const IID IID_ICorDebug2; #ifdef COBJMACROS -#define ICorDebug2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebug2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebug2_AddRef(This) \ +#define ICorDebug2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebug2_Release(This) \ +#define ICorDebug2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebug2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebug2_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0024 */ @@ -4801,9 +4815,9 @@ EXTERN_C const IID IID_ICorDebug2; typedef enum CorDebugThreadState { - THREAD_RUN = 0, - THREAD_SUSPEND = ( THREAD_RUN + 1 ) - } CorDebugThreadState; + THREAD_RUN = 0, + THREAD_SUSPEND = ( THREAD_RUN + 1 ) + } CorDebugThreadState; @@ -4863,7 +4877,7 @@ EXTERN_C const IID IID_ICorDebugController; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugControllerVtbl { @@ -4939,55 +4953,55 @@ EXTERN_C const IID IID_ICorDebugController; #ifdef COBJMACROS -#define ICorDebugController_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugController_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugController_AddRef(This) \ +#define ICorDebugController_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugController_Release(This) \ +#define ICorDebugController_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugController_Stop(This,dwTimeoutIgnored) \ +#define ICorDebugController_Stop(This,dwTimeoutIgnored) \ ( (This)->lpVtbl -> Stop(This,dwTimeoutIgnored) ) -#define ICorDebugController_Continue(This,fIsOutOfBand) \ +#define ICorDebugController_Continue(This,fIsOutOfBand) \ ( (This)->lpVtbl -> Continue(This,fIsOutOfBand) ) -#define ICorDebugController_IsRunning(This,pbRunning) \ +#define ICorDebugController_IsRunning(This,pbRunning) \ ( (This)->lpVtbl -> IsRunning(This,pbRunning) ) -#define ICorDebugController_HasQueuedCallbacks(This,pThread,pbQueued) \ +#define ICorDebugController_HasQueuedCallbacks(This,pThread,pbQueued) \ ( (This)->lpVtbl -> HasQueuedCallbacks(This,pThread,pbQueued) ) -#define ICorDebugController_EnumerateThreads(This,ppThreads) \ +#define ICorDebugController_EnumerateThreads(This,ppThreads) \ ( (This)->lpVtbl -> EnumerateThreads(This,ppThreads) ) -#define ICorDebugController_SetAllThreadsDebugState(This,state,pExceptThisThread) \ +#define ICorDebugController_SetAllThreadsDebugState(This,state,pExceptThisThread) \ ( (This)->lpVtbl -> SetAllThreadsDebugState(This,state,pExceptThisThread) ) -#define ICorDebugController_Detach(This) \ +#define ICorDebugController_Detach(This) \ ( (This)->lpVtbl -> Detach(This) ) -#define ICorDebugController_Terminate(This,exitCode) \ +#define ICorDebugController_Terminate(This,exitCode) \ ( (This)->lpVtbl -> Terminate(This,exitCode) ) -#define ICorDebugController_CanCommitChanges(This,cSnapshots,pSnapshots,pError) \ +#define ICorDebugController_CanCommitChanges(This,cSnapshots,pSnapshots,pError) \ ( (This)->lpVtbl -> CanCommitChanges(This,cSnapshots,pSnapshots,pError) ) -#define ICorDebugController_CommitChanges(This,cSnapshots,pSnapshots,pError) \ +#define ICorDebugController_CommitChanges(This,cSnapshots,pSnapshots,pError) \ ( (This)->lpVtbl -> CommitChanges(This,cSnapshots,pSnapshots,pError) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugController_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugController_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0025 */ @@ -5050,7 +5064,7 @@ EXTERN_C const IID IID_ICorDebugAppDomain; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugAppDomainVtbl { @@ -5168,86 +5182,86 @@ EXTERN_C const IID IID_ICorDebugAppDomain; #ifdef COBJMACROS -#define ICorDebugAppDomain_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugAppDomain_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugAppDomain_AddRef(This) \ +#define ICorDebugAppDomain_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugAppDomain_Release(This) \ +#define ICorDebugAppDomain_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugAppDomain_Stop(This,dwTimeoutIgnored) \ +#define ICorDebugAppDomain_Stop(This,dwTimeoutIgnored) \ ( (This)->lpVtbl -> Stop(This,dwTimeoutIgnored) ) -#define ICorDebugAppDomain_Continue(This,fIsOutOfBand) \ +#define ICorDebugAppDomain_Continue(This,fIsOutOfBand) \ ( (This)->lpVtbl -> Continue(This,fIsOutOfBand) ) -#define ICorDebugAppDomain_IsRunning(This,pbRunning) \ +#define ICorDebugAppDomain_IsRunning(This,pbRunning) \ ( (This)->lpVtbl -> IsRunning(This,pbRunning) ) -#define ICorDebugAppDomain_HasQueuedCallbacks(This,pThread,pbQueued) \ +#define ICorDebugAppDomain_HasQueuedCallbacks(This,pThread,pbQueued) \ ( (This)->lpVtbl -> HasQueuedCallbacks(This,pThread,pbQueued) ) -#define ICorDebugAppDomain_EnumerateThreads(This,ppThreads) \ +#define ICorDebugAppDomain_EnumerateThreads(This,ppThreads) \ ( (This)->lpVtbl -> EnumerateThreads(This,ppThreads) ) -#define ICorDebugAppDomain_SetAllThreadsDebugState(This,state,pExceptThisThread) \ +#define ICorDebugAppDomain_SetAllThreadsDebugState(This,state,pExceptThisThread) \ ( (This)->lpVtbl -> SetAllThreadsDebugState(This,state,pExceptThisThread) ) -#define ICorDebugAppDomain_Detach(This) \ +#define ICorDebugAppDomain_Detach(This) \ ( (This)->lpVtbl -> Detach(This) ) -#define ICorDebugAppDomain_Terminate(This,exitCode) \ +#define ICorDebugAppDomain_Terminate(This,exitCode) \ ( (This)->lpVtbl -> Terminate(This,exitCode) ) -#define ICorDebugAppDomain_CanCommitChanges(This,cSnapshots,pSnapshots,pError) \ +#define ICorDebugAppDomain_CanCommitChanges(This,cSnapshots,pSnapshots,pError) \ ( (This)->lpVtbl -> CanCommitChanges(This,cSnapshots,pSnapshots,pError) ) -#define ICorDebugAppDomain_CommitChanges(This,cSnapshots,pSnapshots,pError) \ +#define ICorDebugAppDomain_CommitChanges(This,cSnapshots,pSnapshots,pError) \ ( (This)->lpVtbl -> CommitChanges(This,cSnapshots,pSnapshots,pError) ) -#define ICorDebugAppDomain_GetProcess(This,ppProcess) \ +#define ICorDebugAppDomain_GetProcess(This,ppProcess) \ ( (This)->lpVtbl -> GetProcess(This,ppProcess) ) -#define ICorDebugAppDomain_EnumerateAssemblies(This,ppAssemblies) \ +#define ICorDebugAppDomain_EnumerateAssemblies(This,ppAssemblies) \ ( (This)->lpVtbl -> EnumerateAssemblies(This,ppAssemblies) ) -#define ICorDebugAppDomain_GetModuleFromMetaDataInterface(This,pIMetaData,ppModule) \ +#define ICorDebugAppDomain_GetModuleFromMetaDataInterface(This,pIMetaData,ppModule) \ ( (This)->lpVtbl -> GetModuleFromMetaDataInterface(This,pIMetaData,ppModule) ) -#define ICorDebugAppDomain_EnumerateBreakpoints(This,ppBreakpoints) \ +#define ICorDebugAppDomain_EnumerateBreakpoints(This,ppBreakpoints) \ ( (This)->lpVtbl -> EnumerateBreakpoints(This,ppBreakpoints) ) -#define ICorDebugAppDomain_EnumerateSteppers(This,ppSteppers) \ +#define ICorDebugAppDomain_EnumerateSteppers(This,ppSteppers) \ ( (This)->lpVtbl -> EnumerateSteppers(This,ppSteppers) ) -#define ICorDebugAppDomain_IsAttached(This,pbAttached) \ +#define ICorDebugAppDomain_IsAttached(This,pbAttached) \ ( (This)->lpVtbl -> IsAttached(This,pbAttached) ) -#define ICorDebugAppDomain_GetName(This,cchName,pcchName,szName) \ +#define ICorDebugAppDomain_GetName(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) -#define ICorDebugAppDomain_GetObject(This,ppObject) \ +#define ICorDebugAppDomain_GetObject(This,ppObject) \ ( (This)->lpVtbl -> GetObject(This,ppObject) ) -#define ICorDebugAppDomain_Attach(This) \ +#define ICorDebugAppDomain_Attach(This) \ ( (This)->lpVtbl -> Attach(This) ) -#define ICorDebugAppDomain_GetID(This,pId) \ +#define ICorDebugAppDomain_GetID(This,pId) \ ( (This)->lpVtbl -> GetID(This,pId) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugAppDomain_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugAppDomain_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0026 */ @@ -5288,7 +5302,7 @@ EXTERN_C const IID IID_ICorDebugAppDomain2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugAppDomain2Vtbl { @@ -5332,31 +5346,31 @@ EXTERN_C const IID IID_ICorDebugAppDomain2; #ifdef COBJMACROS -#define ICorDebugAppDomain2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugAppDomain2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugAppDomain2_AddRef(This) \ +#define ICorDebugAppDomain2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugAppDomain2_Release(This) \ +#define ICorDebugAppDomain2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugAppDomain2_GetArrayOrPointerType(This,elementType,nRank,pTypeArg,ppType) \ +#define ICorDebugAppDomain2_GetArrayOrPointerType(This,elementType,nRank,pTypeArg,ppType) \ ( (This)->lpVtbl -> GetArrayOrPointerType(This,elementType,nRank,pTypeArg,ppType) ) -#define ICorDebugAppDomain2_GetFunctionPointerType(This,nTypeArgs,ppTypeArgs,ppType) \ +#define ICorDebugAppDomain2_GetFunctionPointerType(This,nTypeArgs,ppTypeArgs,ppType) \ ( (This)->lpVtbl -> GetFunctionPointerType(This,nTypeArgs,ppTypeArgs,ppType) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugAppDomain2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugAppDomain2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugEnum_INTERFACE_DEFINED__ @@ -5388,7 +5402,7 @@ EXTERN_C const IID IID_ICorDebugEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugEnumVtbl { @@ -5434,37 +5448,37 @@ EXTERN_C const IID IID_ICorDebugEnum; #ifdef COBJMACROS -#define ICorDebugEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugEnum_AddRef(This) \ +#define ICorDebugEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugEnum_Release(This) \ +#define ICorDebugEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugEnum_Skip(This,celt) \ +#define ICorDebugEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugEnum_Reset(This) \ +#define ICorDebugEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugEnum_Clone(This,ppEnum) \ +#define ICorDebugEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugEnum_GetCount(This,pcelt) \ +#define ICorDebugEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugGuidToTypeEnum_INTERFACE_DEFINED__ @@ -5490,7 +5504,7 @@ EXTERN_C const IID IID_ICorDebugGuidToTypeEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugGuidToTypeEnumVtbl { @@ -5542,41 +5556,41 @@ EXTERN_C const IID IID_ICorDebugGuidToTypeEnum; #ifdef COBJMACROS -#define ICorDebugGuidToTypeEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugGuidToTypeEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugGuidToTypeEnum_AddRef(This) \ +#define ICorDebugGuidToTypeEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugGuidToTypeEnum_Release(This) \ +#define ICorDebugGuidToTypeEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugGuidToTypeEnum_Skip(This,celt) \ +#define ICorDebugGuidToTypeEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugGuidToTypeEnum_Reset(This) \ +#define ICorDebugGuidToTypeEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugGuidToTypeEnum_Clone(This,ppEnum) \ +#define ICorDebugGuidToTypeEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugGuidToTypeEnum_GetCount(This,pcelt) \ +#define ICorDebugGuidToTypeEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugGuidToTypeEnum_Next(This,celt,values,pceltFetched) \ +#define ICorDebugGuidToTypeEnum_Next(This,celt,values,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugGuidToTypeEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugGuidToTypeEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugAppDomain3_INTERFACE_DEFINED__ @@ -5605,7 +5619,7 @@ EXTERN_C const IID IID_ICorDebugAppDomain3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugAppDomain3Vtbl { @@ -5646,31 +5660,31 @@ EXTERN_C const IID IID_ICorDebugAppDomain3; #ifdef COBJMACROS -#define ICorDebugAppDomain3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugAppDomain3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugAppDomain3_AddRef(This) \ +#define ICorDebugAppDomain3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugAppDomain3_Release(This) \ +#define ICorDebugAppDomain3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugAppDomain3_GetCachedWinRTTypesForIIDs(This,cReqTypes,iidsToResolve,ppTypesEnum) \ +#define ICorDebugAppDomain3_GetCachedWinRTTypesForIIDs(This,cReqTypes,iidsToResolve,ppTypesEnum) \ ( (This)->lpVtbl -> GetCachedWinRTTypesForIIDs(This,cReqTypes,iidsToResolve,ppTypesEnum) ) -#define ICorDebugAppDomain3_GetCachedWinRTTypes(This,ppGuidToTypeEnum) \ +#define ICorDebugAppDomain3_GetCachedWinRTTypes(This,ppGuidToTypeEnum) \ ( (This)->lpVtbl -> GetCachedWinRTTypes(This,ppGuidToTypeEnum) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugAppDomain3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugAppDomain3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugAppDomain4_INTERFACE_DEFINED__ @@ -5695,7 +5709,7 @@ EXTERN_C const IID IID_ICorDebugAppDomain4; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugAppDomain4Vtbl { @@ -5731,28 +5745,28 @@ EXTERN_C const IID IID_ICorDebugAppDomain4; #ifdef COBJMACROS -#define ICorDebugAppDomain4_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugAppDomain4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugAppDomain4_AddRef(This) \ +#define ICorDebugAppDomain4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugAppDomain4_Release(This) \ +#define ICorDebugAppDomain4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugAppDomain4_GetObjectForCCW(This,ccwPointer,ppManagedObject) \ +#define ICorDebugAppDomain4_GetObjectForCCW(This,ccwPointer,ppManagedObject) \ ( (This)->lpVtbl -> GetObjectForCCW(This,ccwPointer,ppManagedObject) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugAppDomain4_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugAppDomain4_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0030 */ @@ -5802,7 +5816,7 @@ EXTERN_C const IID IID_ICorDebugAssembly; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugAssemblyVtbl { @@ -5857,40 +5871,40 @@ EXTERN_C const IID IID_ICorDebugAssembly; #ifdef COBJMACROS -#define ICorDebugAssembly_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugAssembly_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugAssembly_AddRef(This) \ +#define ICorDebugAssembly_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugAssembly_Release(This) \ +#define ICorDebugAssembly_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugAssembly_GetProcess(This,ppProcess) \ +#define ICorDebugAssembly_GetProcess(This,ppProcess) \ ( (This)->lpVtbl -> GetProcess(This,ppProcess) ) -#define ICorDebugAssembly_GetAppDomain(This,ppAppDomain) \ +#define ICorDebugAssembly_GetAppDomain(This,ppAppDomain) \ ( (This)->lpVtbl -> GetAppDomain(This,ppAppDomain) ) -#define ICorDebugAssembly_EnumerateModules(This,ppModules) \ +#define ICorDebugAssembly_EnumerateModules(This,ppModules) \ ( (This)->lpVtbl -> EnumerateModules(This,ppModules) ) -#define ICorDebugAssembly_GetCodeBase(This,cchName,pcchName,szName) \ +#define ICorDebugAssembly_GetCodeBase(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetCodeBase(This,cchName,pcchName,szName) ) -#define ICorDebugAssembly_GetName(This,cchName,pcchName,szName) \ +#define ICorDebugAssembly_GetName(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugAssembly_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugAssembly_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0031 */ @@ -5923,7 +5937,7 @@ EXTERN_C const IID IID_ICorDebugAssembly2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugAssembly2Vtbl { @@ -5958,28 +5972,28 @@ EXTERN_C const IID IID_ICorDebugAssembly2; #ifdef COBJMACROS -#define ICorDebugAssembly2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugAssembly2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugAssembly2_AddRef(This) \ +#define ICorDebugAssembly2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugAssembly2_Release(This) \ +#define ICorDebugAssembly2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugAssembly2_IsFullyTrusted(This,pbFullyTrusted) \ +#define ICorDebugAssembly2_IsFullyTrusted(This,pbFullyTrusted) \ ( (This)->lpVtbl -> IsFullyTrusted(This,pbFullyTrusted) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugAssembly2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugAssembly2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugAssembly3_INTERFACE_DEFINED__ @@ -6006,7 +6020,7 @@ EXTERN_C const IID IID_ICorDebugAssembly3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugAssembly3Vtbl { @@ -6045,31 +6059,31 @@ EXTERN_C const IID IID_ICorDebugAssembly3; #ifdef COBJMACROS -#define ICorDebugAssembly3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugAssembly3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugAssembly3_AddRef(This) \ +#define ICorDebugAssembly3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugAssembly3_Release(This) \ +#define ICorDebugAssembly3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugAssembly3_GetContainerAssembly(This,ppAssembly) \ +#define ICorDebugAssembly3_GetContainerAssembly(This,ppAssembly) \ ( (This)->lpVtbl -> GetContainerAssembly(This,ppAssembly) ) -#define ICorDebugAssembly3_EnumerateContainedAssemblies(This,ppAssemblies) \ +#define ICorDebugAssembly3_EnumerateContainedAssemblies(This,ppAssemblies) \ ( (This)->lpVtbl -> EnumerateContainedAssemblies(This,ppAssemblies) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugAssembly3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugAssembly3_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0033 */ @@ -6081,7 +6095,7 @@ typedef struct COR_TYPEID { UINT64 token1; UINT64 token2; - } COR_TYPEID; + } COR_TYPEID; #endif // _DEF_COR_TYPEID_ typedef struct _COR_HEAPOBJECT @@ -6089,7 +6103,7 @@ typedef struct _COR_HEAPOBJECT CORDB_ADDRESS address; ULONG64 size; COR_TYPEID type; - } COR_HEAPOBJECT; + } COR_HEAPOBJECT; @@ -6119,7 +6133,7 @@ EXTERN_C const IID IID_ICorDebugHeapEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugHeapEnumVtbl { @@ -6171,41 +6185,41 @@ EXTERN_C const IID IID_ICorDebugHeapEnum; #ifdef COBJMACROS -#define ICorDebugHeapEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugHeapEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugHeapEnum_AddRef(This) \ +#define ICorDebugHeapEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugHeapEnum_Release(This) \ +#define ICorDebugHeapEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugHeapEnum_Skip(This,celt) \ +#define ICorDebugHeapEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugHeapEnum_Reset(This) \ +#define ICorDebugHeapEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugHeapEnum_Clone(This,ppEnum) \ +#define ICorDebugHeapEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugHeapEnum_GetCount(This,pcelt) \ +#define ICorDebugHeapEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugHeapEnum_Next(This,celt,objects,pceltFetched) \ +#define ICorDebugHeapEnum_Next(This,celt,objects,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,objects,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugHeapEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugHeapEnum_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0034 */ @@ -6214,12 +6228,12 @@ EXTERN_C const IID IID_ICorDebugHeapEnum; typedef enum CorDebugGenerationTypes { - CorDebug_Gen0 = 0, - CorDebug_Gen1 = 1, - CorDebug_Gen2 = 2, - CorDebug_LOH = 3, - CorDebug_POH = 4 - } CorDebugGenerationTypes; + CorDebug_Gen0 = 0, + CorDebug_Gen1 = 1, + CorDebug_Gen2 = 2, + CorDebug_LOH = 3, + CorDebug_POH = 4 + } CorDebugGenerationTypes; typedef struct _COR_SEGMENT { @@ -6227,14 +6241,14 @@ typedef struct _COR_SEGMENT CORDB_ADDRESS end; CorDebugGenerationTypes type; ULONG heap; - } COR_SEGMENT; + } COR_SEGMENT; typedef enum CorDebugGCType { - CorDebugWorkstationGC = 0, - CorDebugServerGC = ( CorDebugWorkstationGC + 1 ) - } CorDebugGCType; + CorDebugWorkstationGC = 0, + CorDebugServerGC = ( CorDebugWorkstationGC + 1 ) + } CorDebugGCType; typedef struct _COR_HEAPINFO { @@ -6243,7 +6257,7 @@ typedef struct _COR_HEAPINFO DWORD numHeaps; BOOL concurrent; CorDebugGCType gcType; - } COR_HEAPINFO; + } COR_HEAPINFO; @@ -6273,7 +6287,7 @@ EXTERN_C const IID IID_ICorDebugHeapSegmentEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugHeapSegmentEnumVtbl { @@ -6325,41 +6339,41 @@ EXTERN_C const IID IID_ICorDebugHeapSegmentEnum; #ifdef COBJMACROS -#define ICorDebugHeapSegmentEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugHeapSegmentEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugHeapSegmentEnum_AddRef(This) \ +#define ICorDebugHeapSegmentEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugHeapSegmentEnum_Release(This) \ +#define ICorDebugHeapSegmentEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugHeapSegmentEnum_Skip(This,celt) \ +#define ICorDebugHeapSegmentEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugHeapSegmentEnum_Reset(This) \ +#define ICorDebugHeapSegmentEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugHeapSegmentEnum_Clone(This,ppEnum) \ +#define ICorDebugHeapSegmentEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugHeapSegmentEnum_GetCount(This,pcelt) \ +#define ICorDebugHeapSegmentEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugHeapSegmentEnum_Next(This,celt,segments,pceltFetched) \ +#define ICorDebugHeapSegmentEnum_Next(This,celt,segments,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,segments,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugHeapSegmentEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugHeapSegmentEnum_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0035 */ @@ -6368,23 +6382,23 @@ EXTERN_C const IID IID_ICorDebugHeapSegmentEnum; typedef enum CorGCReferenceType { - CorHandleStrong = ( 1 << 0 ) , - CorHandleStrongPinning = ( 1 << 1 ) , - CorHandleWeakShort = ( 1 << 2 ) , - CorHandleWeakLong = ( 1 << 3 ) , - CorHandleWeakRefCount = ( 1 << 4 ) , - CorHandleStrongRefCount = ( 1 << 5 ) , - CorHandleStrongDependent = ( 1 << 6 ) , - CorHandleStrongAsyncPinned = ( 1 << 7 ) , - CorHandleStrongSizedByref = ( 1 << 8 ) , - CorHandleWeakNativeCom = ( 1 << 9 ) , - CorHandleWeakWinRT = CorHandleWeakNativeCom, - CorReferenceStack = 0x80000001, - CorReferenceFinalizer = 80000002, - CorHandleStrongOnly = 0x1e3, - CorHandleWeakOnly = 0x21c, - CorHandleAll = 0x7fffffff - } CorGCReferenceType; + CorHandleStrong = ( 1 << 0 ) , + CorHandleStrongPinning = ( 1 << 1 ) , + CorHandleWeakShort = ( 1 << 2 ) , + CorHandleWeakLong = ( 1 << 3 ) , + CorHandleWeakRefCount = ( 1 << 4 ) , + CorHandleStrongRefCount = ( 1 << 5 ) , + CorHandleStrongDependent = ( 1 << 6 ) , + CorHandleStrongAsyncPinned = ( 1 << 7 ) , + CorHandleStrongSizedByref = ( 1 << 8 ) , + CorHandleWeakNativeCom = ( 1 << 9 ) , + CorHandleWeakWinRT = CorHandleWeakNativeCom, + CorReferenceStack = 0x80000001, + CorReferenceFinalizer = 80000002, + CorHandleStrongOnly = 0x1e3, + CorHandleWeakOnly = 0x21c, + CorHandleAll = 0x7fffffff + } CorGCReferenceType; #ifndef _DEF_COR_GC_REFERENCE_ #define _DEF_COR_GC_REFERENCE_ @@ -6394,7 +6408,7 @@ typedef struct COR_GC_REFERENCE ICorDebugValue *Location; CorGCReferenceType Type; UINT64 ExtraData; - } COR_GC_REFERENCE; + } COR_GC_REFERENCE; #endif // _DEF_COR_GC_REFERENCE_ @@ -6425,7 +6439,7 @@ EXTERN_C const IID IID_ICorDebugGCReferenceEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugGCReferenceEnumVtbl { @@ -6477,41 +6491,41 @@ EXTERN_C const IID IID_ICorDebugGCReferenceEnum; #ifdef COBJMACROS -#define ICorDebugGCReferenceEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugGCReferenceEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugGCReferenceEnum_AddRef(This) \ +#define ICorDebugGCReferenceEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugGCReferenceEnum_Release(This) \ +#define ICorDebugGCReferenceEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugGCReferenceEnum_Skip(This,celt) \ +#define ICorDebugGCReferenceEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugGCReferenceEnum_Reset(This) \ +#define ICorDebugGCReferenceEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugGCReferenceEnum_Clone(This,ppEnum) \ +#define ICorDebugGCReferenceEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugGCReferenceEnum_GetCount(This,pcelt) \ +#define ICorDebugGCReferenceEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugGCReferenceEnum_Next(This,celt,roots,pceltFetched) \ +#define ICorDebugGCReferenceEnum_Next(This,celt,roots,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,roots,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugGCReferenceEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugGCReferenceEnum_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0036 */ @@ -6529,7 +6543,7 @@ typedef struct COR_ARRAY_LAYOUT ULONG32 rankSize; ULONG32 numRanks; ULONG32 rankOffset; - } COR_ARRAY_LAYOUT; + } COR_ARRAY_LAYOUT; #endif // _DEF_COR_ARRAY_LAYOUT_ #ifndef _DEF_COR_TYPE_LAYOUT_ @@ -6541,7 +6555,7 @@ typedef struct COR_TYPE_LAYOUT ULONG32 numFields; ULONG32 boxOffset; CorElementType type; - } COR_TYPE_LAYOUT; + } COR_TYPE_LAYOUT; #endif // _DEF_COR_TYPE_LAYOUT_ #ifndef _DEF_COR_FIELD_ @@ -6552,7 +6566,7 @@ typedef struct COR_FIELD ULONG32 offset; COR_TYPEID id; CorElementType fieldType; - } COR_FIELD; + } COR_FIELD; #endif // _DEF_COR_FIELD_ #pragma warning(push) @@ -6647,7 +6661,7 @@ EXTERN_C const IID IID_ICorDebugProcess; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcessVtbl { @@ -6807,107 +6821,107 @@ EXTERN_C const IID IID_ICorDebugProcess; #ifdef COBJMACROS -#define ICorDebugProcess_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcess_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcess_AddRef(This) \ +#define ICorDebugProcess_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcess_Release(This) \ +#define ICorDebugProcess_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcess_Stop(This,dwTimeoutIgnored) \ +#define ICorDebugProcess_Stop(This,dwTimeoutIgnored) \ ( (This)->lpVtbl -> Stop(This,dwTimeoutIgnored) ) -#define ICorDebugProcess_Continue(This,fIsOutOfBand) \ +#define ICorDebugProcess_Continue(This,fIsOutOfBand) \ ( (This)->lpVtbl -> Continue(This,fIsOutOfBand) ) -#define ICorDebugProcess_IsRunning(This,pbRunning) \ +#define ICorDebugProcess_IsRunning(This,pbRunning) \ ( (This)->lpVtbl -> IsRunning(This,pbRunning) ) -#define ICorDebugProcess_HasQueuedCallbacks(This,pThread,pbQueued) \ +#define ICorDebugProcess_HasQueuedCallbacks(This,pThread,pbQueued) \ ( (This)->lpVtbl -> HasQueuedCallbacks(This,pThread,pbQueued) ) -#define ICorDebugProcess_EnumerateThreads(This,ppThreads) \ +#define ICorDebugProcess_EnumerateThreads(This,ppThreads) \ ( (This)->lpVtbl -> EnumerateThreads(This,ppThreads) ) -#define ICorDebugProcess_SetAllThreadsDebugState(This,state,pExceptThisThread) \ +#define ICorDebugProcess_SetAllThreadsDebugState(This,state,pExceptThisThread) \ ( (This)->lpVtbl -> SetAllThreadsDebugState(This,state,pExceptThisThread) ) -#define ICorDebugProcess_Detach(This) \ +#define ICorDebugProcess_Detach(This) \ ( (This)->lpVtbl -> Detach(This) ) -#define ICorDebugProcess_Terminate(This,exitCode) \ +#define ICorDebugProcess_Terminate(This,exitCode) \ ( (This)->lpVtbl -> Terminate(This,exitCode) ) -#define ICorDebugProcess_CanCommitChanges(This,cSnapshots,pSnapshots,pError) \ +#define ICorDebugProcess_CanCommitChanges(This,cSnapshots,pSnapshots,pError) \ ( (This)->lpVtbl -> CanCommitChanges(This,cSnapshots,pSnapshots,pError) ) -#define ICorDebugProcess_CommitChanges(This,cSnapshots,pSnapshots,pError) \ +#define ICorDebugProcess_CommitChanges(This,cSnapshots,pSnapshots,pError) \ ( (This)->lpVtbl -> CommitChanges(This,cSnapshots,pSnapshots,pError) ) -#define ICorDebugProcess_GetID(This,pdwProcessId) \ +#define ICorDebugProcess_GetID(This,pdwProcessId) \ ( (This)->lpVtbl -> GetID(This,pdwProcessId) ) -#define ICorDebugProcess_GetHandle(This,phProcessHandle) \ +#define ICorDebugProcess_GetHandle(This,phProcessHandle) \ ( (This)->lpVtbl -> GetHandle(This,phProcessHandle) ) -#define ICorDebugProcess_GetThread(This,dwThreadId,ppThread) \ +#define ICorDebugProcess_GetThread(This,dwThreadId,ppThread) \ ( (This)->lpVtbl -> GetThread(This,dwThreadId,ppThread) ) -#define ICorDebugProcess_EnumerateObjects(This,ppObjects) \ +#define ICorDebugProcess_EnumerateObjects(This,ppObjects) \ ( (This)->lpVtbl -> EnumerateObjects(This,ppObjects) ) -#define ICorDebugProcess_IsTransitionStub(This,address,pbTransitionStub) \ +#define ICorDebugProcess_IsTransitionStub(This,address,pbTransitionStub) \ ( (This)->lpVtbl -> IsTransitionStub(This,address,pbTransitionStub) ) -#define ICorDebugProcess_IsOSSuspended(This,threadID,pbSuspended) \ +#define ICorDebugProcess_IsOSSuspended(This,threadID,pbSuspended) \ ( (This)->lpVtbl -> IsOSSuspended(This,threadID,pbSuspended) ) -#define ICorDebugProcess_GetThreadContext(This,threadID,contextSize,context) \ +#define ICorDebugProcess_GetThreadContext(This,threadID,contextSize,context) \ ( (This)->lpVtbl -> GetThreadContext(This,threadID,contextSize,context) ) -#define ICorDebugProcess_SetThreadContext(This,threadID,contextSize,context) \ +#define ICorDebugProcess_SetThreadContext(This,threadID,contextSize,context) \ ( (This)->lpVtbl -> SetThreadContext(This,threadID,contextSize,context) ) -#define ICorDebugProcess_ReadMemory(This,address,size,buffer,read) \ +#define ICorDebugProcess_ReadMemory(This,address,size,buffer,read) \ ( (This)->lpVtbl -> ReadMemory(This,address,size,buffer,read) ) -#define ICorDebugProcess_WriteMemory(This,address,size,buffer,written) \ +#define ICorDebugProcess_WriteMemory(This,address,size,buffer,written) \ ( (This)->lpVtbl -> WriteMemory(This,address,size,buffer,written) ) -#define ICorDebugProcess_ClearCurrentException(This,threadID) \ +#define ICorDebugProcess_ClearCurrentException(This,threadID) \ ( (This)->lpVtbl -> ClearCurrentException(This,threadID) ) -#define ICorDebugProcess_EnableLogMessages(This,fOnOff) \ +#define ICorDebugProcess_EnableLogMessages(This,fOnOff) \ ( (This)->lpVtbl -> EnableLogMessages(This,fOnOff) ) -#define ICorDebugProcess_ModifyLogSwitch(This,pLogSwitchName,lLevel) \ +#define ICorDebugProcess_ModifyLogSwitch(This,pLogSwitchName,lLevel) \ ( (This)->lpVtbl -> ModifyLogSwitch(This,pLogSwitchName,lLevel) ) -#define ICorDebugProcess_EnumerateAppDomains(This,ppAppDomains) \ +#define ICorDebugProcess_EnumerateAppDomains(This,ppAppDomains) \ ( (This)->lpVtbl -> EnumerateAppDomains(This,ppAppDomains) ) -#define ICorDebugProcess_GetObject(This,ppObject) \ +#define ICorDebugProcess_GetObject(This,ppObject) \ ( (This)->lpVtbl -> GetObject(This,ppObject) ) -#define ICorDebugProcess_ThreadForFiberCookie(This,fiberCookie,ppThread) \ +#define ICorDebugProcess_ThreadForFiberCookie(This,fiberCookie,ppThread) \ ( (This)->lpVtbl -> ThreadForFiberCookie(This,fiberCookie,ppThread) ) -#define ICorDebugProcess_GetHelperThreadID(This,pThreadID) \ +#define ICorDebugProcess_GetHelperThreadID(This,pThreadID) \ ( (This)->lpVtbl -> GetHelperThreadID(This,pThreadID) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugProcess_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcess_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0037 */ @@ -6963,7 +6977,7 @@ EXTERN_C const IID IID_ICorDebugProcess2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcess2Vtbl { @@ -7027,46 +7041,46 @@ EXTERN_C const IID IID_ICorDebugProcess2; #ifdef COBJMACROS -#define ICorDebugProcess2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcess2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcess2_AddRef(This) \ +#define ICorDebugProcess2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcess2_Release(This) \ +#define ICorDebugProcess2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcess2_GetThreadForTaskID(This,taskid,ppThread) \ +#define ICorDebugProcess2_GetThreadForTaskID(This,taskid,ppThread) \ ( (This)->lpVtbl -> GetThreadForTaskID(This,taskid,ppThread) ) -#define ICorDebugProcess2_GetVersion(This,version) \ +#define ICorDebugProcess2_GetVersion(This,version) \ ( (This)->lpVtbl -> GetVersion(This,version) ) -#define ICorDebugProcess2_SetUnmanagedBreakpoint(This,address,bufsize,buffer,bufLen) \ +#define ICorDebugProcess2_SetUnmanagedBreakpoint(This,address,bufsize,buffer,bufLen) \ ( (This)->lpVtbl -> SetUnmanagedBreakpoint(This,address,bufsize,buffer,bufLen) ) -#define ICorDebugProcess2_ClearUnmanagedBreakpoint(This,address) \ +#define ICorDebugProcess2_ClearUnmanagedBreakpoint(This,address) \ ( (This)->lpVtbl -> ClearUnmanagedBreakpoint(This,address) ) -#define ICorDebugProcess2_SetDesiredNGENCompilerFlags(This,pdwFlags) \ +#define ICorDebugProcess2_SetDesiredNGENCompilerFlags(This,pdwFlags) \ ( (This)->lpVtbl -> SetDesiredNGENCompilerFlags(This,pdwFlags) ) -#define ICorDebugProcess2_GetDesiredNGENCompilerFlags(This,pdwFlags) \ +#define ICorDebugProcess2_GetDesiredNGENCompilerFlags(This,pdwFlags) \ ( (This)->lpVtbl -> GetDesiredNGENCompilerFlags(This,pdwFlags) ) -#define ICorDebugProcess2_GetReferenceValueFromGCHandle(This,handle,pOutValue) \ +#define ICorDebugProcess2_GetReferenceValueFromGCHandle(This,handle,pOutValue) \ ( (This)->lpVtbl -> GetReferenceValueFromGCHandle(This,handle,pOutValue) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugProcess2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcess2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugProcess3_INTERFACE_DEFINED__ @@ -7091,7 +7105,7 @@ EXTERN_C const IID IID_ICorDebugProcess3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcess3Vtbl { @@ -7127,28 +7141,28 @@ EXTERN_C const IID IID_ICorDebugProcess3; #ifdef COBJMACROS -#define ICorDebugProcess3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcess3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcess3_AddRef(This) \ +#define ICorDebugProcess3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcess3_Release(This) \ +#define ICorDebugProcess3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcess3_SetEnableCustomNotification(This,pClass,fEnable) \ +#define ICorDebugProcess3_SetEnableCustomNotification(This,pClass,fEnable) \ ( (This)->lpVtbl -> SetEnableCustomNotification(This,pClass,fEnable) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugProcess3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcess3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugProcess5_INTERFACE_DEFINED__ @@ -7215,7 +7229,7 @@ EXTERN_C const IID IID_ICorDebugProcess5; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcess5Vtbl { @@ -7304,61 +7318,61 @@ EXTERN_C const IID IID_ICorDebugProcess5; #ifdef COBJMACROS -#define ICorDebugProcess5_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcess5_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcess5_AddRef(This) \ +#define ICorDebugProcess5_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcess5_Release(This) \ +#define ICorDebugProcess5_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcess5_GetGCHeapInformation(This,pHeapInfo) \ +#define ICorDebugProcess5_GetGCHeapInformation(This,pHeapInfo) \ ( (This)->lpVtbl -> GetGCHeapInformation(This,pHeapInfo) ) -#define ICorDebugProcess5_EnumerateHeap(This,ppObjects) \ +#define ICorDebugProcess5_EnumerateHeap(This,ppObjects) \ ( (This)->lpVtbl -> EnumerateHeap(This,ppObjects) ) -#define ICorDebugProcess5_EnumerateHeapRegions(This,ppRegions) \ +#define ICorDebugProcess5_EnumerateHeapRegions(This,ppRegions) \ ( (This)->lpVtbl -> EnumerateHeapRegions(This,ppRegions) ) -#define ICorDebugProcess5_GetObject(This,addr,pObject) \ +#define ICorDebugProcess5_GetObject(This,addr,pObject) \ ( (This)->lpVtbl -> GetObject(This,addr,pObject) ) -#define ICorDebugProcess5_EnumerateGCReferences(This,enumerateWeakReferences,ppEnum) \ +#define ICorDebugProcess5_EnumerateGCReferences(This,enumerateWeakReferences,ppEnum) \ ( (This)->lpVtbl -> EnumerateGCReferences(This,enumerateWeakReferences,ppEnum) ) -#define ICorDebugProcess5_EnumerateHandles(This,types,ppEnum) \ +#define ICorDebugProcess5_EnumerateHandles(This,types,ppEnum) \ ( (This)->lpVtbl -> EnumerateHandles(This,types,ppEnum) ) -#define ICorDebugProcess5_GetTypeID(This,obj,pId) \ +#define ICorDebugProcess5_GetTypeID(This,obj,pId) \ ( (This)->lpVtbl -> GetTypeID(This,obj,pId) ) -#define ICorDebugProcess5_GetTypeForTypeID(This,id,ppType) \ +#define ICorDebugProcess5_GetTypeForTypeID(This,id,ppType) \ ( (This)->lpVtbl -> GetTypeForTypeID(This,id,ppType) ) -#define ICorDebugProcess5_GetArrayLayout(This,id,pLayout) \ +#define ICorDebugProcess5_GetArrayLayout(This,id,pLayout) \ ( (This)->lpVtbl -> GetArrayLayout(This,id,pLayout) ) -#define ICorDebugProcess5_GetTypeLayout(This,id,pLayout) \ +#define ICorDebugProcess5_GetTypeLayout(This,id,pLayout) \ ( (This)->lpVtbl -> GetTypeLayout(This,id,pLayout) ) -#define ICorDebugProcess5_GetTypeFields(This,id,celt,fields,pceltNeeded) \ +#define ICorDebugProcess5_GetTypeFields(This,id,celt,fields,pceltNeeded) \ ( (This)->lpVtbl -> GetTypeFields(This,id,celt,fields,pceltNeeded) ) -#define ICorDebugProcess5_EnableNGENPolicy(This,ePolicy) \ +#define ICorDebugProcess5_EnableNGENPolicy(This,ePolicy) \ ( (This)->lpVtbl -> EnableNGENPolicy(This,ePolicy) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugProcess5_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcess5_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0040 */ @@ -7367,33 +7381,33 @@ EXTERN_C const IID IID_ICorDebugProcess5; typedef enum CorDebugRecordFormat { - FORMAT_WINDOWS_EXCEPTIONRECORD32 = 1, - FORMAT_WINDOWS_EXCEPTIONRECORD64 = 2 - } CorDebugRecordFormat; + FORMAT_WINDOWS_EXCEPTIONRECORD32 = 1, + FORMAT_WINDOWS_EXCEPTIONRECORD64 = 2 + } CorDebugRecordFormat; typedef enum CorDebugDecodeEventFlagsWindows { - IS_FIRST_CHANCE = 1 - } CorDebugDecodeEventFlagsWindows; + IS_FIRST_CHANCE = 1 + } CorDebugDecodeEventFlagsWindows; typedef enum CorDebugDebugEventKind { - DEBUG_EVENT_KIND_MODULE_LOADED = 1, - DEBUG_EVENT_KIND_MODULE_UNLOADED = 2, - DEBUG_EVENT_KIND_MANAGED_EXCEPTION_FIRST_CHANCE = 3, - DEBUG_EVENT_KIND_MANAGED_EXCEPTION_USER_FIRST_CHANCE = 4, - DEBUG_EVENT_KIND_MANAGED_EXCEPTION_CATCH_HANDLER_FOUND = 5, - DEBUG_EVENT_KIND_MANAGED_EXCEPTION_UNHANDLED = 6 - } CorDebugDebugEventKind; + DEBUG_EVENT_KIND_MODULE_LOADED = 1, + DEBUG_EVENT_KIND_MODULE_UNLOADED = 2, + DEBUG_EVENT_KIND_MANAGED_EXCEPTION_FIRST_CHANCE = 3, + DEBUG_EVENT_KIND_MANAGED_EXCEPTION_USER_FIRST_CHANCE = 4, + DEBUG_EVENT_KIND_MANAGED_EXCEPTION_CATCH_HANDLER_FOUND = 5, + DEBUG_EVENT_KIND_MANAGED_EXCEPTION_UNHANDLED = 6 + } CorDebugDebugEventKind; typedef enum CorDebugStateChange { - PROCESS_RUNNING = 0x1, - FLUSH_ALL = 0x2 - } CorDebugStateChange; + PROCESS_RUNNING = 0x1, + FLUSH_ALL = 0x2 + } CorDebugStateChange; @@ -7424,7 +7438,7 @@ EXTERN_C const IID IID_ICorDebugDebugEvent; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugDebugEventVtbl { @@ -7463,31 +7477,31 @@ EXTERN_C const IID IID_ICorDebugDebugEvent; #ifdef COBJMACROS -#define ICorDebugDebugEvent_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugDebugEvent_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugDebugEvent_AddRef(This) \ +#define ICorDebugDebugEvent_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugDebugEvent_Release(This) \ +#define ICorDebugDebugEvent_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugDebugEvent_GetEventKind(This,pDebugEventKind) \ +#define ICorDebugDebugEvent_GetEventKind(This,pDebugEventKind) \ ( (This)->lpVtbl -> GetEventKind(This,pDebugEventKind) ) -#define ICorDebugDebugEvent_GetThread(This,ppThread) \ +#define ICorDebugDebugEvent_GetThread(This,ppThread) \ ( (This)->lpVtbl -> GetThread(This,ppThread) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugDebugEvent_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugDebugEvent_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0041 */ @@ -7496,19 +7510,19 @@ EXTERN_C const IID IID_ICorDebugDebugEvent; typedef enum CorDebugCodeInvokeKind { - CODE_INVOKE_KIND_NONE = 0, - CODE_INVOKE_KIND_RETURN = ( CODE_INVOKE_KIND_NONE + 1 ) , - CODE_INVOKE_KIND_TAILCALL = ( CODE_INVOKE_KIND_RETURN + 1 ) - } CorDebugCodeInvokeKind; + CODE_INVOKE_KIND_NONE = 0, + CODE_INVOKE_KIND_RETURN = ( CODE_INVOKE_KIND_NONE + 1 ) , + CODE_INVOKE_KIND_TAILCALL = ( CODE_INVOKE_KIND_RETURN + 1 ) + } CorDebugCodeInvokeKind; typedef enum CorDebugCodeInvokePurpose { - CODE_INVOKE_PURPOSE_NONE = 0, - CODE_INVOKE_PURPOSE_NATIVE_TO_MANAGED_TRANSITION = ( CODE_INVOKE_PURPOSE_NONE + 1 ) , - CODE_INVOKE_PURPOSE_CLASS_INIT = ( CODE_INVOKE_PURPOSE_NATIVE_TO_MANAGED_TRANSITION + 1 ) , - CODE_INVOKE_PURPOSE_INTERFACE_DISPATCH = ( CODE_INVOKE_PURPOSE_CLASS_INIT + 1 ) - } CorDebugCodeInvokePurpose; + CODE_INVOKE_PURPOSE_NONE = 0, + CODE_INVOKE_PURPOSE_NATIVE_TO_MANAGED_TRANSITION = ( CODE_INVOKE_PURPOSE_NONE + 1 ) , + CODE_INVOKE_PURPOSE_CLASS_INIT = ( CODE_INVOKE_PURPOSE_NATIVE_TO_MANAGED_TRANSITION + 1 ) , + CODE_INVOKE_PURPOSE_INTERFACE_DISPATCH = ( CODE_INVOKE_PURPOSE_CLASS_INIT + 1 ) + } CorDebugCodeInvokePurpose; @@ -7559,7 +7573,7 @@ EXTERN_C const IID IID_ICorDebugProcess6; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcess6Vtbl { @@ -7622,43 +7636,43 @@ EXTERN_C const IID IID_ICorDebugProcess6; #ifdef COBJMACROS -#define ICorDebugProcess6_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcess6_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcess6_AddRef(This) \ +#define ICorDebugProcess6_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcess6_Release(This) \ +#define ICorDebugProcess6_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcess6_DecodeEvent(This,pRecord,countBytes,format,dwFlags,dwThreadId,ppEvent) \ +#define ICorDebugProcess6_DecodeEvent(This,pRecord,countBytes,format,dwFlags,dwThreadId,ppEvent) \ ( (This)->lpVtbl -> DecodeEvent(This,pRecord,countBytes,format,dwFlags,dwThreadId,ppEvent) ) -#define ICorDebugProcess6_ProcessStateChanged(This,change) \ +#define ICorDebugProcess6_ProcessStateChanged(This,change) \ ( (This)->lpVtbl -> ProcessStateChanged(This,change) ) -#define ICorDebugProcess6_GetCode(This,codeAddress,ppCode) \ +#define ICorDebugProcess6_GetCode(This,codeAddress,ppCode) \ ( (This)->lpVtbl -> GetCode(This,codeAddress,ppCode) ) -#define ICorDebugProcess6_EnableVirtualModuleSplitting(This,enableSplitting) \ +#define ICorDebugProcess6_EnableVirtualModuleSplitting(This,enableSplitting) \ ( (This)->lpVtbl -> EnableVirtualModuleSplitting(This,enableSplitting) ) -#define ICorDebugProcess6_MarkDebuggerAttached(This,fIsAttached) \ +#define ICorDebugProcess6_MarkDebuggerAttached(This,fIsAttached) \ ( (This)->lpVtbl -> MarkDebuggerAttached(This,fIsAttached) ) -#define ICorDebugProcess6_GetExportStepInfo(This,pszExportName,pInvokeKind,pInvokePurpose) \ +#define ICorDebugProcess6_GetExportStepInfo(This,pszExportName,pInvokeKind,pInvokePurpose) \ ( (This)->lpVtbl -> GetExportStepInfo(This,pszExportName,pInvokeKind,pInvokePurpose) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugProcess6_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcess6_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0042 */ @@ -7667,9 +7681,9 @@ EXTERN_C const IID IID_ICorDebugProcess6; typedef enum WriteableMetadataUpdateMode { - LegacyCompatPolicy = 0, - AlwaysShowUpdates = ( LegacyCompatPolicy + 1 ) - } WriteableMetadataUpdateMode; + LegacyCompatPolicy = 0, + AlwaysShowUpdates = ( LegacyCompatPolicy + 1 ) + } WriteableMetadataUpdateMode; @@ -7697,7 +7711,7 @@ EXTERN_C const IID IID_ICorDebugProcess7; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcess7Vtbl { @@ -7732,28 +7746,28 @@ EXTERN_C const IID IID_ICorDebugProcess7; #ifdef COBJMACROS -#define ICorDebugProcess7_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcess7_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcess7_AddRef(This) \ +#define ICorDebugProcess7_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcess7_Release(This) \ +#define ICorDebugProcess7_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcess7_SetWriteableMetadataUpdateMode(This,flags) \ +#define ICorDebugProcess7_SetWriteableMetadataUpdateMode(This,flags) \ ( (This)->lpVtbl -> SetWriteableMetadataUpdateMode(This,flags) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugProcess7_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcess7_INTERFACE_DEFINED__ */ #ifndef __ICorDebugProcess8_INTERFACE_DEFINED__ @@ -7777,7 +7791,7 @@ EXTERN_C const IID IID_ICorDebugProcess8; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcess8Vtbl { @@ -7812,28 +7826,28 @@ EXTERN_C const IID IID_ICorDebugProcess8; #ifdef COBJMACROS -#define ICorDebugProcess8_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcess8_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcess8_AddRef(This) \ +#define ICorDebugProcess8_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcess8_Release(This) \ +#define ICorDebugProcess8_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcess8_EnableExceptionCallbacksOutsideOfMyCode(This,enableExceptionsOutsideOfJMC) \ +#define ICorDebugProcess8_EnableExceptionCallbacksOutsideOfMyCode(This,enableExceptionsOutsideOfJMC) \ ( (This)->lpVtbl -> EnableExceptionCallbacksOutsideOfMyCode(This,enableExceptionsOutsideOfJMC) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugProcess8_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcess8_INTERFACE_DEFINED__ */ #ifndef __ICorDebugProcess10_INTERFACE_DEFINED__ @@ -7857,7 +7871,7 @@ EXTERN_C const IID IID_ICorDebugProcess10; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcess10Vtbl { @@ -7892,28 +7906,234 @@ EXTERN_C const IID IID_ICorDebugProcess10; #ifdef COBJMACROS -#define ICorDebugProcess10_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcess10_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcess10_AddRef(This) \ +#define ICorDebugProcess10_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcess10_Release(This) \ +#define ICorDebugProcess10_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcess10_EnableGCNotificationEvents(This,fEnable) \ +#define ICorDebugProcess10_EnableGCNotificationEvents(This,fEnable) \ ( (This)->lpVtbl -> EnableGCNotificationEvents(This,fEnable) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ + + + + +#endif /* __ICorDebugProcess10_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_cordebug_0000_0045 */ +/* [local] */ + +typedef struct _COR_MEMORY_RANGE + { + CORDB_ADDRESS start; + CORDB_ADDRESS end; + } COR_MEMORY_RANGE; + + + +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0045_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0045_v0_0_s_ifspec; + +#ifndef __ICorDebugMemoryRangeEnum_INTERFACE_DEFINED__ +#define __ICorDebugMemoryRangeEnum_INTERFACE_DEFINED__ + +/* interface ICorDebugMemoryRangeEnum */ +/* [unique][uuid][local][object] */ + + +EXTERN_C const IID IID_ICorDebugMemoryRangeEnum; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("D1A0BCFC-5865-4437-BE3F-36F022951F8A") + ICorDebugMemoryRangeEnum : public ICorDebugEnum + { + public: + virtual HRESULT STDMETHODCALLTYPE Next( + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ COR_MEMORY_RANGE objects[ ], + /* [out] */ ULONG *pceltFetched) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ICorDebugMemoryRangeEnumVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ICorDebugMemoryRangeEnum * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ICorDebugMemoryRangeEnum * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ICorDebugMemoryRangeEnum * This); + + HRESULT ( STDMETHODCALLTYPE *Skip )( + ICorDebugMemoryRangeEnum * This, + /* [in] */ ULONG celt); + + HRESULT ( STDMETHODCALLTYPE *Reset )( + ICorDebugMemoryRangeEnum * This); + + HRESULT ( STDMETHODCALLTYPE *Clone )( + ICorDebugMemoryRangeEnum * This, + /* [out] */ ICorDebugEnum **ppEnum); + + HRESULT ( STDMETHODCALLTYPE *GetCount )( + ICorDebugMemoryRangeEnum * This, + /* [out] */ ULONG *pcelt); + + HRESULT ( STDMETHODCALLTYPE *Next )( + ICorDebugMemoryRangeEnum * This, + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ COR_MEMORY_RANGE objects[ ], + /* [out] */ ULONG *pceltFetched); + + END_INTERFACE + } ICorDebugMemoryRangeEnumVtbl; + + interface ICorDebugMemoryRangeEnum + { + CONST_VTBL struct ICorDebugMemoryRangeEnumVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ICorDebugMemoryRangeEnum_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ICorDebugMemoryRangeEnum_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ICorDebugMemoryRangeEnum_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ICorDebugMemoryRangeEnum_Skip(This,celt) \ + ( (This)->lpVtbl -> Skip(This,celt) ) + +#define ICorDebugMemoryRangeEnum_Reset(This) \ + ( (This)->lpVtbl -> Reset(This) ) + +#define ICorDebugMemoryRangeEnum_Clone(This,ppEnum) \ + ( (This)->lpVtbl -> Clone(This,ppEnum) ) + +#define ICorDebugMemoryRangeEnum_GetCount(This,pcelt) \ + ( (This)->lpVtbl -> GetCount(This,pcelt) ) + + +#define ICorDebugMemoryRangeEnum_Next(This,celt,objects,pceltFetched) \ + ( (This)->lpVtbl -> Next(This,celt,objects,pceltFetched) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ICorDebugMemoryRangeEnum_INTERFACE_DEFINED__ */ + + +#ifndef __ICorDebugProcess11_INTERFACE_DEFINED__ +#define __ICorDebugProcess11_INTERFACE_DEFINED__ + +/* interface ICorDebugProcess11 */ +/* [unique][uuid][local][object] */ + + +EXTERN_C const IID IID_ICorDebugProcess11; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("344B37AA-F2C0-4D3B-9909-91CCF787DA8C") + ICorDebugProcess11 : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE EnumerateLoaderHeapMemoryRegions( + /* [out] */ ICorDebugMemoryRangeEnum **ppRanges) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ICorDebugProcess11Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ICorDebugProcess11 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ICorDebugProcess11 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ICorDebugProcess11 * This); + + HRESULT ( STDMETHODCALLTYPE *EnumerateLoaderHeapMemoryRegions )( + ICorDebugProcess11 * This, + /* [out] */ ICorDebugMemoryRangeEnum **ppRanges); + + END_INTERFACE + } ICorDebugProcess11Vtbl; + + interface ICorDebugProcess11 + { + CONST_VTBL struct ICorDebugProcess11Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ICorDebugProcess11_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ICorDebugProcess11_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ICorDebugProcess11_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ICorDebugProcess11_EnumerateLoaderHeapMemoryRegions(This,ppRanges) \ + ( (This)->lpVtbl -> EnumerateLoaderHeapMemoryRegions(This,ppRanges) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ -#endif /* __ICorDebugProcess10_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcess11_INTERFACE_DEFINED__ */ #ifndef __ICorDebugModuleDebugEvent_INTERFACE_DEFINED__ @@ -7937,7 +8157,7 @@ EXTERN_C const IID IID_ICorDebugModuleDebugEvent; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugModuleDebugEventVtbl { @@ -7980,35 +8200,35 @@ EXTERN_C const IID IID_ICorDebugModuleDebugEvent; #ifdef COBJMACROS -#define ICorDebugModuleDebugEvent_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugModuleDebugEvent_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugModuleDebugEvent_AddRef(This) \ +#define ICorDebugModuleDebugEvent_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugModuleDebugEvent_Release(This) \ +#define ICorDebugModuleDebugEvent_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugModuleDebugEvent_GetEventKind(This,pDebugEventKind) \ +#define ICorDebugModuleDebugEvent_GetEventKind(This,pDebugEventKind) \ ( (This)->lpVtbl -> GetEventKind(This,pDebugEventKind) ) -#define ICorDebugModuleDebugEvent_GetThread(This,ppThread) \ +#define ICorDebugModuleDebugEvent_GetThread(This,ppThread) \ ( (This)->lpVtbl -> GetThread(This,ppThread) ) -#define ICorDebugModuleDebugEvent_GetModule(This,ppModule) \ +#define ICorDebugModuleDebugEvent_GetModule(This,ppModule) \ ( (This)->lpVtbl -> GetModule(This,ppModule) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugModuleDebugEvent_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugModuleDebugEvent_INTERFACE_DEFINED__ */ #ifndef __ICorDebugExceptionDebugEvent_INTERFACE_DEFINED__ @@ -8038,7 +8258,7 @@ EXTERN_C const IID IID_ICorDebugExceptionDebugEvent; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugExceptionDebugEventVtbl { @@ -8089,41 +8309,41 @@ EXTERN_C const IID IID_ICorDebugExceptionDebugEvent; #ifdef COBJMACROS -#define ICorDebugExceptionDebugEvent_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugExceptionDebugEvent_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugExceptionDebugEvent_AddRef(This) \ +#define ICorDebugExceptionDebugEvent_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugExceptionDebugEvent_Release(This) \ +#define ICorDebugExceptionDebugEvent_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugExceptionDebugEvent_GetEventKind(This,pDebugEventKind) \ +#define ICorDebugExceptionDebugEvent_GetEventKind(This,pDebugEventKind) \ ( (This)->lpVtbl -> GetEventKind(This,pDebugEventKind) ) -#define ICorDebugExceptionDebugEvent_GetThread(This,ppThread) \ +#define ICorDebugExceptionDebugEvent_GetThread(This,ppThread) \ ( (This)->lpVtbl -> GetThread(This,ppThread) ) -#define ICorDebugExceptionDebugEvent_GetStackPointer(This,pStackPointer) \ +#define ICorDebugExceptionDebugEvent_GetStackPointer(This,pStackPointer) \ ( (This)->lpVtbl -> GetStackPointer(This,pStackPointer) ) -#define ICorDebugExceptionDebugEvent_GetNativeIP(This,pIP) \ +#define ICorDebugExceptionDebugEvent_GetNativeIP(This,pIP) \ ( (This)->lpVtbl -> GetNativeIP(This,pIP) ) -#define ICorDebugExceptionDebugEvent_GetFlags(This,pdwFlags) \ +#define ICorDebugExceptionDebugEvent_GetFlags(This,pdwFlags) \ ( (This)->lpVtbl -> GetFlags(This,pdwFlags) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugExceptionDebugEvent_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugExceptionDebugEvent_INTERFACE_DEFINED__ */ #ifndef __ICorDebugBreakpoint_INTERFACE_DEFINED__ @@ -8150,7 +8370,7 @@ EXTERN_C const IID IID_ICorDebugBreakpoint; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugBreakpointVtbl { @@ -8189,31 +8409,31 @@ EXTERN_C const IID IID_ICorDebugBreakpoint; #ifdef COBJMACROS -#define ICorDebugBreakpoint_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugBreakpoint_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugBreakpoint_AddRef(This) \ +#define ICorDebugBreakpoint_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugBreakpoint_Release(This) \ +#define ICorDebugBreakpoint_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugBreakpoint_Activate(This,bActive) \ +#define ICorDebugBreakpoint_Activate(This,bActive) \ ( (This)->lpVtbl -> Activate(This,bActive) ) -#define ICorDebugBreakpoint_IsActive(This,pbActive) \ +#define ICorDebugBreakpoint_IsActive(This,pbActive) \ ( (This)->lpVtbl -> IsActive(This,pbActive) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugBreakpoint_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugBreakpoint_INTERFACE_DEFINED__ */ #ifndef __ICorDebugFunctionBreakpoint_INTERFACE_DEFINED__ @@ -8240,7 +8460,7 @@ EXTERN_C const IID IID_ICorDebugFunctionBreakpoint; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugFunctionBreakpointVtbl { @@ -8287,38 +8507,38 @@ EXTERN_C const IID IID_ICorDebugFunctionBreakpoint; #ifdef COBJMACROS -#define ICorDebugFunctionBreakpoint_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugFunctionBreakpoint_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugFunctionBreakpoint_AddRef(This) \ +#define ICorDebugFunctionBreakpoint_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugFunctionBreakpoint_Release(This) \ +#define ICorDebugFunctionBreakpoint_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugFunctionBreakpoint_Activate(This,bActive) \ +#define ICorDebugFunctionBreakpoint_Activate(This,bActive) \ ( (This)->lpVtbl -> Activate(This,bActive) ) -#define ICorDebugFunctionBreakpoint_IsActive(This,pbActive) \ +#define ICorDebugFunctionBreakpoint_IsActive(This,pbActive) \ ( (This)->lpVtbl -> IsActive(This,pbActive) ) -#define ICorDebugFunctionBreakpoint_GetFunction(This,ppFunction) \ +#define ICorDebugFunctionBreakpoint_GetFunction(This,ppFunction) \ ( (This)->lpVtbl -> GetFunction(This,ppFunction) ) -#define ICorDebugFunctionBreakpoint_GetOffset(This,pnOffset) \ +#define ICorDebugFunctionBreakpoint_GetOffset(This,pnOffset) \ ( (This)->lpVtbl -> GetOffset(This,pnOffset) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugFunctionBreakpoint_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugFunctionBreakpoint_INTERFACE_DEFINED__ */ #ifndef __ICorDebugModuleBreakpoint_INTERFACE_DEFINED__ @@ -8342,7 +8562,7 @@ EXTERN_C const IID IID_ICorDebugModuleBreakpoint; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugModuleBreakpointVtbl { @@ -8385,35 +8605,35 @@ EXTERN_C const IID IID_ICorDebugModuleBreakpoint; #ifdef COBJMACROS -#define ICorDebugModuleBreakpoint_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugModuleBreakpoint_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugModuleBreakpoint_AddRef(This) \ +#define ICorDebugModuleBreakpoint_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugModuleBreakpoint_Release(This) \ +#define ICorDebugModuleBreakpoint_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugModuleBreakpoint_Activate(This,bActive) \ +#define ICorDebugModuleBreakpoint_Activate(This,bActive) \ ( (This)->lpVtbl -> Activate(This,bActive) ) -#define ICorDebugModuleBreakpoint_IsActive(This,pbActive) \ +#define ICorDebugModuleBreakpoint_IsActive(This,pbActive) \ ( (This)->lpVtbl -> IsActive(This,pbActive) ) -#define ICorDebugModuleBreakpoint_GetModule(This,ppModule) \ +#define ICorDebugModuleBreakpoint_GetModule(This,ppModule) \ ( (This)->lpVtbl -> GetModule(This,ppModule) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugModuleBreakpoint_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugModuleBreakpoint_INTERFACE_DEFINED__ */ #ifndef __ICorDebugValueBreakpoint_INTERFACE_DEFINED__ @@ -8437,7 +8657,7 @@ EXTERN_C const IID IID_ICorDebugValueBreakpoint; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugValueBreakpointVtbl { @@ -8480,35 +8700,35 @@ EXTERN_C const IID IID_ICorDebugValueBreakpoint; #ifdef COBJMACROS -#define ICorDebugValueBreakpoint_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugValueBreakpoint_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugValueBreakpoint_AddRef(This) \ +#define ICorDebugValueBreakpoint_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugValueBreakpoint_Release(This) \ +#define ICorDebugValueBreakpoint_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugValueBreakpoint_Activate(This,bActive) \ +#define ICorDebugValueBreakpoint_Activate(This,bActive) \ ( (This)->lpVtbl -> Activate(This,bActive) ) -#define ICorDebugValueBreakpoint_IsActive(This,pbActive) \ +#define ICorDebugValueBreakpoint_IsActive(This,pbActive) \ ( (This)->lpVtbl -> IsActive(This,pbActive) ) -#define ICorDebugValueBreakpoint_GetValue(This,ppValue) \ +#define ICorDebugValueBreakpoint_GetValue(This,ppValue) \ ( (This)->lpVtbl -> GetValue(This,ppValue) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugValueBreakpoint_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugValueBreakpoint_INTERFACE_DEFINED__ */ #ifndef __ICorDebugStepper_INTERFACE_DEFINED__ @@ -8520,32 +8740,32 @@ EXTERN_C const IID IID_ICorDebugValueBreakpoint; typedef enum CorDebugIntercept { - INTERCEPT_NONE = 0, - INTERCEPT_CLASS_INIT = 0x1, - INTERCEPT_EXCEPTION_FILTER = 0x2, - INTERCEPT_SECURITY = 0x4, - INTERCEPT_CONTEXT_POLICY = 0x8, - INTERCEPT_INTERCEPTION = 0x10, - INTERCEPT_ALL = 0xffff - } CorDebugIntercept; + INTERCEPT_NONE = 0, + INTERCEPT_CLASS_INIT = 0x1, + INTERCEPT_EXCEPTION_FILTER = 0x2, + INTERCEPT_SECURITY = 0x4, + INTERCEPT_CONTEXT_POLICY = 0x8, + INTERCEPT_INTERCEPTION = 0x10, + INTERCEPT_ALL = 0xffff + } CorDebugIntercept; typedef enum CorDebugUnmappedStop { - STOP_NONE = 0, - STOP_PROLOG = 0x1, - STOP_EPILOG = 0x2, - STOP_NO_MAPPING_INFO = 0x4, - STOP_OTHER_UNMAPPED = 0x8, - STOP_UNMANAGED = 0x10, - STOP_ALL = 0xffff - } CorDebugUnmappedStop; + STOP_NONE = 0, + STOP_PROLOG = 0x1, + STOP_EPILOG = 0x2, + STOP_NO_MAPPING_INFO = 0x4, + STOP_OTHER_UNMAPPED = 0x8, + STOP_UNMANAGED = 0x10, + STOP_ALL = 0xffff + } CorDebugUnmappedStop; typedef struct COR_DEBUG_STEP_RANGE { ULONG32 startOffset; ULONG32 endOffset; - } COR_DEBUG_STEP_RANGE; + } COR_DEBUG_STEP_RANGE; EXTERN_C const IID IID_ICorDebugStepper; @@ -8583,7 +8803,7 @@ EXTERN_C const IID IID_ICorDebugStepper; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugStepperVtbl { @@ -8646,49 +8866,49 @@ EXTERN_C const IID IID_ICorDebugStepper; #ifdef COBJMACROS -#define ICorDebugStepper_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugStepper_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugStepper_AddRef(This) \ +#define ICorDebugStepper_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugStepper_Release(This) \ +#define ICorDebugStepper_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugStepper_IsActive(This,pbActive) \ +#define ICorDebugStepper_IsActive(This,pbActive) \ ( (This)->lpVtbl -> IsActive(This,pbActive) ) -#define ICorDebugStepper_Deactivate(This) \ +#define ICorDebugStepper_Deactivate(This) \ ( (This)->lpVtbl -> Deactivate(This) ) -#define ICorDebugStepper_SetInterceptMask(This,mask) \ +#define ICorDebugStepper_SetInterceptMask(This,mask) \ ( (This)->lpVtbl -> SetInterceptMask(This,mask) ) -#define ICorDebugStepper_SetUnmappedStopMask(This,mask) \ +#define ICorDebugStepper_SetUnmappedStopMask(This,mask) \ ( (This)->lpVtbl -> SetUnmappedStopMask(This,mask) ) -#define ICorDebugStepper_Step(This,bStepIn) \ +#define ICorDebugStepper_Step(This,bStepIn) \ ( (This)->lpVtbl -> Step(This,bStepIn) ) -#define ICorDebugStepper_StepRange(This,bStepIn,ranges,cRangeCount) \ +#define ICorDebugStepper_StepRange(This,bStepIn,ranges,cRangeCount) \ ( (This)->lpVtbl -> StepRange(This,bStepIn,ranges,cRangeCount) ) -#define ICorDebugStepper_StepOut(This) \ +#define ICorDebugStepper_StepOut(This) \ ( (This)->lpVtbl -> StepOut(This) ) -#define ICorDebugStepper_SetRangeIL(This,bIL) \ +#define ICorDebugStepper_SetRangeIL(This,bIL) \ ( (This)->lpVtbl -> SetRangeIL(This,bIL) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugStepper_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugStepper_INTERFACE_DEFINED__ */ #ifndef __ICorDebugStepper2_INTERFACE_DEFINED__ @@ -8712,7 +8932,7 @@ EXTERN_C const IID IID_ICorDebugStepper2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugStepper2Vtbl { @@ -8747,28 +8967,28 @@ EXTERN_C const IID IID_ICorDebugStepper2; #ifdef COBJMACROS -#define ICorDebugStepper2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugStepper2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugStepper2_AddRef(This) \ +#define ICorDebugStepper2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugStepper2_Release(This) \ +#define ICorDebugStepper2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugStepper2_SetJMC(This,fIsJMCStepper) \ +#define ICorDebugStepper2_SetJMC(This,fIsJMCStepper) \ ( (This)->lpVtbl -> SetJMC(This,fIsJMCStepper) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugStepper2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugStepper2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugRegisterSet_INTERFACE_DEFINED__ @@ -8780,176 +9000,176 @@ EXTERN_C const IID IID_ICorDebugStepper2; typedef enum CorDebugRegister { - REGISTER_INSTRUCTION_POINTER = 0, - REGISTER_STACK_POINTER = ( REGISTER_INSTRUCTION_POINTER + 1 ) , - REGISTER_FRAME_POINTER = ( REGISTER_STACK_POINTER + 1 ) , - REGISTER_X86_EIP = 0, - REGISTER_X86_ESP = ( REGISTER_X86_EIP + 1 ) , - REGISTER_X86_EBP = ( REGISTER_X86_ESP + 1 ) , - REGISTER_X86_EAX = ( REGISTER_X86_EBP + 1 ) , - REGISTER_X86_ECX = ( REGISTER_X86_EAX + 1 ) , - REGISTER_X86_EDX = ( REGISTER_X86_ECX + 1 ) , - REGISTER_X86_EBX = ( REGISTER_X86_EDX + 1 ) , - REGISTER_X86_ESI = ( REGISTER_X86_EBX + 1 ) , - REGISTER_X86_EDI = ( REGISTER_X86_ESI + 1 ) , - REGISTER_X86_FPSTACK_0 = ( REGISTER_X86_EDI + 1 ) , - REGISTER_X86_FPSTACK_1 = ( REGISTER_X86_FPSTACK_0 + 1 ) , - REGISTER_X86_FPSTACK_2 = ( REGISTER_X86_FPSTACK_1 + 1 ) , - REGISTER_X86_FPSTACK_3 = ( REGISTER_X86_FPSTACK_2 + 1 ) , - REGISTER_X86_FPSTACK_4 = ( REGISTER_X86_FPSTACK_3 + 1 ) , - REGISTER_X86_FPSTACK_5 = ( REGISTER_X86_FPSTACK_4 + 1 ) , - REGISTER_X86_FPSTACK_6 = ( REGISTER_X86_FPSTACK_5 + 1 ) , - REGISTER_X86_FPSTACK_7 = ( REGISTER_X86_FPSTACK_6 + 1 ) , - REGISTER_AMD64_RIP = 0, - REGISTER_AMD64_RSP = ( REGISTER_AMD64_RIP + 1 ) , - REGISTER_AMD64_RBP = ( REGISTER_AMD64_RSP + 1 ) , - REGISTER_AMD64_RAX = ( REGISTER_AMD64_RBP + 1 ) , - REGISTER_AMD64_RCX = ( REGISTER_AMD64_RAX + 1 ) , - REGISTER_AMD64_RDX = ( REGISTER_AMD64_RCX + 1 ) , - REGISTER_AMD64_RBX = ( REGISTER_AMD64_RDX + 1 ) , - REGISTER_AMD64_RSI = ( REGISTER_AMD64_RBX + 1 ) , - REGISTER_AMD64_RDI = ( REGISTER_AMD64_RSI + 1 ) , - REGISTER_AMD64_R8 = ( REGISTER_AMD64_RDI + 1 ) , - REGISTER_AMD64_R9 = ( REGISTER_AMD64_R8 + 1 ) , - REGISTER_AMD64_R10 = ( REGISTER_AMD64_R9 + 1 ) , - REGISTER_AMD64_R11 = ( REGISTER_AMD64_R10 + 1 ) , - REGISTER_AMD64_R12 = ( REGISTER_AMD64_R11 + 1 ) , - REGISTER_AMD64_R13 = ( REGISTER_AMD64_R12 + 1 ) , - REGISTER_AMD64_R14 = ( REGISTER_AMD64_R13 + 1 ) , - REGISTER_AMD64_R15 = ( REGISTER_AMD64_R14 + 1 ) , - REGISTER_AMD64_XMM0 = ( REGISTER_AMD64_R15 + 1 ) , - REGISTER_AMD64_XMM1 = ( REGISTER_AMD64_XMM0 + 1 ) , - REGISTER_AMD64_XMM2 = ( REGISTER_AMD64_XMM1 + 1 ) , - REGISTER_AMD64_XMM3 = ( REGISTER_AMD64_XMM2 + 1 ) , - REGISTER_AMD64_XMM4 = ( REGISTER_AMD64_XMM3 + 1 ) , - REGISTER_AMD64_XMM5 = ( REGISTER_AMD64_XMM4 + 1 ) , - REGISTER_AMD64_XMM6 = ( REGISTER_AMD64_XMM5 + 1 ) , - REGISTER_AMD64_XMM7 = ( REGISTER_AMD64_XMM6 + 1 ) , - REGISTER_AMD64_XMM8 = ( REGISTER_AMD64_XMM7 + 1 ) , - REGISTER_AMD64_XMM9 = ( REGISTER_AMD64_XMM8 + 1 ) , - REGISTER_AMD64_XMM10 = ( REGISTER_AMD64_XMM9 + 1 ) , - REGISTER_AMD64_XMM11 = ( REGISTER_AMD64_XMM10 + 1 ) , - REGISTER_AMD64_XMM12 = ( REGISTER_AMD64_XMM11 + 1 ) , - REGISTER_AMD64_XMM13 = ( REGISTER_AMD64_XMM12 + 1 ) , - REGISTER_AMD64_XMM14 = ( REGISTER_AMD64_XMM13 + 1 ) , - REGISTER_AMD64_XMM15 = ( REGISTER_AMD64_XMM14 + 1 ) , - REGISTER_IA64_BSP = REGISTER_FRAME_POINTER, - REGISTER_IA64_R0 = ( REGISTER_IA64_BSP + 1 ) , - REGISTER_IA64_F0 = ( REGISTER_IA64_R0 + 128 ) , - REGISTER_ARM_PC = 0, - REGISTER_ARM_SP = ( REGISTER_ARM_PC + 1 ) , - REGISTER_ARM_R0 = ( REGISTER_ARM_SP + 1 ) , - REGISTER_ARM_R1 = ( REGISTER_ARM_R0 + 1 ) , - REGISTER_ARM_R2 = ( REGISTER_ARM_R1 + 1 ) , - REGISTER_ARM_R3 = ( REGISTER_ARM_R2 + 1 ) , - REGISTER_ARM_R4 = ( REGISTER_ARM_R3 + 1 ) , - REGISTER_ARM_R5 = ( REGISTER_ARM_R4 + 1 ) , - REGISTER_ARM_R6 = ( REGISTER_ARM_R5 + 1 ) , - REGISTER_ARM_R7 = ( REGISTER_ARM_R6 + 1 ) , - REGISTER_ARM_R8 = ( REGISTER_ARM_R7 + 1 ) , - REGISTER_ARM_R9 = ( REGISTER_ARM_R8 + 1 ) , - REGISTER_ARM_R10 = ( REGISTER_ARM_R9 + 1 ) , - REGISTER_ARM_R11 = ( REGISTER_ARM_R10 + 1 ) , - REGISTER_ARM_R12 = ( REGISTER_ARM_R11 + 1 ) , - REGISTER_ARM_LR = ( REGISTER_ARM_R12 + 1 ) , - REGISTER_ARM_D0 = ( REGISTER_ARM_LR + 1 ) , - REGISTER_ARM_D1 = ( REGISTER_ARM_D0 + 1 ) , - REGISTER_ARM_D2 = ( REGISTER_ARM_D1 + 1 ) , - REGISTER_ARM_D3 = ( REGISTER_ARM_D2 + 1 ) , - REGISTER_ARM_D4 = ( REGISTER_ARM_D3 + 1 ) , - REGISTER_ARM_D5 = ( REGISTER_ARM_D4 + 1 ) , - REGISTER_ARM_D6 = ( REGISTER_ARM_D5 + 1 ) , - REGISTER_ARM_D7 = ( REGISTER_ARM_D6 + 1 ) , - REGISTER_ARM_D8 = ( REGISTER_ARM_D7 + 1 ) , - REGISTER_ARM_D9 = ( REGISTER_ARM_D8 + 1 ) , - REGISTER_ARM_D10 = ( REGISTER_ARM_D9 + 1 ) , - REGISTER_ARM_D11 = ( REGISTER_ARM_D10 + 1 ) , - REGISTER_ARM_D12 = ( REGISTER_ARM_D11 + 1 ) , - REGISTER_ARM_D13 = ( REGISTER_ARM_D12 + 1 ) , - REGISTER_ARM_D14 = ( REGISTER_ARM_D13 + 1 ) , - REGISTER_ARM_D15 = ( REGISTER_ARM_D14 + 1 ) , - REGISTER_ARM_D16 = ( REGISTER_ARM_D15 + 1 ) , - REGISTER_ARM_D17 = ( REGISTER_ARM_D16 + 1 ) , - REGISTER_ARM_D18 = ( REGISTER_ARM_D17 + 1 ) , - REGISTER_ARM_D19 = ( REGISTER_ARM_D18 + 1 ) , - REGISTER_ARM_D20 = ( REGISTER_ARM_D19 + 1 ) , - REGISTER_ARM_D21 = ( REGISTER_ARM_D20 + 1 ) , - REGISTER_ARM_D22 = ( REGISTER_ARM_D21 + 1 ) , - REGISTER_ARM_D23 = ( REGISTER_ARM_D22 + 1 ) , - REGISTER_ARM_D24 = ( REGISTER_ARM_D23 + 1 ) , - REGISTER_ARM_D25 = ( REGISTER_ARM_D24 + 1 ) , - REGISTER_ARM_D26 = ( REGISTER_ARM_D25 + 1 ) , - REGISTER_ARM_D27 = ( REGISTER_ARM_D26 + 1 ) , - REGISTER_ARM_D28 = ( REGISTER_ARM_D27 + 1 ) , - REGISTER_ARM_D29 = ( REGISTER_ARM_D28 + 1 ) , - REGISTER_ARM_D30 = ( REGISTER_ARM_D29 + 1 ) , - REGISTER_ARM_D31 = ( REGISTER_ARM_D30 + 1 ) , - REGISTER_ARM64_PC = 0, - REGISTER_ARM64_SP = ( REGISTER_ARM64_PC + 1 ) , - REGISTER_ARM64_FP = ( REGISTER_ARM64_SP + 1 ) , - REGISTER_ARM64_X0 = ( REGISTER_ARM64_FP + 1 ) , - REGISTER_ARM64_X1 = ( REGISTER_ARM64_X0 + 1 ) , - REGISTER_ARM64_X2 = ( REGISTER_ARM64_X1 + 1 ) , - REGISTER_ARM64_X3 = ( REGISTER_ARM64_X2 + 1 ) , - REGISTER_ARM64_X4 = ( REGISTER_ARM64_X3 + 1 ) , - REGISTER_ARM64_X5 = ( REGISTER_ARM64_X4 + 1 ) , - REGISTER_ARM64_X6 = ( REGISTER_ARM64_X5 + 1 ) , - REGISTER_ARM64_X7 = ( REGISTER_ARM64_X6 + 1 ) , - REGISTER_ARM64_X8 = ( REGISTER_ARM64_X7 + 1 ) , - REGISTER_ARM64_X9 = ( REGISTER_ARM64_X8 + 1 ) , - REGISTER_ARM64_X10 = ( REGISTER_ARM64_X9 + 1 ) , - REGISTER_ARM64_X11 = ( REGISTER_ARM64_X10 + 1 ) , - REGISTER_ARM64_X12 = ( REGISTER_ARM64_X11 + 1 ) , - REGISTER_ARM64_X13 = ( REGISTER_ARM64_X12 + 1 ) , - REGISTER_ARM64_X14 = ( REGISTER_ARM64_X13 + 1 ) , - REGISTER_ARM64_X15 = ( REGISTER_ARM64_X14 + 1 ) , - REGISTER_ARM64_X16 = ( REGISTER_ARM64_X15 + 1 ) , - REGISTER_ARM64_X17 = ( REGISTER_ARM64_X16 + 1 ) , - REGISTER_ARM64_X18 = ( REGISTER_ARM64_X17 + 1 ) , - REGISTER_ARM64_X19 = ( REGISTER_ARM64_X18 + 1 ) , - REGISTER_ARM64_X20 = ( REGISTER_ARM64_X19 + 1 ) , - REGISTER_ARM64_X21 = ( REGISTER_ARM64_X20 + 1 ) , - REGISTER_ARM64_X22 = ( REGISTER_ARM64_X21 + 1 ) , - REGISTER_ARM64_X23 = ( REGISTER_ARM64_X22 + 1 ) , - REGISTER_ARM64_X24 = ( REGISTER_ARM64_X23 + 1 ) , - REGISTER_ARM64_X25 = ( REGISTER_ARM64_X24 + 1 ) , - REGISTER_ARM64_X26 = ( REGISTER_ARM64_X25 + 1 ) , - REGISTER_ARM64_X27 = ( REGISTER_ARM64_X26 + 1 ) , - REGISTER_ARM64_X28 = ( REGISTER_ARM64_X27 + 1 ) , - REGISTER_ARM64_LR = ( REGISTER_ARM64_X28 + 1 ) , - REGISTER_ARM64_V0 = ( REGISTER_ARM64_LR + 1 ) , - REGISTER_ARM64_V1 = ( REGISTER_ARM64_V0 + 1 ) , - REGISTER_ARM64_V2 = ( REGISTER_ARM64_V1 + 1 ) , - REGISTER_ARM64_V3 = ( REGISTER_ARM64_V2 + 1 ) , - REGISTER_ARM64_V4 = ( REGISTER_ARM64_V3 + 1 ) , - REGISTER_ARM64_V5 = ( REGISTER_ARM64_V4 + 1 ) , - REGISTER_ARM64_V6 = ( REGISTER_ARM64_V5 + 1 ) , - REGISTER_ARM64_V7 = ( REGISTER_ARM64_V6 + 1 ) , - REGISTER_ARM64_V8 = ( REGISTER_ARM64_V7 + 1 ) , - REGISTER_ARM64_V9 = ( REGISTER_ARM64_V8 + 1 ) , - REGISTER_ARM64_V10 = ( REGISTER_ARM64_V9 + 1 ) , - REGISTER_ARM64_V11 = ( REGISTER_ARM64_V10 + 1 ) , - REGISTER_ARM64_V12 = ( REGISTER_ARM64_V11 + 1 ) , - REGISTER_ARM64_V13 = ( REGISTER_ARM64_V12 + 1 ) , - REGISTER_ARM64_V14 = ( REGISTER_ARM64_V13 + 1 ) , - REGISTER_ARM64_V15 = ( REGISTER_ARM64_V14 + 1 ) , - REGISTER_ARM64_V16 = ( REGISTER_ARM64_V15 + 1 ) , - REGISTER_ARM64_V17 = ( REGISTER_ARM64_V16 + 1 ) , - REGISTER_ARM64_V18 = ( REGISTER_ARM64_V17 + 1 ) , - REGISTER_ARM64_V19 = ( REGISTER_ARM64_V18 + 1 ) , - REGISTER_ARM64_V20 = ( REGISTER_ARM64_V19 + 1 ) , - REGISTER_ARM64_V21 = ( REGISTER_ARM64_V20 + 1 ) , - REGISTER_ARM64_V22 = ( REGISTER_ARM64_V21 + 1 ) , - REGISTER_ARM64_V23 = ( REGISTER_ARM64_V22 + 1 ) , - REGISTER_ARM64_V24 = ( REGISTER_ARM64_V23 + 1 ) , - REGISTER_ARM64_V25 = ( REGISTER_ARM64_V24 + 1 ) , - REGISTER_ARM64_V26 = ( REGISTER_ARM64_V25 + 1 ) , - REGISTER_ARM64_V27 = ( REGISTER_ARM64_V26 + 1 ) , - REGISTER_ARM64_V28 = ( REGISTER_ARM64_V27 + 1 ) , - REGISTER_ARM64_V29 = ( REGISTER_ARM64_V28 + 1 ) , - REGISTER_ARM64_V30 = ( REGISTER_ARM64_V29 + 1 ) , - REGISTER_ARM64_V31 = ( REGISTER_ARM64_V30 + 1 ) - } CorDebugRegister; + REGISTER_INSTRUCTION_POINTER = 0, + REGISTER_STACK_POINTER = ( REGISTER_INSTRUCTION_POINTER + 1 ) , + REGISTER_FRAME_POINTER = ( REGISTER_STACK_POINTER + 1 ) , + REGISTER_X86_EIP = 0, + REGISTER_X86_ESP = ( REGISTER_X86_EIP + 1 ) , + REGISTER_X86_EBP = ( REGISTER_X86_ESP + 1 ) , + REGISTER_X86_EAX = ( REGISTER_X86_EBP + 1 ) , + REGISTER_X86_ECX = ( REGISTER_X86_EAX + 1 ) , + REGISTER_X86_EDX = ( REGISTER_X86_ECX + 1 ) , + REGISTER_X86_EBX = ( REGISTER_X86_EDX + 1 ) , + REGISTER_X86_ESI = ( REGISTER_X86_EBX + 1 ) , + REGISTER_X86_EDI = ( REGISTER_X86_ESI + 1 ) , + REGISTER_X86_FPSTACK_0 = ( REGISTER_X86_EDI + 1 ) , + REGISTER_X86_FPSTACK_1 = ( REGISTER_X86_FPSTACK_0 + 1 ) , + REGISTER_X86_FPSTACK_2 = ( REGISTER_X86_FPSTACK_1 + 1 ) , + REGISTER_X86_FPSTACK_3 = ( REGISTER_X86_FPSTACK_2 + 1 ) , + REGISTER_X86_FPSTACK_4 = ( REGISTER_X86_FPSTACK_3 + 1 ) , + REGISTER_X86_FPSTACK_5 = ( REGISTER_X86_FPSTACK_4 + 1 ) , + REGISTER_X86_FPSTACK_6 = ( REGISTER_X86_FPSTACK_5 + 1 ) , + REGISTER_X86_FPSTACK_7 = ( REGISTER_X86_FPSTACK_6 + 1 ) , + REGISTER_AMD64_RIP = 0, + REGISTER_AMD64_RSP = ( REGISTER_AMD64_RIP + 1 ) , + REGISTER_AMD64_RBP = ( REGISTER_AMD64_RSP + 1 ) , + REGISTER_AMD64_RAX = ( REGISTER_AMD64_RBP + 1 ) , + REGISTER_AMD64_RCX = ( REGISTER_AMD64_RAX + 1 ) , + REGISTER_AMD64_RDX = ( REGISTER_AMD64_RCX + 1 ) , + REGISTER_AMD64_RBX = ( REGISTER_AMD64_RDX + 1 ) , + REGISTER_AMD64_RSI = ( REGISTER_AMD64_RBX + 1 ) , + REGISTER_AMD64_RDI = ( REGISTER_AMD64_RSI + 1 ) , + REGISTER_AMD64_R8 = ( REGISTER_AMD64_RDI + 1 ) , + REGISTER_AMD64_R9 = ( REGISTER_AMD64_R8 + 1 ) , + REGISTER_AMD64_R10 = ( REGISTER_AMD64_R9 + 1 ) , + REGISTER_AMD64_R11 = ( REGISTER_AMD64_R10 + 1 ) , + REGISTER_AMD64_R12 = ( REGISTER_AMD64_R11 + 1 ) , + REGISTER_AMD64_R13 = ( REGISTER_AMD64_R12 + 1 ) , + REGISTER_AMD64_R14 = ( REGISTER_AMD64_R13 + 1 ) , + REGISTER_AMD64_R15 = ( REGISTER_AMD64_R14 + 1 ) , + REGISTER_AMD64_XMM0 = ( REGISTER_AMD64_R15 + 1 ) , + REGISTER_AMD64_XMM1 = ( REGISTER_AMD64_XMM0 + 1 ) , + REGISTER_AMD64_XMM2 = ( REGISTER_AMD64_XMM1 + 1 ) , + REGISTER_AMD64_XMM3 = ( REGISTER_AMD64_XMM2 + 1 ) , + REGISTER_AMD64_XMM4 = ( REGISTER_AMD64_XMM3 + 1 ) , + REGISTER_AMD64_XMM5 = ( REGISTER_AMD64_XMM4 + 1 ) , + REGISTER_AMD64_XMM6 = ( REGISTER_AMD64_XMM5 + 1 ) , + REGISTER_AMD64_XMM7 = ( REGISTER_AMD64_XMM6 + 1 ) , + REGISTER_AMD64_XMM8 = ( REGISTER_AMD64_XMM7 + 1 ) , + REGISTER_AMD64_XMM9 = ( REGISTER_AMD64_XMM8 + 1 ) , + REGISTER_AMD64_XMM10 = ( REGISTER_AMD64_XMM9 + 1 ) , + REGISTER_AMD64_XMM11 = ( REGISTER_AMD64_XMM10 + 1 ) , + REGISTER_AMD64_XMM12 = ( REGISTER_AMD64_XMM11 + 1 ) , + REGISTER_AMD64_XMM13 = ( REGISTER_AMD64_XMM12 + 1 ) , + REGISTER_AMD64_XMM14 = ( REGISTER_AMD64_XMM13 + 1 ) , + REGISTER_AMD64_XMM15 = ( REGISTER_AMD64_XMM14 + 1 ) , + REGISTER_IA64_BSP = REGISTER_FRAME_POINTER, + REGISTER_IA64_R0 = ( REGISTER_IA64_BSP + 1 ) , + REGISTER_IA64_F0 = ( REGISTER_IA64_R0 + 128 ) , + REGISTER_ARM_PC = 0, + REGISTER_ARM_SP = ( REGISTER_ARM_PC + 1 ) , + REGISTER_ARM_R0 = ( REGISTER_ARM_SP + 1 ) , + REGISTER_ARM_R1 = ( REGISTER_ARM_R0 + 1 ) , + REGISTER_ARM_R2 = ( REGISTER_ARM_R1 + 1 ) , + REGISTER_ARM_R3 = ( REGISTER_ARM_R2 + 1 ) , + REGISTER_ARM_R4 = ( REGISTER_ARM_R3 + 1 ) , + REGISTER_ARM_R5 = ( REGISTER_ARM_R4 + 1 ) , + REGISTER_ARM_R6 = ( REGISTER_ARM_R5 + 1 ) , + REGISTER_ARM_R7 = ( REGISTER_ARM_R6 + 1 ) , + REGISTER_ARM_R8 = ( REGISTER_ARM_R7 + 1 ) , + REGISTER_ARM_R9 = ( REGISTER_ARM_R8 + 1 ) , + REGISTER_ARM_R10 = ( REGISTER_ARM_R9 + 1 ) , + REGISTER_ARM_R11 = ( REGISTER_ARM_R10 + 1 ) , + REGISTER_ARM_R12 = ( REGISTER_ARM_R11 + 1 ) , + REGISTER_ARM_LR = ( REGISTER_ARM_R12 + 1 ) , + REGISTER_ARM_D0 = ( REGISTER_ARM_LR + 1 ) , + REGISTER_ARM_D1 = ( REGISTER_ARM_D0 + 1 ) , + REGISTER_ARM_D2 = ( REGISTER_ARM_D1 + 1 ) , + REGISTER_ARM_D3 = ( REGISTER_ARM_D2 + 1 ) , + REGISTER_ARM_D4 = ( REGISTER_ARM_D3 + 1 ) , + REGISTER_ARM_D5 = ( REGISTER_ARM_D4 + 1 ) , + REGISTER_ARM_D6 = ( REGISTER_ARM_D5 + 1 ) , + REGISTER_ARM_D7 = ( REGISTER_ARM_D6 + 1 ) , + REGISTER_ARM_D8 = ( REGISTER_ARM_D7 + 1 ) , + REGISTER_ARM_D9 = ( REGISTER_ARM_D8 + 1 ) , + REGISTER_ARM_D10 = ( REGISTER_ARM_D9 + 1 ) , + REGISTER_ARM_D11 = ( REGISTER_ARM_D10 + 1 ) , + REGISTER_ARM_D12 = ( REGISTER_ARM_D11 + 1 ) , + REGISTER_ARM_D13 = ( REGISTER_ARM_D12 + 1 ) , + REGISTER_ARM_D14 = ( REGISTER_ARM_D13 + 1 ) , + REGISTER_ARM_D15 = ( REGISTER_ARM_D14 + 1 ) , + REGISTER_ARM_D16 = ( REGISTER_ARM_D15 + 1 ) , + REGISTER_ARM_D17 = ( REGISTER_ARM_D16 + 1 ) , + REGISTER_ARM_D18 = ( REGISTER_ARM_D17 + 1 ) , + REGISTER_ARM_D19 = ( REGISTER_ARM_D18 + 1 ) , + REGISTER_ARM_D20 = ( REGISTER_ARM_D19 + 1 ) , + REGISTER_ARM_D21 = ( REGISTER_ARM_D20 + 1 ) , + REGISTER_ARM_D22 = ( REGISTER_ARM_D21 + 1 ) , + REGISTER_ARM_D23 = ( REGISTER_ARM_D22 + 1 ) , + REGISTER_ARM_D24 = ( REGISTER_ARM_D23 + 1 ) , + REGISTER_ARM_D25 = ( REGISTER_ARM_D24 + 1 ) , + REGISTER_ARM_D26 = ( REGISTER_ARM_D25 + 1 ) , + REGISTER_ARM_D27 = ( REGISTER_ARM_D26 + 1 ) , + REGISTER_ARM_D28 = ( REGISTER_ARM_D27 + 1 ) , + REGISTER_ARM_D29 = ( REGISTER_ARM_D28 + 1 ) , + REGISTER_ARM_D30 = ( REGISTER_ARM_D29 + 1 ) , + REGISTER_ARM_D31 = ( REGISTER_ARM_D30 + 1 ) , + REGISTER_ARM64_PC = 0, + REGISTER_ARM64_SP = ( REGISTER_ARM64_PC + 1 ) , + REGISTER_ARM64_FP = ( REGISTER_ARM64_SP + 1 ) , + REGISTER_ARM64_X0 = ( REGISTER_ARM64_FP + 1 ) , + REGISTER_ARM64_X1 = ( REGISTER_ARM64_X0 + 1 ) , + REGISTER_ARM64_X2 = ( REGISTER_ARM64_X1 + 1 ) , + REGISTER_ARM64_X3 = ( REGISTER_ARM64_X2 + 1 ) , + REGISTER_ARM64_X4 = ( REGISTER_ARM64_X3 + 1 ) , + REGISTER_ARM64_X5 = ( REGISTER_ARM64_X4 + 1 ) , + REGISTER_ARM64_X6 = ( REGISTER_ARM64_X5 + 1 ) , + REGISTER_ARM64_X7 = ( REGISTER_ARM64_X6 + 1 ) , + REGISTER_ARM64_X8 = ( REGISTER_ARM64_X7 + 1 ) , + REGISTER_ARM64_X9 = ( REGISTER_ARM64_X8 + 1 ) , + REGISTER_ARM64_X10 = ( REGISTER_ARM64_X9 + 1 ) , + REGISTER_ARM64_X11 = ( REGISTER_ARM64_X10 + 1 ) , + REGISTER_ARM64_X12 = ( REGISTER_ARM64_X11 + 1 ) , + REGISTER_ARM64_X13 = ( REGISTER_ARM64_X12 + 1 ) , + REGISTER_ARM64_X14 = ( REGISTER_ARM64_X13 + 1 ) , + REGISTER_ARM64_X15 = ( REGISTER_ARM64_X14 + 1 ) , + REGISTER_ARM64_X16 = ( REGISTER_ARM64_X15 + 1 ) , + REGISTER_ARM64_X17 = ( REGISTER_ARM64_X16 + 1 ) , + REGISTER_ARM64_X18 = ( REGISTER_ARM64_X17 + 1 ) , + REGISTER_ARM64_X19 = ( REGISTER_ARM64_X18 + 1 ) , + REGISTER_ARM64_X20 = ( REGISTER_ARM64_X19 + 1 ) , + REGISTER_ARM64_X21 = ( REGISTER_ARM64_X20 + 1 ) , + REGISTER_ARM64_X22 = ( REGISTER_ARM64_X21 + 1 ) , + REGISTER_ARM64_X23 = ( REGISTER_ARM64_X22 + 1 ) , + REGISTER_ARM64_X24 = ( REGISTER_ARM64_X23 + 1 ) , + REGISTER_ARM64_X25 = ( REGISTER_ARM64_X24 + 1 ) , + REGISTER_ARM64_X26 = ( REGISTER_ARM64_X25 + 1 ) , + REGISTER_ARM64_X27 = ( REGISTER_ARM64_X26 + 1 ) , + REGISTER_ARM64_X28 = ( REGISTER_ARM64_X27 + 1 ) , + REGISTER_ARM64_LR = ( REGISTER_ARM64_X28 + 1 ) , + REGISTER_ARM64_V0 = ( REGISTER_ARM64_LR + 1 ) , + REGISTER_ARM64_V1 = ( REGISTER_ARM64_V0 + 1 ) , + REGISTER_ARM64_V2 = ( REGISTER_ARM64_V1 + 1 ) , + REGISTER_ARM64_V3 = ( REGISTER_ARM64_V2 + 1 ) , + REGISTER_ARM64_V4 = ( REGISTER_ARM64_V3 + 1 ) , + REGISTER_ARM64_V5 = ( REGISTER_ARM64_V4 + 1 ) , + REGISTER_ARM64_V6 = ( REGISTER_ARM64_V5 + 1 ) , + REGISTER_ARM64_V7 = ( REGISTER_ARM64_V6 + 1 ) , + REGISTER_ARM64_V8 = ( REGISTER_ARM64_V7 + 1 ) , + REGISTER_ARM64_V9 = ( REGISTER_ARM64_V8 + 1 ) , + REGISTER_ARM64_V10 = ( REGISTER_ARM64_V9 + 1 ) , + REGISTER_ARM64_V11 = ( REGISTER_ARM64_V10 + 1 ) , + REGISTER_ARM64_V12 = ( REGISTER_ARM64_V11 + 1 ) , + REGISTER_ARM64_V13 = ( REGISTER_ARM64_V12 + 1 ) , + REGISTER_ARM64_V14 = ( REGISTER_ARM64_V13 + 1 ) , + REGISTER_ARM64_V15 = ( REGISTER_ARM64_V14 + 1 ) , + REGISTER_ARM64_V16 = ( REGISTER_ARM64_V15 + 1 ) , + REGISTER_ARM64_V17 = ( REGISTER_ARM64_V16 + 1 ) , + REGISTER_ARM64_V18 = ( REGISTER_ARM64_V17 + 1 ) , + REGISTER_ARM64_V19 = ( REGISTER_ARM64_V18 + 1 ) , + REGISTER_ARM64_V20 = ( REGISTER_ARM64_V19 + 1 ) , + REGISTER_ARM64_V21 = ( REGISTER_ARM64_V20 + 1 ) , + REGISTER_ARM64_V22 = ( REGISTER_ARM64_V21 + 1 ) , + REGISTER_ARM64_V23 = ( REGISTER_ARM64_V22 + 1 ) , + REGISTER_ARM64_V24 = ( REGISTER_ARM64_V23 + 1 ) , + REGISTER_ARM64_V25 = ( REGISTER_ARM64_V24 + 1 ) , + REGISTER_ARM64_V26 = ( REGISTER_ARM64_V25 + 1 ) , + REGISTER_ARM64_V27 = ( REGISTER_ARM64_V26 + 1 ) , + REGISTER_ARM64_V28 = ( REGISTER_ARM64_V27 + 1 ) , + REGISTER_ARM64_V29 = ( REGISTER_ARM64_V28 + 1 ) , + REGISTER_ARM64_V30 = ( REGISTER_ARM64_V29 + 1 ) , + REGISTER_ARM64_V31 = ( REGISTER_ARM64_V30 + 1 ) + } CorDebugRegister; EXTERN_C const IID IID_ICorDebugRegisterSet; @@ -8984,7 +9204,7 @@ EXTERN_C const IID IID_ICorDebugRegisterSet; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugRegisterSetVtbl { @@ -9041,40 +9261,40 @@ EXTERN_C const IID IID_ICorDebugRegisterSet; #ifdef COBJMACROS -#define ICorDebugRegisterSet_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugRegisterSet_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugRegisterSet_AddRef(This) \ +#define ICorDebugRegisterSet_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugRegisterSet_Release(This) \ +#define ICorDebugRegisterSet_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugRegisterSet_GetRegistersAvailable(This,pAvailable) \ +#define ICorDebugRegisterSet_GetRegistersAvailable(This,pAvailable) \ ( (This)->lpVtbl -> GetRegistersAvailable(This,pAvailable) ) -#define ICorDebugRegisterSet_GetRegisters(This,mask,regCount,regBuffer) \ +#define ICorDebugRegisterSet_GetRegisters(This,mask,regCount,regBuffer) \ ( (This)->lpVtbl -> GetRegisters(This,mask,regCount,regBuffer) ) -#define ICorDebugRegisterSet_SetRegisters(This,mask,regCount,regBuffer) \ +#define ICorDebugRegisterSet_SetRegisters(This,mask,regCount,regBuffer) \ ( (This)->lpVtbl -> SetRegisters(This,mask,regCount,regBuffer) ) -#define ICorDebugRegisterSet_GetThreadContext(This,contextSize,context) \ +#define ICorDebugRegisterSet_GetThreadContext(This,contextSize,context) \ ( (This)->lpVtbl -> GetThreadContext(This,contextSize,context) ) -#define ICorDebugRegisterSet_SetThreadContext(This,contextSize,context) \ +#define ICorDebugRegisterSet_SetThreadContext(This,contextSize,context) \ ( (This)->lpVtbl -> SetThreadContext(This,contextSize,context) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugRegisterSet_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugRegisterSet_INTERFACE_DEFINED__ */ #ifndef __ICorDebugRegisterSet2_INTERFACE_DEFINED__ @@ -9111,7 +9331,7 @@ EXTERN_C const IID IID_ICorDebugRegisterSet2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugRegisterSet2Vtbl { @@ -9161,34 +9381,34 @@ EXTERN_C const IID IID_ICorDebugRegisterSet2; #ifdef COBJMACROS -#define ICorDebugRegisterSet2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugRegisterSet2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugRegisterSet2_AddRef(This) \ +#define ICorDebugRegisterSet2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugRegisterSet2_Release(This) \ +#define ICorDebugRegisterSet2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugRegisterSet2_GetRegistersAvailable(This,numChunks,availableRegChunks) \ +#define ICorDebugRegisterSet2_GetRegistersAvailable(This,numChunks,availableRegChunks) \ ( (This)->lpVtbl -> GetRegistersAvailable(This,numChunks,availableRegChunks) ) -#define ICorDebugRegisterSet2_GetRegisters(This,maskCount,mask,regCount,regBuffer) \ +#define ICorDebugRegisterSet2_GetRegisters(This,maskCount,mask,regCount,regBuffer) \ ( (This)->lpVtbl -> GetRegisters(This,maskCount,mask,regCount,regBuffer) ) -#define ICorDebugRegisterSet2_SetRegisters(This,maskCount,mask,regCount,regBuffer) \ +#define ICorDebugRegisterSet2_SetRegisters(This,maskCount,mask,regCount,regBuffer) \ ( (This)->lpVtbl -> SetRegisters(This,maskCount,mask,regCount,regBuffer) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugRegisterSet2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugRegisterSet2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugThread_INTERFACE_DEFINED__ @@ -9200,16 +9420,16 @@ EXTERN_C const IID IID_ICorDebugRegisterSet2; typedef enum CorDebugUserState { - USER_STOP_REQUESTED = 0x1, - USER_SUSPEND_REQUESTED = 0x2, - USER_BACKGROUND = 0x4, - USER_UNSTARTED = 0x8, - USER_STOPPED = 0x10, - USER_WAIT_SLEEP_JOIN = 0x20, - USER_SUSPENDED = 0x40, - USER_UNSAFE_POINT = 0x80, - USER_THREADPOOL = 0x100 - } CorDebugUserState; + USER_STOP_REQUESTED = 0x1, + USER_SUSPEND_REQUESTED = 0x2, + USER_BACKGROUND = 0x4, + USER_UNSTARTED = 0x8, + USER_STOPPED = 0x10, + USER_WAIT_SLEEP_JOIN = 0x20, + USER_SUSPENDED = 0x40, + USER_UNSAFE_POINT = 0x80, + USER_THREADPOOL = 0x100 + } CorDebugUserState; EXTERN_C const IID IID_ICorDebugThread; @@ -9270,7 +9490,7 @@ EXTERN_C const IID IID_ICorDebugThread; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugThreadVtbl { @@ -9364,73 +9584,73 @@ EXTERN_C const IID IID_ICorDebugThread; #ifdef COBJMACROS -#define ICorDebugThread_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugThread_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugThread_AddRef(This) \ +#define ICorDebugThread_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugThread_Release(This) \ +#define ICorDebugThread_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugThread_GetProcess(This,ppProcess) \ +#define ICorDebugThread_GetProcess(This,ppProcess) \ ( (This)->lpVtbl -> GetProcess(This,ppProcess) ) -#define ICorDebugThread_GetID(This,pdwThreadId) \ +#define ICorDebugThread_GetID(This,pdwThreadId) \ ( (This)->lpVtbl -> GetID(This,pdwThreadId) ) -#define ICorDebugThread_GetHandle(This,phThreadHandle) \ +#define ICorDebugThread_GetHandle(This,phThreadHandle) \ ( (This)->lpVtbl -> GetHandle(This,phThreadHandle) ) -#define ICorDebugThread_GetAppDomain(This,ppAppDomain) \ +#define ICorDebugThread_GetAppDomain(This,ppAppDomain) \ ( (This)->lpVtbl -> GetAppDomain(This,ppAppDomain) ) -#define ICorDebugThread_SetDebugState(This,state) \ +#define ICorDebugThread_SetDebugState(This,state) \ ( (This)->lpVtbl -> SetDebugState(This,state) ) -#define ICorDebugThread_GetDebugState(This,pState) \ +#define ICorDebugThread_GetDebugState(This,pState) \ ( (This)->lpVtbl -> GetDebugState(This,pState) ) -#define ICorDebugThread_GetUserState(This,pState) \ +#define ICorDebugThread_GetUserState(This,pState) \ ( (This)->lpVtbl -> GetUserState(This,pState) ) -#define ICorDebugThread_GetCurrentException(This,ppExceptionObject) \ +#define ICorDebugThread_GetCurrentException(This,ppExceptionObject) \ ( (This)->lpVtbl -> GetCurrentException(This,ppExceptionObject) ) -#define ICorDebugThread_ClearCurrentException(This) \ +#define ICorDebugThread_ClearCurrentException(This) \ ( (This)->lpVtbl -> ClearCurrentException(This) ) -#define ICorDebugThread_CreateStepper(This,ppStepper) \ +#define ICorDebugThread_CreateStepper(This,ppStepper) \ ( (This)->lpVtbl -> CreateStepper(This,ppStepper) ) -#define ICorDebugThread_EnumerateChains(This,ppChains) \ +#define ICorDebugThread_EnumerateChains(This,ppChains) \ ( (This)->lpVtbl -> EnumerateChains(This,ppChains) ) -#define ICorDebugThread_GetActiveChain(This,ppChain) \ +#define ICorDebugThread_GetActiveChain(This,ppChain) \ ( (This)->lpVtbl -> GetActiveChain(This,ppChain) ) -#define ICorDebugThread_GetActiveFrame(This,ppFrame) \ +#define ICorDebugThread_GetActiveFrame(This,ppFrame) \ ( (This)->lpVtbl -> GetActiveFrame(This,ppFrame) ) -#define ICorDebugThread_GetRegisterSet(This,ppRegisters) \ +#define ICorDebugThread_GetRegisterSet(This,ppRegisters) \ ( (This)->lpVtbl -> GetRegisterSet(This,ppRegisters) ) -#define ICorDebugThread_CreateEval(This,ppEval) \ +#define ICorDebugThread_CreateEval(This,ppEval) \ ( (This)->lpVtbl -> CreateEval(This,ppEval) ) -#define ICorDebugThread_GetObject(This,ppObject) \ +#define ICorDebugThread_GetObject(This,ppObject) \ ( (This)->lpVtbl -> GetObject(This,ppObject) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugThread_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugThread_INTERFACE_DEFINED__ */ #ifndef __ICorDebugThread2_INTERFACE_DEFINED__ @@ -9446,7 +9666,7 @@ typedef struct _COR_ACTIVE_FUNCTION ICorDebugFunction2 *pFunction; ULONG32 ilOffset; ULONG32 flags; - } COR_ACTIVE_FUNCTION; + } COR_ACTIVE_FUNCTION; EXTERN_C const IID IID_ICorDebugThread2; @@ -9477,7 +9697,7 @@ EXTERN_C const IID IID_ICorDebugThread2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugThread2Vtbl { @@ -9530,40 +9750,40 @@ EXTERN_C const IID IID_ICorDebugThread2; #ifdef COBJMACROS -#define ICorDebugThread2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugThread2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugThread2_AddRef(This) \ +#define ICorDebugThread2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugThread2_Release(This) \ +#define ICorDebugThread2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugThread2_GetActiveFunctions(This,cFunctions,pcFunctions,pFunctions) \ +#define ICorDebugThread2_GetActiveFunctions(This,cFunctions,pcFunctions,pFunctions) \ ( (This)->lpVtbl -> GetActiveFunctions(This,cFunctions,pcFunctions,pFunctions) ) -#define ICorDebugThread2_GetConnectionID(This,pdwConnectionId) \ +#define ICorDebugThread2_GetConnectionID(This,pdwConnectionId) \ ( (This)->lpVtbl -> GetConnectionID(This,pdwConnectionId) ) -#define ICorDebugThread2_GetTaskID(This,pTaskId) \ +#define ICorDebugThread2_GetTaskID(This,pTaskId) \ ( (This)->lpVtbl -> GetTaskID(This,pTaskId) ) -#define ICorDebugThread2_GetVolatileOSThreadID(This,pdwTid) \ +#define ICorDebugThread2_GetVolatileOSThreadID(This,pdwTid) \ ( (This)->lpVtbl -> GetVolatileOSThreadID(This,pdwTid) ) -#define ICorDebugThread2_InterceptCurrentException(This,pFrame) \ +#define ICorDebugThread2_InterceptCurrentException(This,pFrame) \ ( (This)->lpVtbl -> InterceptCurrentException(This,pFrame) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugThread2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugThread2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugThread3_INTERFACE_DEFINED__ @@ -9592,7 +9812,7 @@ EXTERN_C const IID IID_ICorDebugThread3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugThread3Vtbl { @@ -9633,31 +9853,31 @@ EXTERN_C const IID IID_ICorDebugThread3; #ifdef COBJMACROS -#define ICorDebugThread3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugThread3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugThread3_AddRef(This) \ +#define ICorDebugThread3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugThread3_Release(This) \ +#define ICorDebugThread3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugThread3_CreateStackWalk(This,ppStackWalk) \ +#define ICorDebugThread3_CreateStackWalk(This,ppStackWalk) \ ( (This)->lpVtbl -> CreateStackWalk(This,ppStackWalk) ) -#define ICorDebugThread3_GetActiveInternalFrames(This,cInternalFrames,pcInternalFrames,ppInternalFrames) \ +#define ICorDebugThread3_GetActiveInternalFrames(This,cInternalFrames,pcInternalFrames,ppInternalFrames) \ ( (This)->lpVtbl -> GetActiveInternalFrames(This,cInternalFrames,pcInternalFrames,ppInternalFrames) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugThread3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugThread3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugThread4_INTERFACE_DEFINED__ @@ -9686,7 +9906,7 @@ EXTERN_C const IID IID_ICorDebugThread4; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugThread4Vtbl { @@ -9728,34 +9948,34 @@ EXTERN_C const IID IID_ICorDebugThread4; #ifdef COBJMACROS -#define ICorDebugThread4_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugThread4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugThread4_AddRef(This) \ +#define ICorDebugThread4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugThread4_Release(This) \ +#define ICorDebugThread4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugThread4_HasUnhandledException(This) \ +#define ICorDebugThread4_HasUnhandledException(This) \ ( (This)->lpVtbl -> HasUnhandledException(This) ) -#define ICorDebugThread4_GetBlockingObjects(This,ppBlockingObjectEnum) \ +#define ICorDebugThread4_GetBlockingObjects(This,ppBlockingObjectEnum) \ ( (This)->lpVtbl -> GetBlockingObjects(This,ppBlockingObjectEnum) ) -#define ICorDebugThread4_GetCurrentCustomDebuggerNotification(This,ppNotificationObject) \ +#define ICorDebugThread4_GetCurrentCustomDebuggerNotification(This,ppNotificationObject) \ ( (This)->lpVtbl -> GetCurrentCustomDebuggerNotification(This,ppNotificationObject) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugThread4_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugThread4_INTERFACE_DEFINED__ */ #ifndef __ICorDebugStackWalk_INTERFACE_DEFINED__ @@ -9767,9 +9987,9 @@ EXTERN_C const IID IID_ICorDebugThread4; typedef enum CorDebugSetContextFlag { - SET_CONTEXT_FLAG_ACTIVE_FRAME = 0x1, - SET_CONTEXT_FLAG_UNWIND_FRAME = 0x2 - } CorDebugSetContextFlag; + SET_CONTEXT_FLAG_ACTIVE_FRAME = 0x1, + SET_CONTEXT_FLAG_UNWIND_FRAME = 0x2 + } CorDebugSetContextFlag; EXTERN_C const IID IID_ICorDebugStackWalk; @@ -9799,7 +10019,7 @@ EXTERN_C const IID IID_ICorDebugStackWalk; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugStackWalkVtbl { @@ -9850,37 +10070,37 @@ EXTERN_C const IID IID_ICorDebugStackWalk; #ifdef COBJMACROS -#define ICorDebugStackWalk_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugStackWalk_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugStackWalk_AddRef(This) \ +#define ICorDebugStackWalk_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugStackWalk_Release(This) \ +#define ICorDebugStackWalk_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugStackWalk_GetContext(This,contextFlags,contextBufSize,contextSize,contextBuf) \ +#define ICorDebugStackWalk_GetContext(This,contextFlags,contextBufSize,contextSize,contextBuf) \ ( (This)->lpVtbl -> GetContext(This,contextFlags,contextBufSize,contextSize,contextBuf) ) -#define ICorDebugStackWalk_SetContext(This,flag,contextSize,context) \ +#define ICorDebugStackWalk_SetContext(This,flag,contextSize,context) \ ( (This)->lpVtbl -> SetContext(This,flag,contextSize,context) ) -#define ICorDebugStackWalk_Next(This) \ +#define ICorDebugStackWalk_Next(This) \ ( (This)->lpVtbl -> Next(This) ) -#define ICorDebugStackWalk_GetFrame(This,pFrame) \ +#define ICorDebugStackWalk_GetFrame(This,pFrame) \ ( (This)->lpVtbl -> GetFrame(This,pFrame) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugStackWalk_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugStackWalk_INTERFACE_DEFINED__ */ #ifndef __ICorDebugChain_INTERFACE_DEFINED__ @@ -9892,20 +10112,20 @@ EXTERN_C const IID IID_ICorDebugStackWalk; typedef enum CorDebugChainReason { - CHAIN_NONE = 0, - CHAIN_CLASS_INIT = 0x1, - CHAIN_EXCEPTION_FILTER = 0x2, - CHAIN_SECURITY = 0x4, - CHAIN_CONTEXT_POLICY = 0x8, - CHAIN_INTERCEPTION = 0x10, - CHAIN_PROCESS_START = 0x20, - CHAIN_THREAD_START = 0x40, - CHAIN_ENTER_MANAGED = 0x80, - CHAIN_ENTER_UNMANAGED = 0x100, - CHAIN_DEBUGGER_EVAL = 0x200, - CHAIN_CONTEXT_SWITCH = 0x400, - CHAIN_FUNC_EVAL = 0x800 - } CorDebugChainReason; + CHAIN_NONE = 0, + CHAIN_CLASS_INIT = 0x1, + CHAIN_EXCEPTION_FILTER = 0x2, + CHAIN_SECURITY = 0x4, + CHAIN_CONTEXT_POLICY = 0x8, + CHAIN_INTERCEPTION = 0x10, + CHAIN_PROCESS_START = 0x20, + CHAIN_THREAD_START = 0x40, + CHAIN_ENTER_MANAGED = 0x80, + CHAIN_ENTER_UNMANAGED = 0x100, + CHAIN_DEBUGGER_EVAL = 0x200, + CHAIN_CONTEXT_SWITCH = 0x400, + CHAIN_FUNC_EVAL = 0x800 + } CorDebugChainReason; EXTERN_C const IID IID_ICorDebugChain; @@ -9956,7 +10176,7 @@ EXTERN_C const IID IID_ICorDebugChain; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugChainVtbl { @@ -10036,61 +10256,61 @@ EXTERN_C const IID IID_ICorDebugChain; #ifdef COBJMACROS -#define ICorDebugChain_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugChain_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugChain_AddRef(This) \ +#define ICorDebugChain_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugChain_Release(This) \ +#define ICorDebugChain_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugChain_GetThread(This,ppThread) \ +#define ICorDebugChain_GetThread(This,ppThread) \ ( (This)->lpVtbl -> GetThread(This,ppThread) ) -#define ICorDebugChain_GetStackRange(This,pStart,pEnd) \ +#define ICorDebugChain_GetStackRange(This,pStart,pEnd) \ ( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) ) -#define ICorDebugChain_GetContext(This,ppContext) \ +#define ICorDebugChain_GetContext(This,ppContext) \ ( (This)->lpVtbl -> GetContext(This,ppContext) ) -#define ICorDebugChain_GetCaller(This,ppChain) \ +#define ICorDebugChain_GetCaller(This,ppChain) \ ( (This)->lpVtbl -> GetCaller(This,ppChain) ) -#define ICorDebugChain_GetCallee(This,ppChain) \ +#define ICorDebugChain_GetCallee(This,ppChain) \ ( (This)->lpVtbl -> GetCallee(This,ppChain) ) -#define ICorDebugChain_GetPrevious(This,ppChain) \ +#define ICorDebugChain_GetPrevious(This,ppChain) \ ( (This)->lpVtbl -> GetPrevious(This,ppChain) ) -#define ICorDebugChain_GetNext(This,ppChain) \ +#define ICorDebugChain_GetNext(This,ppChain) \ ( (This)->lpVtbl -> GetNext(This,ppChain) ) -#define ICorDebugChain_IsManaged(This,pManaged) \ +#define ICorDebugChain_IsManaged(This,pManaged) \ ( (This)->lpVtbl -> IsManaged(This,pManaged) ) -#define ICorDebugChain_EnumerateFrames(This,ppFrames) \ +#define ICorDebugChain_EnumerateFrames(This,ppFrames) \ ( (This)->lpVtbl -> EnumerateFrames(This,ppFrames) ) -#define ICorDebugChain_GetActiveFrame(This,ppFrame) \ +#define ICorDebugChain_GetActiveFrame(This,ppFrame) \ ( (This)->lpVtbl -> GetActiveFrame(This,ppFrame) ) -#define ICorDebugChain_GetRegisterSet(This,ppRegisters) \ +#define ICorDebugChain_GetRegisterSet(This,ppRegisters) \ ( (This)->lpVtbl -> GetRegisterSet(This,ppRegisters) ) -#define ICorDebugChain_GetReason(This,pReason) \ +#define ICorDebugChain_GetReason(This,pReason) \ ( (This)->lpVtbl -> GetReason(This,pReason) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugChain_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugChain_INTERFACE_DEFINED__ */ #ifndef __ICorDebugFrame_INTERFACE_DEFINED__ @@ -10136,7 +10356,7 @@ EXTERN_C const IID IID_ICorDebugFrame; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugFrameVtbl { @@ -10200,49 +10420,49 @@ EXTERN_C const IID IID_ICorDebugFrame; #ifdef COBJMACROS -#define ICorDebugFrame_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugFrame_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugFrame_AddRef(This) \ +#define ICorDebugFrame_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugFrame_Release(This) \ +#define ICorDebugFrame_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugFrame_GetChain(This,ppChain) \ +#define ICorDebugFrame_GetChain(This,ppChain) \ ( (This)->lpVtbl -> GetChain(This,ppChain) ) -#define ICorDebugFrame_GetCode(This,ppCode) \ +#define ICorDebugFrame_GetCode(This,ppCode) \ ( (This)->lpVtbl -> GetCode(This,ppCode) ) -#define ICorDebugFrame_GetFunction(This,ppFunction) \ +#define ICorDebugFrame_GetFunction(This,ppFunction) \ ( (This)->lpVtbl -> GetFunction(This,ppFunction) ) -#define ICorDebugFrame_GetFunctionToken(This,pToken) \ +#define ICorDebugFrame_GetFunctionToken(This,pToken) \ ( (This)->lpVtbl -> GetFunctionToken(This,pToken) ) -#define ICorDebugFrame_GetStackRange(This,pStart,pEnd) \ +#define ICorDebugFrame_GetStackRange(This,pStart,pEnd) \ ( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) ) -#define ICorDebugFrame_GetCaller(This,ppFrame) \ +#define ICorDebugFrame_GetCaller(This,ppFrame) \ ( (This)->lpVtbl -> GetCaller(This,ppFrame) ) -#define ICorDebugFrame_GetCallee(This,ppFrame) \ +#define ICorDebugFrame_GetCallee(This,ppFrame) \ ( (This)->lpVtbl -> GetCallee(This,ppFrame) ) -#define ICorDebugFrame_CreateStepper(This,ppStepper) \ +#define ICorDebugFrame_CreateStepper(This,ppStepper) \ ( (This)->lpVtbl -> CreateStepper(This,ppStepper) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugFrame_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugFrame_INTERFACE_DEFINED__ */ #ifndef __ICorDebugInternalFrame_INTERFACE_DEFINED__ @@ -10254,18 +10474,18 @@ EXTERN_C const IID IID_ICorDebugFrame; typedef enum CorDebugInternalFrameType { - STUBFRAME_NONE = 0, - STUBFRAME_M2U = 0x1, - STUBFRAME_U2M = 0x2, - STUBFRAME_APPDOMAIN_TRANSITION = 0x3, - STUBFRAME_LIGHTWEIGHT_FUNCTION = 0x4, - STUBFRAME_FUNC_EVAL = 0x5, - STUBFRAME_INTERNALCALL = 0x6, - STUBFRAME_CLASS_INIT = 0x7, - STUBFRAME_EXCEPTION = 0x8, - STUBFRAME_SECURITY = 0x9, - STUBFRAME_JIT_COMPILATION = 0xa - } CorDebugInternalFrameType; + STUBFRAME_NONE = 0, + STUBFRAME_M2U = 0x1, + STUBFRAME_U2M = 0x2, + STUBFRAME_APPDOMAIN_TRANSITION = 0x3, + STUBFRAME_LIGHTWEIGHT_FUNCTION = 0x4, + STUBFRAME_FUNC_EVAL = 0x5, + STUBFRAME_INTERNALCALL = 0x6, + STUBFRAME_CLASS_INIT = 0x7, + STUBFRAME_EXCEPTION = 0x8, + STUBFRAME_SECURITY = 0x9, + STUBFRAME_JIT_COMPILATION = 0xa + } CorDebugInternalFrameType; EXTERN_C const IID IID_ICorDebugInternalFrame; @@ -10282,7 +10502,7 @@ EXTERN_C const IID IID_ICorDebugInternalFrame; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugInternalFrameVtbl { @@ -10350,53 +10570,53 @@ EXTERN_C const IID IID_ICorDebugInternalFrame; #ifdef COBJMACROS -#define ICorDebugInternalFrame_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugInternalFrame_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugInternalFrame_AddRef(This) \ +#define ICorDebugInternalFrame_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugInternalFrame_Release(This) \ +#define ICorDebugInternalFrame_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugInternalFrame_GetChain(This,ppChain) \ +#define ICorDebugInternalFrame_GetChain(This,ppChain) \ ( (This)->lpVtbl -> GetChain(This,ppChain) ) -#define ICorDebugInternalFrame_GetCode(This,ppCode) \ +#define ICorDebugInternalFrame_GetCode(This,ppCode) \ ( (This)->lpVtbl -> GetCode(This,ppCode) ) -#define ICorDebugInternalFrame_GetFunction(This,ppFunction) \ +#define ICorDebugInternalFrame_GetFunction(This,ppFunction) \ ( (This)->lpVtbl -> GetFunction(This,ppFunction) ) -#define ICorDebugInternalFrame_GetFunctionToken(This,pToken) \ +#define ICorDebugInternalFrame_GetFunctionToken(This,pToken) \ ( (This)->lpVtbl -> GetFunctionToken(This,pToken) ) -#define ICorDebugInternalFrame_GetStackRange(This,pStart,pEnd) \ +#define ICorDebugInternalFrame_GetStackRange(This,pStart,pEnd) \ ( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) ) -#define ICorDebugInternalFrame_GetCaller(This,ppFrame) \ +#define ICorDebugInternalFrame_GetCaller(This,ppFrame) \ ( (This)->lpVtbl -> GetCaller(This,ppFrame) ) -#define ICorDebugInternalFrame_GetCallee(This,ppFrame) \ +#define ICorDebugInternalFrame_GetCallee(This,ppFrame) \ ( (This)->lpVtbl -> GetCallee(This,ppFrame) ) -#define ICorDebugInternalFrame_CreateStepper(This,ppStepper) \ +#define ICorDebugInternalFrame_CreateStepper(This,ppStepper) \ ( (This)->lpVtbl -> CreateStepper(This,ppStepper) ) -#define ICorDebugInternalFrame_GetFrameType(This,pType) \ +#define ICorDebugInternalFrame_GetFrameType(This,pType) \ ( (This)->lpVtbl -> GetFrameType(This,pType) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugInternalFrame_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugInternalFrame_INTERFACE_DEFINED__ */ #ifndef __ICorDebugInternalFrame2_INTERFACE_DEFINED__ @@ -10424,7 +10644,7 @@ EXTERN_C const IID IID_ICorDebugInternalFrame2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugInternalFrame2Vtbl { @@ -10464,31 +10684,31 @@ EXTERN_C const IID IID_ICorDebugInternalFrame2; #ifdef COBJMACROS -#define ICorDebugInternalFrame2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugInternalFrame2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugInternalFrame2_AddRef(This) \ +#define ICorDebugInternalFrame2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugInternalFrame2_Release(This) \ +#define ICorDebugInternalFrame2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugInternalFrame2_GetAddress(This,pAddress) \ +#define ICorDebugInternalFrame2_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugInternalFrame2_IsCloserToLeaf(This,pFrameToCompare,pIsCloser) \ +#define ICorDebugInternalFrame2_IsCloserToLeaf(This,pFrameToCompare,pIsCloser) \ ( (This)->lpVtbl -> IsCloserToLeaf(This,pFrameToCompare,pIsCloser) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugInternalFrame2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugInternalFrame2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugILFrame_INTERFACE_DEFINED__ @@ -10500,13 +10720,13 @@ EXTERN_C const IID IID_ICorDebugInternalFrame2; typedef enum CorDebugMappingResult { - MAPPING_PROLOG = 0x1, - MAPPING_EPILOG = 0x2, - MAPPING_NO_INFO = 0x4, - MAPPING_UNMAPPED_ADDRESS = 0x8, - MAPPING_EXACT = 0x10, - MAPPING_APPROXIMATE = 0x20 - } CorDebugMappingResult; + MAPPING_PROLOG = 0x1, + MAPPING_EPILOG = 0x2, + MAPPING_NO_INFO = 0x4, + MAPPING_UNMAPPED_ADDRESS = 0x8, + MAPPING_EXACT = 0x10, + MAPPING_APPROXIMATE = 0x20 + } CorDebugMappingResult; EXTERN_C const IID IID_ICorDebugILFrame; @@ -10551,7 +10771,7 @@ EXTERN_C const IID IID_ICorDebugILFrame; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugILFrameVtbl { @@ -10655,77 +10875,77 @@ EXTERN_C const IID IID_ICorDebugILFrame; #ifdef COBJMACROS -#define ICorDebugILFrame_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugILFrame_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugILFrame_AddRef(This) \ +#define ICorDebugILFrame_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugILFrame_Release(This) \ +#define ICorDebugILFrame_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugILFrame_GetChain(This,ppChain) \ +#define ICorDebugILFrame_GetChain(This,ppChain) \ ( (This)->lpVtbl -> GetChain(This,ppChain) ) -#define ICorDebugILFrame_GetCode(This,ppCode) \ +#define ICorDebugILFrame_GetCode(This,ppCode) \ ( (This)->lpVtbl -> GetCode(This,ppCode) ) -#define ICorDebugILFrame_GetFunction(This,ppFunction) \ +#define ICorDebugILFrame_GetFunction(This,ppFunction) \ ( (This)->lpVtbl -> GetFunction(This,ppFunction) ) -#define ICorDebugILFrame_GetFunctionToken(This,pToken) \ +#define ICorDebugILFrame_GetFunctionToken(This,pToken) \ ( (This)->lpVtbl -> GetFunctionToken(This,pToken) ) -#define ICorDebugILFrame_GetStackRange(This,pStart,pEnd) \ +#define ICorDebugILFrame_GetStackRange(This,pStart,pEnd) \ ( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) ) -#define ICorDebugILFrame_GetCaller(This,ppFrame) \ +#define ICorDebugILFrame_GetCaller(This,ppFrame) \ ( (This)->lpVtbl -> GetCaller(This,ppFrame) ) -#define ICorDebugILFrame_GetCallee(This,ppFrame) \ +#define ICorDebugILFrame_GetCallee(This,ppFrame) \ ( (This)->lpVtbl -> GetCallee(This,ppFrame) ) -#define ICorDebugILFrame_CreateStepper(This,ppStepper) \ +#define ICorDebugILFrame_CreateStepper(This,ppStepper) \ ( (This)->lpVtbl -> CreateStepper(This,ppStepper) ) -#define ICorDebugILFrame_GetIP(This,pnOffset,pMappingResult) \ +#define ICorDebugILFrame_GetIP(This,pnOffset,pMappingResult) \ ( (This)->lpVtbl -> GetIP(This,pnOffset,pMappingResult) ) -#define ICorDebugILFrame_SetIP(This,nOffset) \ +#define ICorDebugILFrame_SetIP(This,nOffset) \ ( (This)->lpVtbl -> SetIP(This,nOffset) ) -#define ICorDebugILFrame_EnumerateLocalVariables(This,ppValueEnum) \ +#define ICorDebugILFrame_EnumerateLocalVariables(This,ppValueEnum) \ ( (This)->lpVtbl -> EnumerateLocalVariables(This,ppValueEnum) ) -#define ICorDebugILFrame_GetLocalVariable(This,dwIndex,ppValue) \ +#define ICorDebugILFrame_GetLocalVariable(This,dwIndex,ppValue) \ ( (This)->lpVtbl -> GetLocalVariable(This,dwIndex,ppValue) ) -#define ICorDebugILFrame_EnumerateArguments(This,ppValueEnum) \ +#define ICorDebugILFrame_EnumerateArguments(This,ppValueEnum) \ ( (This)->lpVtbl -> EnumerateArguments(This,ppValueEnum) ) -#define ICorDebugILFrame_GetArgument(This,dwIndex,ppValue) \ +#define ICorDebugILFrame_GetArgument(This,dwIndex,ppValue) \ ( (This)->lpVtbl -> GetArgument(This,dwIndex,ppValue) ) -#define ICorDebugILFrame_GetStackDepth(This,pDepth) \ +#define ICorDebugILFrame_GetStackDepth(This,pDepth) \ ( (This)->lpVtbl -> GetStackDepth(This,pDepth) ) -#define ICorDebugILFrame_GetStackValue(This,dwIndex,ppValue) \ +#define ICorDebugILFrame_GetStackValue(This,dwIndex,ppValue) \ ( (This)->lpVtbl -> GetStackValue(This,dwIndex,ppValue) ) -#define ICorDebugILFrame_CanSetIP(This,nOffset) \ +#define ICorDebugILFrame_CanSetIP(This,nOffset) \ ( (This)->lpVtbl -> CanSetIP(This,nOffset) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugILFrame_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugILFrame_INTERFACE_DEFINED__ */ #ifndef __ICorDebugILFrame2_INTERFACE_DEFINED__ @@ -10752,7 +10972,7 @@ EXTERN_C const IID IID_ICorDebugILFrame2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugILFrame2Vtbl { @@ -10791,31 +11011,31 @@ EXTERN_C const IID IID_ICorDebugILFrame2; #ifdef COBJMACROS -#define ICorDebugILFrame2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugILFrame2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugILFrame2_AddRef(This) \ +#define ICorDebugILFrame2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugILFrame2_Release(This) \ +#define ICorDebugILFrame2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugILFrame2_RemapFunction(This,newILOffset) \ +#define ICorDebugILFrame2_RemapFunction(This,newILOffset) \ ( (This)->lpVtbl -> RemapFunction(This,newILOffset) ) -#define ICorDebugILFrame2_EnumerateTypeParameters(This,ppTyParEnum) \ +#define ICorDebugILFrame2_EnumerateTypeParameters(This,ppTyParEnum) \ ( (This)->lpVtbl -> EnumerateTypeParameters(This,ppTyParEnum) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugILFrame2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugILFrame2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugILFrame3_INTERFACE_DEFINED__ @@ -10840,7 +11060,7 @@ EXTERN_C const IID IID_ICorDebugILFrame3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugILFrame3Vtbl { @@ -10876,44 +11096,44 @@ EXTERN_C const IID IID_ICorDebugILFrame3; #ifdef COBJMACROS -#define ICorDebugILFrame3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugILFrame3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugILFrame3_AddRef(This) \ +#define ICorDebugILFrame3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugILFrame3_Release(This) \ +#define ICorDebugILFrame3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugILFrame3_GetReturnValueForILOffset(This,ILoffset,ppReturnValue) \ +#define ICorDebugILFrame3_GetReturnValueForILOffset(This,ILoffset,ppReturnValue) \ ( (This)->lpVtbl -> GetReturnValueForILOffset(This,ILoffset,ppReturnValue) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugILFrame3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugILFrame3_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0067 */ +/* interface __MIDL_itf_cordebug_0000_0069 */ /* [local] */ typedef enum ILCodeKind { - ILCODE_ORIGINAL_IL = 0x1, - ILCODE_REJIT_IL = 0x2 - } ILCodeKind; + ILCODE_ORIGINAL_IL = 0x1, + ILCODE_REJIT_IL = 0x2 + } ILCodeKind; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0067_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0067_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0069_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0069_v0_0_s_ifspec; #ifndef __ICorDebugILFrame4_INTERFACE_DEFINED__ #define __ICorDebugILFrame4_INTERFACE_DEFINED__ @@ -10946,7 +11166,7 @@ EXTERN_C const IID IID_ICorDebugILFrame4; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugILFrame4Vtbl { @@ -10993,34 +11213,34 @@ EXTERN_C const IID IID_ICorDebugILFrame4; #ifdef COBJMACROS -#define ICorDebugILFrame4_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugILFrame4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugILFrame4_AddRef(This) \ +#define ICorDebugILFrame4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugILFrame4_Release(This) \ +#define ICorDebugILFrame4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugILFrame4_EnumerateLocalVariablesEx(This,flags,ppValueEnum) \ +#define ICorDebugILFrame4_EnumerateLocalVariablesEx(This,flags,ppValueEnum) \ ( (This)->lpVtbl -> EnumerateLocalVariablesEx(This,flags,ppValueEnum) ) -#define ICorDebugILFrame4_GetLocalVariableEx(This,flags,dwIndex,ppValue) \ +#define ICorDebugILFrame4_GetLocalVariableEx(This,flags,dwIndex,ppValue) \ ( (This)->lpVtbl -> GetLocalVariableEx(This,flags,dwIndex,ppValue) ) -#define ICorDebugILFrame4_GetCodeEx(This,flags,ppCode) \ +#define ICorDebugILFrame4_GetCodeEx(This,flags,ppCode) \ ( (This)->lpVtbl -> GetCodeEx(This,flags,ppCode) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugILFrame4_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugILFrame4_INTERFACE_DEFINED__ */ #ifndef __ICorDebugNativeFrame_INTERFACE_DEFINED__ @@ -11086,7 +11306,7 @@ EXTERN_C const IID IID_ICorDebugNativeFrame; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugNativeFrameVtbl { @@ -11204,88 +11424,88 @@ EXTERN_C const IID IID_ICorDebugNativeFrame; #ifdef COBJMACROS -#define ICorDebugNativeFrame_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugNativeFrame_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugNativeFrame_AddRef(This) \ +#define ICorDebugNativeFrame_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugNativeFrame_Release(This) \ +#define ICorDebugNativeFrame_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugNativeFrame_GetChain(This,ppChain) \ +#define ICorDebugNativeFrame_GetChain(This,ppChain) \ ( (This)->lpVtbl -> GetChain(This,ppChain) ) -#define ICorDebugNativeFrame_GetCode(This,ppCode) \ +#define ICorDebugNativeFrame_GetCode(This,ppCode) \ ( (This)->lpVtbl -> GetCode(This,ppCode) ) -#define ICorDebugNativeFrame_GetFunction(This,ppFunction) \ +#define ICorDebugNativeFrame_GetFunction(This,ppFunction) \ ( (This)->lpVtbl -> GetFunction(This,ppFunction) ) -#define ICorDebugNativeFrame_GetFunctionToken(This,pToken) \ +#define ICorDebugNativeFrame_GetFunctionToken(This,pToken) \ ( (This)->lpVtbl -> GetFunctionToken(This,pToken) ) -#define ICorDebugNativeFrame_GetStackRange(This,pStart,pEnd) \ +#define ICorDebugNativeFrame_GetStackRange(This,pStart,pEnd) \ ( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) ) -#define ICorDebugNativeFrame_GetCaller(This,ppFrame) \ +#define ICorDebugNativeFrame_GetCaller(This,ppFrame) \ ( (This)->lpVtbl -> GetCaller(This,ppFrame) ) -#define ICorDebugNativeFrame_GetCallee(This,ppFrame) \ +#define ICorDebugNativeFrame_GetCallee(This,ppFrame) \ ( (This)->lpVtbl -> GetCallee(This,ppFrame) ) -#define ICorDebugNativeFrame_CreateStepper(This,ppStepper) \ +#define ICorDebugNativeFrame_CreateStepper(This,ppStepper) \ ( (This)->lpVtbl -> CreateStepper(This,ppStepper) ) -#define ICorDebugNativeFrame_GetIP(This,pnOffset) \ +#define ICorDebugNativeFrame_GetIP(This,pnOffset) \ ( (This)->lpVtbl -> GetIP(This,pnOffset) ) -#define ICorDebugNativeFrame_SetIP(This,nOffset) \ +#define ICorDebugNativeFrame_SetIP(This,nOffset) \ ( (This)->lpVtbl -> SetIP(This,nOffset) ) -#define ICorDebugNativeFrame_GetRegisterSet(This,ppRegisters) \ +#define ICorDebugNativeFrame_GetRegisterSet(This,ppRegisters) \ ( (This)->lpVtbl -> GetRegisterSet(This,ppRegisters) ) -#define ICorDebugNativeFrame_GetLocalRegisterValue(This,reg,cbSigBlob,pvSigBlob,ppValue) \ +#define ICorDebugNativeFrame_GetLocalRegisterValue(This,reg,cbSigBlob,pvSigBlob,ppValue) \ ( (This)->lpVtbl -> GetLocalRegisterValue(This,reg,cbSigBlob,pvSigBlob,ppValue) ) -#define ICorDebugNativeFrame_GetLocalDoubleRegisterValue(This,highWordReg,lowWordReg,cbSigBlob,pvSigBlob,ppValue) \ +#define ICorDebugNativeFrame_GetLocalDoubleRegisterValue(This,highWordReg,lowWordReg,cbSigBlob,pvSigBlob,ppValue) \ ( (This)->lpVtbl -> GetLocalDoubleRegisterValue(This,highWordReg,lowWordReg,cbSigBlob,pvSigBlob,ppValue) ) -#define ICorDebugNativeFrame_GetLocalMemoryValue(This,address,cbSigBlob,pvSigBlob,ppValue) \ +#define ICorDebugNativeFrame_GetLocalMemoryValue(This,address,cbSigBlob,pvSigBlob,ppValue) \ ( (This)->lpVtbl -> GetLocalMemoryValue(This,address,cbSigBlob,pvSigBlob,ppValue) ) -#define ICorDebugNativeFrame_GetLocalRegisterMemoryValue(This,highWordReg,lowWordAddress,cbSigBlob,pvSigBlob,ppValue) \ +#define ICorDebugNativeFrame_GetLocalRegisterMemoryValue(This,highWordReg,lowWordAddress,cbSigBlob,pvSigBlob,ppValue) \ ( (This)->lpVtbl -> GetLocalRegisterMemoryValue(This,highWordReg,lowWordAddress,cbSigBlob,pvSigBlob,ppValue) ) -#define ICorDebugNativeFrame_GetLocalMemoryRegisterValue(This,highWordAddress,lowWordRegister,cbSigBlob,pvSigBlob,ppValue) \ +#define ICorDebugNativeFrame_GetLocalMemoryRegisterValue(This,highWordAddress,lowWordRegister,cbSigBlob,pvSigBlob,ppValue) \ ( (This)->lpVtbl -> GetLocalMemoryRegisterValue(This,highWordAddress,lowWordRegister,cbSigBlob,pvSigBlob,ppValue) ) -#define ICorDebugNativeFrame_CanSetIP(This,nOffset) \ +#define ICorDebugNativeFrame_CanSetIP(This,nOffset) \ ( (This)->lpVtbl -> CanSetIP(This,nOffset) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugNativeFrame_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugNativeFrame_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0069 */ +/* interface __MIDL_itf_cordebug_0000_0071 */ /* [local] */ #pragma warning(push) #pragma warning(disable:28718) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0069_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0069_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0071_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0071_v0_0_s_ifspec; #ifndef __ICorDebugNativeFrame2_INTERFACE_DEFINED__ #define __ICorDebugNativeFrame2_INTERFACE_DEFINED__ @@ -11315,7 +11535,7 @@ EXTERN_C const IID IID_ICorDebugNativeFrame2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugNativeFrame2Vtbl { @@ -11359,34 +11579,34 @@ EXTERN_C const IID IID_ICorDebugNativeFrame2; #ifdef COBJMACROS -#define ICorDebugNativeFrame2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugNativeFrame2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugNativeFrame2_AddRef(This) \ +#define ICorDebugNativeFrame2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugNativeFrame2_Release(This) \ +#define ICorDebugNativeFrame2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugNativeFrame2_IsChild(This,pIsChild) \ +#define ICorDebugNativeFrame2_IsChild(This,pIsChild) \ ( (This)->lpVtbl -> IsChild(This,pIsChild) ) -#define ICorDebugNativeFrame2_IsMatchingParentFrame(This,pPotentialParentFrame,pIsParent) \ +#define ICorDebugNativeFrame2_IsMatchingParentFrame(This,pPotentialParentFrame,pIsParent) \ ( (This)->lpVtbl -> IsMatchingParentFrame(This,pPotentialParentFrame,pIsParent) ) -#define ICorDebugNativeFrame2_GetStackParameterSize(This,pSize) \ +#define ICorDebugNativeFrame2_GetStackParameterSize(This,pSize) \ ( (This)->lpVtbl -> GetStackParameterSize(This,pSize) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugNativeFrame2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugNativeFrame2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugModule3_INTERFACE_DEFINED__ @@ -11411,7 +11631,7 @@ EXTERN_C const IID IID_ICorDebugModule3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugModule3Vtbl { @@ -11447,28 +11667,28 @@ EXTERN_C const IID IID_ICorDebugModule3; #ifdef COBJMACROS -#define ICorDebugModule3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugModule3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugModule3_AddRef(This) \ +#define ICorDebugModule3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugModule3_Release(This) \ +#define ICorDebugModule3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugModule3_CreateReaderForInMemorySymbols(This,riid,ppObj) \ +#define ICorDebugModule3_CreateReaderForInMemorySymbols(This,riid,ppObj) \ ( (This)->lpVtbl -> CreateReaderForInMemorySymbols(This,riid,ppObj) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugModule3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugModule3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugRuntimeUnwindableFrame_INTERFACE_DEFINED__ @@ -11489,7 +11709,7 @@ EXTERN_C const IID IID_ICorDebugRuntimeUnwindableFrame; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugRuntimeUnwindableFrameVtbl { @@ -11553,50 +11773,50 @@ EXTERN_C const IID IID_ICorDebugRuntimeUnwindableFrame; #ifdef COBJMACROS -#define ICorDebugRuntimeUnwindableFrame_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugRuntimeUnwindableFrame_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugRuntimeUnwindableFrame_AddRef(This) \ +#define ICorDebugRuntimeUnwindableFrame_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugRuntimeUnwindableFrame_Release(This) \ +#define ICorDebugRuntimeUnwindableFrame_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugRuntimeUnwindableFrame_GetChain(This,ppChain) \ +#define ICorDebugRuntimeUnwindableFrame_GetChain(This,ppChain) \ ( (This)->lpVtbl -> GetChain(This,ppChain) ) -#define ICorDebugRuntimeUnwindableFrame_GetCode(This,ppCode) \ +#define ICorDebugRuntimeUnwindableFrame_GetCode(This,ppCode) \ ( (This)->lpVtbl -> GetCode(This,ppCode) ) -#define ICorDebugRuntimeUnwindableFrame_GetFunction(This,ppFunction) \ +#define ICorDebugRuntimeUnwindableFrame_GetFunction(This,ppFunction) \ ( (This)->lpVtbl -> GetFunction(This,ppFunction) ) -#define ICorDebugRuntimeUnwindableFrame_GetFunctionToken(This,pToken) \ +#define ICorDebugRuntimeUnwindableFrame_GetFunctionToken(This,pToken) \ ( (This)->lpVtbl -> GetFunctionToken(This,pToken) ) -#define ICorDebugRuntimeUnwindableFrame_GetStackRange(This,pStart,pEnd) \ +#define ICorDebugRuntimeUnwindableFrame_GetStackRange(This,pStart,pEnd) \ ( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) ) -#define ICorDebugRuntimeUnwindableFrame_GetCaller(This,ppFrame) \ +#define ICorDebugRuntimeUnwindableFrame_GetCaller(This,ppFrame) \ ( (This)->lpVtbl -> GetCaller(This,ppFrame) ) -#define ICorDebugRuntimeUnwindableFrame_GetCallee(This,ppFrame) \ +#define ICorDebugRuntimeUnwindableFrame_GetCallee(This,ppFrame) \ ( (This)->lpVtbl -> GetCallee(This,ppFrame) ) -#define ICorDebugRuntimeUnwindableFrame_CreateStepper(This,ppStepper) \ +#define ICorDebugRuntimeUnwindableFrame_CreateStepper(This,ppStepper) \ ( (This)->lpVtbl -> CreateStepper(This,ppStepper) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugRuntimeUnwindableFrame_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugRuntimeUnwindableFrame_INTERFACE_DEFINED__ */ #ifndef __ICorDebugModule_INTERFACE_DEFINED__ @@ -11676,7 +11896,7 @@ EXTERN_C const IID IID_ICorDebugModule; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugModuleVtbl { @@ -11783,86 +12003,86 @@ EXTERN_C const IID IID_ICorDebugModule; #ifdef COBJMACROS -#define ICorDebugModule_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugModule_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugModule_AddRef(This) \ +#define ICorDebugModule_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugModule_Release(This) \ +#define ICorDebugModule_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugModule_GetProcess(This,ppProcess) \ +#define ICorDebugModule_GetProcess(This,ppProcess) \ ( (This)->lpVtbl -> GetProcess(This,ppProcess) ) -#define ICorDebugModule_GetBaseAddress(This,pAddress) \ +#define ICorDebugModule_GetBaseAddress(This,pAddress) \ ( (This)->lpVtbl -> GetBaseAddress(This,pAddress) ) -#define ICorDebugModule_GetAssembly(This,ppAssembly) \ +#define ICorDebugModule_GetAssembly(This,ppAssembly) \ ( (This)->lpVtbl -> GetAssembly(This,ppAssembly) ) -#define ICorDebugModule_GetName(This,cchName,pcchName,szName) \ +#define ICorDebugModule_GetName(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) -#define ICorDebugModule_EnableJITDebugging(This,bTrackJITInfo,bAllowJitOpts) \ +#define ICorDebugModule_EnableJITDebugging(This,bTrackJITInfo,bAllowJitOpts) \ ( (This)->lpVtbl -> EnableJITDebugging(This,bTrackJITInfo,bAllowJitOpts) ) -#define ICorDebugModule_EnableClassLoadCallbacks(This,bClassLoadCallbacks) \ +#define ICorDebugModule_EnableClassLoadCallbacks(This,bClassLoadCallbacks) \ ( (This)->lpVtbl -> EnableClassLoadCallbacks(This,bClassLoadCallbacks) ) -#define ICorDebugModule_GetFunctionFromToken(This,methodDef,ppFunction) \ +#define ICorDebugModule_GetFunctionFromToken(This,methodDef,ppFunction) \ ( (This)->lpVtbl -> GetFunctionFromToken(This,methodDef,ppFunction) ) -#define ICorDebugModule_GetFunctionFromRVA(This,rva,ppFunction) \ +#define ICorDebugModule_GetFunctionFromRVA(This,rva,ppFunction) \ ( (This)->lpVtbl -> GetFunctionFromRVA(This,rva,ppFunction) ) -#define ICorDebugModule_GetClassFromToken(This,typeDef,ppClass) \ +#define ICorDebugModule_GetClassFromToken(This,typeDef,ppClass) \ ( (This)->lpVtbl -> GetClassFromToken(This,typeDef,ppClass) ) -#define ICorDebugModule_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugModule_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugModule_GetEditAndContinueSnapshot(This,ppEditAndContinueSnapshot) \ +#define ICorDebugModule_GetEditAndContinueSnapshot(This,ppEditAndContinueSnapshot) \ ( (This)->lpVtbl -> GetEditAndContinueSnapshot(This,ppEditAndContinueSnapshot) ) -#define ICorDebugModule_GetMetaDataInterface(This,riid,ppObj) \ +#define ICorDebugModule_GetMetaDataInterface(This,riid,ppObj) \ ( (This)->lpVtbl -> GetMetaDataInterface(This,riid,ppObj) ) -#define ICorDebugModule_GetToken(This,pToken) \ +#define ICorDebugModule_GetToken(This,pToken) \ ( (This)->lpVtbl -> GetToken(This,pToken) ) -#define ICorDebugModule_IsDynamic(This,pDynamic) \ +#define ICorDebugModule_IsDynamic(This,pDynamic) \ ( (This)->lpVtbl -> IsDynamic(This,pDynamic) ) -#define ICorDebugModule_GetGlobalVariableValue(This,fieldDef,ppValue) \ +#define ICorDebugModule_GetGlobalVariableValue(This,fieldDef,ppValue) \ ( (This)->lpVtbl -> GetGlobalVariableValue(This,fieldDef,ppValue) ) -#define ICorDebugModule_GetSize(This,pcBytes) \ +#define ICorDebugModule_GetSize(This,pcBytes) \ ( (This)->lpVtbl -> GetSize(This,pcBytes) ) -#define ICorDebugModule_IsInMemory(This,pInMemory) \ +#define ICorDebugModule_IsInMemory(This,pInMemory) \ ( (This)->lpVtbl -> IsInMemory(This,pInMemory) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugModule_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugModule_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0073 */ +/* interface __MIDL_itf_cordebug_0000_0075 */ /* [local] */ #pragma warning(pop) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0073_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0073_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0075_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0075_v0_0_s_ifspec; #ifndef __ICorDebugModule2_INTERFACE_DEFINED__ #define __ICorDebugModule2_INTERFACE_DEFINED__ @@ -11903,7 +12123,7 @@ EXTERN_C const IID IID_ICorDebugModule2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugModule2Vtbl { @@ -11960,40 +12180,40 @@ EXTERN_C const IID IID_ICorDebugModule2; #ifdef COBJMACROS -#define ICorDebugModule2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugModule2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugModule2_AddRef(This) \ +#define ICorDebugModule2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugModule2_Release(This) \ +#define ICorDebugModule2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugModule2_SetJMCStatus(This,bIsJustMyCode,cTokens,pTokens) \ +#define ICorDebugModule2_SetJMCStatus(This,bIsJustMyCode,cTokens,pTokens) \ ( (This)->lpVtbl -> SetJMCStatus(This,bIsJustMyCode,cTokens,pTokens) ) -#define ICorDebugModule2_ApplyChanges(This,cbMetadata,pbMetadata,cbIL,pbIL) \ +#define ICorDebugModule2_ApplyChanges(This,cbMetadata,pbMetadata,cbIL,pbIL) \ ( (This)->lpVtbl -> ApplyChanges(This,cbMetadata,pbMetadata,cbIL,pbIL) ) -#define ICorDebugModule2_SetJITCompilerFlags(This,dwFlags) \ +#define ICorDebugModule2_SetJITCompilerFlags(This,dwFlags) \ ( (This)->lpVtbl -> SetJITCompilerFlags(This,dwFlags) ) -#define ICorDebugModule2_GetJITCompilerFlags(This,pdwFlags) \ +#define ICorDebugModule2_GetJITCompilerFlags(This,pdwFlags) \ ( (This)->lpVtbl -> GetJITCompilerFlags(This,pdwFlags) ) -#define ICorDebugModule2_ResolveAssembly(This,tkAssemblyRef,ppAssembly) \ +#define ICorDebugModule2_ResolveAssembly(This,tkAssemblyRef,ppAssembly) \ ( (This)->lpVtbl -> ResolveAssembly(This,tkAssemblyRef,ppAssembly) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugModule2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugModule2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugFunction_INTERFACE_DEFINED__ @@ -12038,7 +12258,7 @@ EXTERN_C const IID IID_ICorDebugFunction; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugFunctionVtbl { @@ -12101,49 +12321,49 @@ EXTERN_C const IID IID_ICorDebugFunction; #ifdef COBJMACROS -#define ICorDebugFunction_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugFunction_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugFunction_AddRef(This) \ +#define ICorDebugFunction_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugFunction_Release(This) \ +#define ICorDebugFunction_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugFunction_GetModule(This,ppModule) \ +#define ICorDebugFunction_GetModule(This,ppModule) \ ( (This)->lpVtbl -> GetModule(This,ppModule) ) -#define ICorDebugFunction_GetClass(This,ppClass) \ +#define ICorDebugFunction_GetClass(This,ppClass) \ ( (This)->lpVtbl -> GetClass(This,ppClass) ) -#define ICorDebugFunction_GetToken(This,pMethodDef) \ +#define ICorDebugFunction_GetToken(This,pMethodDef) \ ( (This)->lpVtbl -> GetToken(This,pMethodDef) ) -#define ICorDebugFunction_GetILCode(This,ppCode) \ +#define ICorDebugFunction_GetILCode(This,ppCode) \ ( (This)->lpVtbl -> GetILCode(This,ppCode) ) -#define ICorDebugFunction_GetNativeCode(This,ppCode) \ +#define ICorDebugFunction_GetNativeCode(This,ppCode) \ ( (This)->lpVtbl -> GetNativeCode(This,ppCode) ) -#define ICorDebugFunction_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugFunction_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugFunction_GetLocalVarSigToken(This,pmdSig) \ +#define ICorDebugFunction_GetLocalVarSigToken(This,pmdSig) \ ( (This)->lpVtbl -> GetLocalVarSigToken(This,pmdSig) ) -#define ICorDebugFunction_GetCurrentVersionNumber(This,pnCurrentVersion) \ +#define ICorDebugFunction_GetCurrentVersionNumber(This,pnCurrentVersion) \ ( (This)->lpVtbl -> GetCurrentVersionNumber(This,pnCurrentVersion) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugFunction_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugFunction_INTERFACE_DEFINED__ */ #ifndef __ICorDebugFunction2_INTERFACE_DEFINED__ @@ -12176,7 +12396,7 @@ EXTERN_C const IID IID_ICorDebugFunction2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugFunction2Vtbl { @@ -12223,37 +12443,37 @@ EXTERN_C const IID IID_ICorDebugFunction2; #ifdef COBJMACROS -#define ICorDebugFunction2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugFunction2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugFunction2_AddRef(This) \ +#define ICorDebugFunction2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugFunction2_Release(This) \ +#define ICorDebugFunction2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugFunction2_SetJMCStatus(This,bIsJustMyCode) \ +#define ICorDebugFunction2_SetJMCStatus(This,bIsJustMyCode) \ ( (This)->lpVtbl -> SetJMCStatus(This,bIsJustMyCode) ) -#define ICorDebugFunction2_GetJMCStatus(This,pbIsJustMyCode) \ +#define ICorDebugFunction2_GetJMCStatus(This,pbIsJustMyCode) \ ( (This)->lpVtbl -> GetJMCStatus(This,pbIsJustMyCode) ) -#define ICorDebugFunction2_EnumerateNativeCode(This,ppCodeEnum) \ +#define ICorDebugFunction2_EnumerateNativeCode(This,ppCodeEnum) \ ( (This)->lpVtbl -> EnumerateNativeCode(This,ppCodeEnum) ) -#define ICorDebugFunction2_GetVersionNumber(This,pnVersion) \ +#define ICorDebugFunction2_GetVersionNumber(This,pnVersion) \ ( (This)->lpVtbl -> GetVersionNumber(This,pnVersion) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugFunction2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugFunction2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugFunction3_INTERFACE_DEFINED__ @@ -12277,7 +12497,7 @@ EXTERN_C const IID IID_ICorDebugFunction3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugFunction3Vtbl { @@ -12312,28 +12532,28 @@ EXTERN_C const IID IID_ICorDebugFunction3; #ifdef COBJMACROS -#define ICorDebugFunction3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugFunction3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugFunction3_AddRef(This) \ +#define ICorDebugFunction3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugFunction3_Release(This) \ +#define ICorDebugFunction3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugFunction3_GetActiveReJitRequestILCode(This,ppReJitedILCode) \ +#define ICorDebugFunction3_GetActiveReJitRequestILCode(This,ppReJitedILCode) \ ( (This)->lpVtbl -> GetActiveReJitRequestILCode(This,ppReJitedILCode) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugFunction3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugFunction3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugFunction4_INTERFACE_DEFINED__ @@ -12357,7 +12577,7 @@ EXTERN_C const IID IID_ICorDebugFunction4; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugFunction4Vtbl { @@ -12392,28 +12612,28 @@ EXTERN_C const IID IID_ICorDebugFunction4; #ifdef COBJMACROS -#define ICorDebugFunction4_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugFunction4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugFunction4_AddRef(This) \ +#define ICorDebugFunction4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugFunction4_Release(This) \ +#define ICorDebugFunction4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugFunction4_CreateNativeBreakpoint(This,ppBreakpoint) \ +#define ICorDebugFunction4_CreateNativeBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateNativeBreakpoint(This,ppBreakpoint) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugFunction4_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugFunction4_INTERFACE_DEFINED__ */ #ifndef __ICorDebugCode_INTERFACE_DEFINED__ @@ -12470,7 +12690,7 @@ EXTERN_C const IID IID_ICorDebugCode; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugCodeVtbl { @@ -12546,52 +12766,52 @@ EXTERN_C const IID IID_ICorDebugCode; #ifdef COBJMACROS -#define ICorDebugCode_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugCode_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugCode_AddRef(This) \ +#define ICorDebugCode_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugCode_Release(This) \ +#define ICorDebugCode_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugCode_IsIL(This,pbIL) \ +#define ICorDebugCode_IsIL(This,pbIL) \ ( (This)->lpVtbl -> IsIL(This,pbIL) ) -#define ICorDebugCode_GetFunction(This,ppFunction) \ +#define ICorDebugCode_GetFunction(This,ppFunction) \ ( (This)->lpVtbl -> GetFunction(This,ppFunction) ) -#define ICorDebugCode_GetAddress(This,pStart) \ +#define ICorDebugCode_GetAddress(This,pStart) \ ( (This)->lpVtbl -> GetAddress(This,pStart) ) -#define ICorDebugCode_GetSize(This,pcBytes) \ +#define ICorDebugCode_GetSize(This,pcBytes) \ ( (This)->lpVtbl -> GetSize(This,pcBytes) ) -#define ICorDebugCode_CreateBreakpoint(This,offset,ppBreakpoint) \ +#define ICorDebugCode_CreateBreakpoint(This,offset,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,offset,ppBreakpoint) ) -#define ICorDebugCode_GetCode(This,startOffset,endOffset,cBufferAlloc,buffer,pcBufferSize) \ +#define ICorDebugCode_GetCode(This,startOffset,endOffset,cBufferAlloc,buffer,pcBufferSize) \ ( (This)->lpVtbl -> GetCode(This,startOffset,endOffset,cBufferAlloc,buffer,pcBufferSize) ) -#define ICorDebugCode_GetVersionNumber(This,nVersion) \ +#define ICorDebugCode_GetVersionNumber(This,nVersion) \ ( (This)->lpVtbl -> GetVersionNumber(This,nVersion) ) -#define ICorDebugCode_GetILToNativeMapping(This,cMap,pcMap,map) \ +#define ICorDebugCode_GetILToNativeMapping(This,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping(This,cMap,pcMap,map) ) -#define ICorDebugCode_GetEnCRemapSequencePoints(This,cMap,pcMap,offsets) \ +#define ICorDebugCode_GetEnCRemapSequencePoints(This,cMap,pcMap,offsets) \ ( (This)->lpVtbl -> GetEnCRemapSequencePoints(This,cMap,pcMap,offsets) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugCode_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugCode_INTERFACE_DEFINED__ */ #ifndef __ICorDebugCode2_INTERFACE_DEFINED__ @@ -12604,7 +12824,7 @@ typedef struct _CodeChunkInfo { CORDB_ADDRESS startAddr; ULONG32 length; - } CodeChunkInfo; + } CodeChunkInfo; EXTERN_C const IID IID_ICorDebugCode2; @@ -12626,7 +12846,7 @@ EXTERN_C const IID IID_ICorDebugCode2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugCode2Vtbl { @@ -12667,31 +12887,31 @@ EXTERN_C const IID IID_ICorDebugCode2; #ifdef COBJMACROS -#define ICorDebugCode2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugCode2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugCode2_AddRef(This) \ +#define ICorDebugCode2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugCode2_Release(This) \ +#define ICorDebugCode2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugCode2_GetCodeChunks(This,cbufSize,pcnumChunks,chunks) \ +#define ICorDebugCode2_GetCodeChunks(This,cbufSize,pcnumChunks,chunks) \ ( (This)->lpVtbl -> GetCodeChunks(This,cbufSize,pcnumChunks,chunks) ) -#define ICorDebugCode2_GetCompilerFlags(This,pdwFlags) \ +#define ICorDebugCode2_GetCompilerFlags(This,pdwFlags) \ ( (This)->lpVtbl -> GetCompilerFlags(This,pdwFlags) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugCode2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugCode2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugCode3_INTERFACE_DEFINED__ @@ -12718,7 +12938,7 @@ EXTERN_C const IID IID_ICorDebugCode3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugCode3Vtbl { @@ -12756,28 +12976,28 @@ EXTERN_C const IID IID_ICorDebugCode3; #ifdef COBJMACROS -#define ICorDebugCode3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugCode3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugCode3_AddRef(This) \ +#define ICorDebugCode3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugCode3_Release(This) \ +#define ICorDebugCode3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugCode3_GetReturnValueLiveOffset(This,ILoffset,bufferSize,pFetched,pOffsets) \ +#define ICorDebugCode3_GetReturnValueLiveOffset(This,ILoffset,bufferSize,pFetched,pOffsets) \ ( (This)->lpVtbl -> GetReturnValueLiveOffset(This,ILoffset,bufferSize,pFetched,pOffsets) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugCode3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugCode3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugCode4_INTERFACE_DEFINED__ @@ -12801,7 +13021,7 @@ EXTERN_C const IID IID_ICorDebugCode4; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugCode4Vtbl { @@ -12836,28 +13056,28 @@ EXTERN_C const IID IID_ICorDebugCode4; #ifdef COBJMACROS -#define ICorDebugCode4_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugCode4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugCode4_AddRef(This) \ +#define ICorDebugCode4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugCode4_Release(This) \ +#define ICorDebugCode4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugCode4_EnumerateVariableHomes(This,ppEnum) \ +#define ICorDebugCode4_EnumerateVariableHomes(This,ppEnum) \ ( (This)->lpVtbl -> EnumerateVariableHomes(This,ppEnum) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugCode4_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugCode4_INTERFACE_DEFINED__ */ #ifndef __ICorDebugILCode_INTERFACE_DEFINED__ @@ -12875,7 +13095,7 @@ typedef struct _CorDebugEHClause ULONG32 HandlerLength; ULONG32 ClassToken; ULONG32 FilterOffset; - } CorDebugEHClause; + } CorDebugEHClause; EXTERN_C const IID IID_ICorDebugILCode; @@ -12894,7 +13114,7 @@ EXTERN_C const IID IID_ICorDebugILCode; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugILCodeVtbl { @@ -12931,28 +13151,28 @@ EXTERN_C const IID IID_ICorDebugILCode; #ifdef COBJMACROS -#define ICorDebugILCode_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugILCode_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugILCode_AddRef(This) \ +#define ICorDebugILCode_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugILCode_Release(This) \ +#define ICorDebugILCode_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugILCode_GetEHClauses(This,cClauses,pcClauses,clauses) \ +#define ICorDebugILCode_GetEHClauses(This,cClauses,pcClauses,clauses) \ ( (This)->lpVtbl -> GetEHClauses(This,cClauses,pcClauses,clauses) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugILCode_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugILCode_INTERFACE_DEFINED__ */ #ifndef __ICorDebugILCode2_INTERFACE_DEFINED__ @@ -12981,7 +13201,7 @@ EXTERN_C const IID IID_ICorDebugILCode2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugILCode2Vtbl { @@ -13022,31 +13242,31 @@ EXTERN_C const IID IID_ICorDebugILCode2; #ifdef COBJMACROS -#define ICorDebugILCode2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugILCode2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugILCode2_AddRef(This) \ +#define ICorDebugILCode2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugILCode2_Release(This) \ +#define ICorDebugILCode2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugILCode2_GetLocalVarSigToken(This,pmdSig) \ +#define ICorDebugILCode2_GetLocalVarSigToken(This,pmdSig) \ ( (This)->lpVtbl -> GetLocalVarSigToken(This,pmdSig) ) -#define ICorDebugILCode2_GetInstrumentedILMap(This,cMap,pcMap,map) \ +#define ICorDebugILCode2_GetInstrumentedILMap(This,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetInstrumentedILMap(This,cMap,pcMap,map) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugILCode2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugILCode2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugClass_INTERFACE_DEFINED__ @@ -13078,7 +13298,7 @@ EXTERN_C const IID IID_ICorDebugClass; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugClassVtbl { @@ -13123,34 +13343,34 @@ EXTERN_C const IID IID_ICorDebugClass; #ifdef COBJMACROS -#define ICorDebugClass_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugClass_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugClass_AddRef(This) \ +#define ICorDebugClass_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugClass_Release(This) \ +#define ICorDebugClass_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugClass_GetModule(This,pModule) \ +#define ICorDebugClass_GetModule(This,pModule) \ ( (This)->lpVtbl -> GetModule(This,pModule) ) -#define ICorDebugClass_GetToken(This,pTypeDef) \ +#define ICorDebugClass_GetToken(This,pTypeDef) \ ( (This)->lpVtbl -> GetToken(This,pTypeDef) ) -#define ICorDebugClass_GetStaticFieldValue(This,fieldDef,pFrame,ppValue) \ +#define ICorDebugClass_GetStaticFieldValue(This,fieldDef,pFrame,ppValue) \ ( (This)->lpVtbl -> GetStaticFieldValue(This,fieldDef,pFrame,ppValue) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugClass_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugClass_INTERFACE_DEFINED__ */ #ifndef __ICorDebugClass2_INTERFACE_DEFINED__ @@ -13180,7 +13400,7 @@ EXTERN_C const IID IID_ICorDebugClass2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugClass2Vtbl { @@ -13222,31 +13442,31 @@ EXTERN_C const IID IID_ICorDebugClass2; #ifdef COBJMACROS -#define ICorDebugClass2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugClass2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugClass2_AddRef(This) \ +#define ICorDebugClass2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugClass2_Release(This) \ +#define ICorDebugClass2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugClass2_GetParameterizedType(This,elementType,nTypeArgs,ppTypeArgs,ppType) \ +#define ICorDebugClass2_GetParameterizedType(This,elementType,nTypeArgs,ppTypeArgs,ppType) \ ( (This)->lpVtbl -> GetParameterizedType(This,elementType,nTypeArgs,ppTypeArgs,ppType) ) -#define ICorDebugClass2_SetJMCStatus(This,bIsJustMyCode) \ +#define ICorDebugClass2_SetJMCStatus(This,bIsJustMyCode) \ ( (This)->lpVtbl -> SetJMCStatus(This,bIsJustMyCode) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugClass2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugClass2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugEval_INTERFACE_DEFINED__ @@ -13306,7 +13526,7 @@ EXTERN_C const IID IID_ICorDebugEval; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugEvalVtbl { @@ -13386,55 +13606,55 @@ EXTERN_C const IID IID_ICorDebugEval; #ifdef COBJMACROS -#define ICorDebugEval_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugEval_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugEval_AddRef(This) \ +#define ICorDebugEval_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugEval_Release(This) \ +#define ICorDebugEval_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugEval_CallFunction(This,pFunction,nArgs,ppArgs) \ +#define ICorDebugEval_CallFunction(This,pFunction,nArgs,ppArgs) \ ( (This)->lpVtbl -> CallFunction(This,pFunction,nArgs,ppArgs) ) -#define ICorDebugEval_NewObject(This,pConstructor,nArgs,ppArgs) \ +#define ICorDebugEval_NewObject(This,pConstructor,nArgs,ppArgs) \ ( (This)->lpVtbl -> NewObject(This,pConstructor,nArgs,ppArgs) ) -#define ICorDebugEval_NewObjectNoConstructor(This,pClass) \ +#define ICorDebugEval_NewObjectNoConstructor(This,pClass) \ ( (This)->lpVtbl -> NewObjectNoConstructor(This,pClass) ) -#define ICorDebugEval_NewString(This,string) \ +#define ICorDebugEval_NewString(This,string) \ ( (This)->lpVtbl -> NewString(This,string) ) -#define ICorDebugEval_NewArray(This,elementType,pElementClass,rank,dims,lowBounds) \ +#define ICorDebugEval_NewArray(This,elementType,pElementClass,rank,dims,lowBounds) \ ( (This)->lpVtbl -> NewArray(This,elementType,pElementClass,rank,dims,lowBounds) ) -#define ICorDebugEval_IsActive(This,pbActive) \ +#define ICorDebugEval_IsActive(This,pbActive) \ ( (This)->lpVtbl -> IsActive(This,pbActive) ) -#define ICorDebugEval_Abort(This) \ +#define ICorDebugEval_Abort(This) \ ( (This)->lpVtbl -> Abort(This) ) -#define ICorDebugEval_GetResult(This,ppResult) \ +#define ICorDebugEval_GetResult(This,ppResult) \ ( (This)->lpVtbl -> GetResult(This,ppResult) ) -#define ICorDebugEval_GetThread(This,ppThread) \ +#define ICorDebugEval_GetThread(This,ppThread) \ ( (This)->lpVtbl -> GetThread(This,ppThread) ) -#define ICorDebugEval_CreateValue(This,elementType,pElementClass,ppValue) \ +#define ICorDebugEval_CreateValue(This,elementType,pElementClass,ppValue) \ ( (This)->lpVtbl -> CreateValue(This,elementType,pElementClass,ppValue) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugEval_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugEval_INTERFACE_DEFINED__ */ #ifndef __ICorDebugEval2_INTERFACE_DEFINED__ @@ -13490,7 +13710,7 @@ EXTERN_C const IID IID_ICorDebugEval2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugEval2Vtbl { @@ -13563,46 +13783,46 @@ EXTERN_C const IID IID_ICorDebugEval2; #ifdef COBJMACROS -#define ICorDebugEval2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugEval2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugEval2_AddRef(This) \ +#define ICorDebugEval2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugEval2_Release(This) \ +#define ICorDebugEval2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugEval2_CallParameterizedFunction(This,pFunction,nTypeArgs,ppTypeArgs,nArgs,ppArgs) \ +#define ICorDebugEval2_CallParameterizedFunction(This,pFunction,nTypeArgs,ppTypeArgs,nArgs,ppArgs) \ ( (This)->lpVtbl -> CallParameterizedFunction(This,pFunction,nTypeArgs,ppTypeArgs,nArgs,ppArgs) ) -#define ICorDebugEval2_CreateValueForType(This,pType,ppValue) \ +#define ICorDebugEval2_CreateValueForType(This,pType,ppValue) \ ( (This)->lpVtbl -> CreateValueForType(This,pType,ppValue) ) -#define ICorDebugEval2_NewParameterizedObject(This,pConstructor,nTypeArgs,ppTypeArgs,nArgs,ppArgs) \ +#define ICorDebugEval2_NewParameterizedObject(This,pConstructor,nTypeArgs,ppTypeArgs,nArgs,ppArgs) \ ( (This)->lpVtbl -> NewParameterizedObject(This,pConstructor,nTypeArgs,ppTypeArgs,nArgs,ppArgs) ) -#define ICorDebugEval2_NewParameterizedObjectNoConstructor(This,pClass,nTypeArgs,ppTypeArgs) \ +#define ICorDebugEval2_NewParameterizedObjectNoConstructor(This,pClass,nTypeArgs,ppTypeArgs) \ ( (This)->lpVtbl -> NewParameterizedObjectNoConstructor(This,pClass,nTypeArgs,ppTypeArgs) ) -#define ICorDebugEval2_NewParameterizedArray(This,pElementType,rank,dims,lowBounds) \ +#define ICorDebugEval2_NewParameterizedArray(This,pElementType,rank,dims,lowBounds) \ ( (This)->lpVtbl -> NewParameterizedArray(This,pElementType,rank,dims,lowBounds) ) -#define ICorDebugEval2_NewStringWithLength(This,string,uiLength) \ +#define ICorDebugEval2_NewStringWithLength(This,string,uiLength) \ ( (This)->lpVtbl -> NewStringWithLength(This,string,uiLength) ) -#define ICorDebugEval2_RudeAbort(This) \ +#define ICorDebugEval2_RudeAbort(This) \ ( (This)->lpVtbl -> RudeAbort(This) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugEval2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugEval2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugValue_INTERFACE_DEFINED__ @@ -13635,7 +13855,7 @@ EXTERN_C const IID IID_ICorDebugValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugValueVtbl { @@ -13682,37 +13902,37 @@ EXTERN_C const IID IID_ICorDebugValue; #ifdef COBJMACROS -#define ICorDebugValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugValue_AddRef(This) \ +#define ICorDebugValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugValue_Release(This) \ +#define ICorDebugValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugValue_GetType(This,pType) \ +#define ICorDebugValue_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugValue_GetSize(This,pSize) \ +#define ICorDebugValue_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugValue_GetAddress(This,pAddress) \ +#define ICorDebugValue_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugValue_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugValue_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugValue_INTERFACE_DEFINED__ */ #ifndef __ICorDebugValue2_INTERFACE_DEFINED__ @@ -13736,7 +13956,7 @@ EXTERN_C const IID IID_ICorDebugValue2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugValue2Vtbl { @@ -13771,28 +13991,28 @@ EXTERN_C const IID IID_ICorDebugValue2; #ifdef COBJMACROS -#define ICorDebugValue2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugValue2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugValue2_AddRef(This) \ +#define ICorDebugValue2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugValue2_Release(This) \ +#define ICorDebugValue2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugValue2_GetExactType(This,ppType) \ +#define ICorDebugValue2_GetExactType(This,ppType) \ ( (This)->lpVtbl -> GetExactType(This,ppType) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugValue2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugValue2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugValue3_INTERFACE_DEFINED__ @@ -13816,7 +14036,7 @@ EXTERN_C const IID IID_ICorDebugValue3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugValue3Vtbl { @@ -13851,28 +14071,28 @@ EXTERN_C const IID IID_ICorDebugValue3; #ifdef COBJMACROS -#define ICorDebugValue3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugValue3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugValue3_AddRef(This) \ +#define ICorDebugValue3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugValue3_Release(This) \ +#define ICorDebugValue3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugValue3_GetSize64(This,pSize) \ +#define ICorDebugValue3_GetSize64(This,pSize) \ ( (This)->lpVtbl -> GetSize64(This,pSize) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugValue3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugValue3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugGenericValue_INTERFACE_DEFINED__ @@ -13899,7 +14119,7 @@ EXTERN_C const IID IID_ICorDebugGenericValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugGenericValueVtbl { @@ -13954,44 +14174,44 @@ EXTERN_C const IID IID_ICorDebugGenericValue; #ifdef COBJMACROS -#define ICorDebugGenericValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugGenericValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugGenericValue_AddRef(This) \ +#define ICorDebugGenericValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugGenericValue_Release(This) \ +#define ICorDebugGenericValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugGenericValue_GetType(This,pType) \ +#define ICorDebugGenericValue_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugGenericValue_GetSize(This,pSize) \ +#define ICorDebugGenericValue_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugGenericValue_GetAddress(This,pAddress) \ +#define ICorDebugGenericValue_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugGenericValue_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugGenericValue_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugGenericValue_GetValue(This,pTo) \ +#define ICorDebugGenericValue_GetValue(This,pTo) \ ( (This)->lpVtbl -> GetValue(This,pTo) ) -#define ICorDebugGenericValue_SetValue(This,pFrom) \ +#define ICorDebugGenericValue_SetValue(This,pFrom) \ ( (This)->lpVtbl -> SetValue(This,pFrom) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugGenericValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugGenericValue_INTERFACE_DEFINED__ */ #ifndef __ICorDebugReferenceValue_INTERFACE_DEFINED__ @@ -14027,7 +14247,7 @@ EXTERN_C const IID IID_ICorDebugReferenceValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugReferenceValueVtbl { @@ -14094,53 +14314,53 @@ EXTERN_C const IID IID_ICorDebugReferenceValue; #ifdef COBJMACROS -#define ICorDebugReferenceValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugReferenceValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugReferenceValue_AddRef(This) \ +#define ICorDebugReferenceValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugReferenceValue_Release(This) \ +#define ICorDebugReferenceValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugReferenceValue_GetType(This,pType) \ +#define ICorDebugReferenceValue_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugReferenceValue_GetSize(This,pSize) \ +#define ICorDebugReferenceValue_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugReferenceValue_GetAddress(This,pAddress) \ +#define ICorDebugReferenceValue_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugReferenceValue_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugReferenceValue_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugReferenceValue_IsNull(This,pbNull) \ +#define ICorDebugReferenceValue_IsNull(This,pbNull) \ ( (This)->lpVtbl -> IsNull(This,pbNull) ) -#define ICorDebugReferenceValue_GetValue(This,pValue) \ +#define ICorDebugReferenceValue_GetValue(This,pValue) \ ( (This)->lpVtbl -> GetValue(This,pValue) ) -#define ICorDebugReferenceValue_SetValue(This,value) \ +#define ICorDebugReferenceValue_SetValue(This,value) \ ( (This)->lpVtbl -> SetValue(This,value) ) -#define ICorDebugReferenceValue_Dereference(This,ppValue) \ +#define ICorDebugReferenceValue_Dereference(This,ppValue) \ ( (This)->lpVtbl -> Dereference(This,ppValue) ) -#define ICorDebugReferenceValue_DereferenceStrong(This,ppValue) \ +#define ICorDebugReferenceValue_DereferenceStrong(This,ppValue) \ ( (This)->lpVtbl -> DereferenceStrong(This,ppValue) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugReferenceValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugReferenceValue_INTERFACE_DEFINED__ */ #ifndef __ICorDebugHeapValue_INTERFACE_DEFINED__ @@ -14167,7 +14387,7 @@ EXTERN_C const IID IID_ICorDebugHeapValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugHeapValueVtbl { @@ -14222,44 +14442,44 @@ EXTERN_C const IID IID_ICorDebugHeapValue; #ifdef COBJMACROS -#define ICorDebugHeapValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugHeapValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugHeapValue_AddRef(This) \ +#define ICorDebugHeapValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugHeapValue_Release(This) \ +#define ICorDebugHeapValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugHeapValue_GetType(This,pType) \ +#define ICorDebugHeapValue_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugHeapValue_GetSize(This,pSize) \ +#define ICorDebugHeapValue_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugHeapValue_GetAddress(This,pAddress) \ +#define ICorDebugHeapValue_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugHeapValue_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugHeapValue_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugHeapValue_IsValid(This,pbValid) \ +#define ICorDebugHeapValue_IsValid(This,pbValid) \ ( (This)->lpVtbl -> IsValid(This,pbValid) ) -#define ICorDebugHeapValue_CreateRelocBreakpoint(This,ppBreakpoint) \ +#define ICorDebugHeapValue_CreateRelocBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateRelocBreakpoint(This,ppBreakpoint) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugHeapValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugHeapValue_INTERFACE_DEFINED__ */ #ifndef __ICorDebugHeapValue2_INTERFACE_DEFINED__ @@ -14284,7 +14504,7 @@ EXTERN_C const IID IID_ICorDebugHeapValue2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugHeapValue2Vtbl { @@ -14320,28 +14540,28 @@ EXTERN_C const IID IID_ICorDebugHeapValue2; #ifdef COBJMACROS -#define ICorDebugHeapValue2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugHeapValue2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugHeapValue2_AddRef(This) \ +#define ICorDebugHeapValue2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugHeapValue2_Release(This) \ +#define ICorDebugHeapValue2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugHeapValue2_CreateHandle(This,type,ppHandle) \ +#define ICorDebugHeapValue2_CreateHandle(This,type,ppHandle) \ ( (This)->lpVtbl -> CreateHandle(This,type,ppHandle) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugHeapValue2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugHeapValue2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugHeapValue3_INTERFACE_DEFINED__ @@ -14369,7 +14589,7 @@ EXTERN_C const IID IID_ICorDebugHeapValue3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugHeapValue3Vtbl { @@ -14409,31 +14629,31 @@ EXTERN_C const IID IID_ICorDebugHeapValue3; #ifdef COBJMACROS -#define ICorDebugHeapValue3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugHeapValue3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugHeapValue3_AddRef(This) \ +#define ICorDebugHeapValue3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugHeapValue3_Release(This) \ +#define ICorDebugHeapValue3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugHeapValue3_GetThreadOwningMonitorLock(This,ppThread,pAcquisitionCount) \ +#define ICorDebugHeapValue3_GetThreadOwningMonitorLock(This,ppThread,pAcquisitionCount) \ ( (This)->lpVtbl -> GetThreadOwningMonitorLock(This,ppThread,pAcquisitionCount) ) -#define ICorDebugHeapValue3_GetMonitorEventWaitList(This,ppThreadEnum) \ +#define ICorDebugHeapValue3_GetMonitorEventWaitList(This,ppThreadEnum) \ ( (This)->lpVtbl -> GetMonitorEventWaitList(This,ppThreadEnum) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugHeapValue3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugHeapValue3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugObjectValue_INTERFACE_DEFINED__ @@ -14478,7 +14698,7 @@ EXTERN_C const IID IID_ICorDebugObjectValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugObjectValueVtbl { @@ -14556,59 +14776,59 @@ EXTERN_C const IID IID_ICorDebugObjectValue; #ifdef COBJMACROS -#define ICorDebugObjectValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugObjectValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugObjectValue_AddRef(This) \ +#define ICorDebugObjectValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugObjectValue_Release(This) \ +#define ICorDebugObjectValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugObjectValue_GetType(This,pType) \ +#define ICorDebugObjectValue_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugObjectValue_GetSize(This,pSize) \ +#define ICorDebugObjectValue_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugObjectValue_GetAddress(This,pAddress) \ +#define ICorDebugObjectValue_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugObjectValue_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugObjectValue_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugObjectValue_GetClass(This,ppClass) \ +#define ICorDebugObjectValue_GetClass(This,ppClass) \ ( (This)->lpVtbl -> GetClass(This,ppClass) ) -#define ICorDebugObjectValue_GetFieldValue(This,pClass,fieldDef,ppValue) \ +#define ICorDebugObjectValue_GetFieldValue(This,pClass,fieldDef,ppValue) \ ( (This)->lpVtbl -> GetFieldValue(This,pClass,fieldDef,ppValue) ) -#define ICorDebugObjectValue_GetVirtualMethod(This,memberRef,ppFunction) \ +#define ICorDebugObjectValue_GetVirtualMethod(This,memberRef,ppFunction) \ ( (This)->lpVtbl -> GetVirtualMethod(This,memberRef,ppFunction) ) -#define ICorDebugObjectValue_GetContext(This,ppContext) \ +#define ICorDebugObjectValue_GetContext(This,ppContext) \ ( (This)->lpVtbl -> GetContext(This,ppContext) ) -#define ICorDebugObjectValue_IsValueClass(This,pbIsValueClass) \ +#define ICorDebugObjectValue_IsValueClass(This,pbIsValueClass) \ ( (This)->lpVtbl -> IsValueClass(This,pbIsValueClass) ) -#define ICorDebugObjectValue_GetManagedCopy(This,ppObject) \ +#define ICorDebugObjectValue_GetManagedCopy(This,ppObject) \ ( (This)->lpVtbl -> GetManagedCopy(This,ppObject) ) -#define ICorDebugObjectValue_SetFromManagedCopy(This,pObject) \ +#define ICorDebugObjectValue_SetFromManagedCopy(This,pObject) \ ( (This)->lpVtbl -> SetFromManagedCopy(This,pObject) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugObjectValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugObjectValue_INTERFACE_DEFINED__ */ #ifndef __ICorDebugObjectValue2_INTERFACE_DEFINED__ @@ -14634,7 +14854,7 @@ EXTERN_C const IID IID_ICorDebugObjectValue2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugObjectValue2Vtbl { @@ -14671,28 +14891,28 @@ EXTERN_C const IID IID_ICorDebugObjectValue2; #ifdef COBJMACROS -#define ICorDebugObjectValue2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugObjectValue2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugObjectValue2_AddRef(This) \ +#define ICorDebugObjectValue2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugObjectValue2_Release(This) \ +#define ICorDebugObjectValue2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugObjectValue2_GetVirtualMethodAndType(This,memberRef,ppFunction,ppType) \ +#define ICorDebugObjectValue2_GetVirtualMethodAndType(This,memberRef,ppFunction,ppType) \ ( (This)->lpVtbl -> GetVirtualMethodAndType(This,memberRef,ppFunction,ppType) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugObjectValue2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugObjectValue2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugDelegateObjectValue_INTERFACE_DEFINED__ @@ -14719,7 +14939,7 @@ EXTERN_C const IID IID_ICorDebugDelegateObjectValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugDelegateObjectValueVtbl { @@ -14758,31 +14978,31 @@ EXTERN_C const IID IID_ICorDebugDelegateObjectValue; #ifdef COBJMACROS -#define ICorDebugDelegateObjectValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugDelegateObjectValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugDelegateObjectValue_AddRef(This) \ +#define ICorDebugDelegateObjectValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugDelegateObjectValue_Release(This) \ +#define ICorDebugDelegateObjectValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugDelegateObjectValue_GetTarget(This,ppObject) \ +#define ICorDebugDelegateObjectValue_GetTarget(This,ppObject) \ ( (This)->lpVtbl -> GetTarget(This,ppObject) ) -#define ICorDebugDelegateObjectValue_GetFunction(This,ppFunction) \ +#define ICorDebugDelegateObjectValue_GetFunction(This,ppFunction) \ ( (This)->lpVtbl -> GetFunction(This,ppFunction) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugDelegateObjectValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugDelegateObjectValue_INTERFACE_DEFINED__ */ #ifndef __ICorDebugBoxValue_INTERFACE_DEFINED__ @@ -14806,7 +15026,7 @@ EXTERN_C const IID IID_ICorDebugBoxValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugBoxValueVtbl { @@ -14865,59 +15085,59 @@ EXTERN_C const IID IID_ICorDebugBoxValue; #ifdef COBJMACROS -#define ICorDebugBoxValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugBoxValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugBoxValue_AddRef(This) \ +#define ICorDebugBoxValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugBoxValue_Release(This) \ +#define ICorDebugBoxValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugBoxValue_GetType(This,pType) \ +#define ICorDebugBoxValue_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugBoxValue_GetSize(This,pSize) \ +#define ICorDebugBoxValue_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugBoxValue_GetAddress(This,pAddress) \ +#define ICorDebugBoxValue_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugBoxValue_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugBoxValue_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugBoxValue_IsValid(This,pbValid) \ +#define ICorDebugBoxValue_IsValid(This,pbValid) \ ( (This)->lpVtbl -> IsValid(This,pbValid) ) -#define ICorDebugBoxValue_CreateRelocBreakpoint(This,ppBreakpoint) \ +#define ICorDebugBoxValue_CreateRelocBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateRelocBreakpoint(This,ppBreakpoint) ) -#define ICorDebugBoxValue_GetObject(This,ppObject) \ +#define ICorDebugBoxValue_GetObject(This,ppObject) \ ( (This)->lpVtbl -> GetObject(This,ppObject) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugBoxValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugBoxValue_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0100 */ +/* interface __MIDL_itf_cordebug_0000_0102 */ /* [local] */ #pragma warning(push) #pragma warning(disable:28718) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0100_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0100_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0102_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0102_v0_0_s_ifspec; #ifndef __ICorDebugStringValue_INTERFACE_DEFINED__ #define __ICorDebugStringValue_INTERFACE_DEFINED__ @@ -14945,7 +15165,7 @@ EXTERN_C const IID IID_ICorDebugStringValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugStringValueVtbl { @@ -15010,61 +15230,61 @@ EXTERN_C const IID IID_ICorDebugStringValue; #ifdef COBJMACROS -#define ICorDebugStringValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugStringValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugStringValue_AddRef(This) \ +#define ICorDebugStringValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugStringValue_Release(This) \ +#define ICorDebugStringValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugStringValue_GetType(This,pType) \ +#define ICorDebugStringValue_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugStringValue_GetSize(This,pSize) \ +#define ICorDebugStringValue_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugStringValue_GetAddress(This,pAddress) \ +#define ICorDebugStringValue_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugStringValue_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugStringValue_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugStringValue_IsValid(This,pbValid) \ +#define ICorDebugStringValue_IsValid(This,pbValid) \ ( (This)->lpVtbl -> IsValid(This,pbValid) ) -#define ICorDebugStringValue_CreateRelocBreakpoint(This,ppBreakpoint) \ +#define ICorDebugStringValue_CreateRelocBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateRelocBreakpoint(This,ppBreakpoint) ) -#define ICorDebugStringValue_GetLength(This,pcchString) \ +#define ICorDebugStringValue_GetLength(This,pcchString) \ ( (This)->lpVtbl -> GetLength(This,pcchString) ) -#define ICorDebugStringValue_GetString(This,cchString,pcchString,szString) \ +#define ICorDebugStringValue_GetString(This,cchString,pcchString,szString) \ ( (This)->lpVtbl -> GetString(This,cchString,pcchString,szString) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugStringValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugStringValue_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0101 */ +/* interface __MIDL_itf_cordebug_0000_0103 */ /* [local] */ #pragma warning(pop) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0101_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0101_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0103_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0103_v0_0_s_ifspec; #ifndef __ICorDebugArrayValue_INTERFACE_DEFINED__ #define __ICorDebugArrayValue_INTERFACE_DEFINED__ @@ -15113,7 +15333,7 @@ EXTERN_C const IID IID_ICorDebugArrayValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugArrayValueVtbl { @@ -15205,69 +15425,69 @@ EXTERN_C const IID IID_ICorDebugArrayValue; #ifdef COBJMACROS -#define ICorDebugArrayValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugArrayValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugArrayValue_AddRef(This) \ +#define ICorDebugArrayValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugArrayValue_Release(This) \ +#define ICorDebugArrayValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugArrayValue_GetType(This,pType) \ +#define ICorDebugArrayValue_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugArrayValue_GetSize(This,pSize) \ +#define ICorDebugArrayValue_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugArrayValue_GetAddress(This,pAddress) \ +#define ICorDebugArrayValue_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugArrayValue_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugArrayValue_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugArrayValue_IsValid(This,pbValid) \ +#define ICorDebugArrayValue_IsValid(This,pbValid) \ ( (This)->lpVtbl -> IsValid(This,pbValid) ) -#define ICorDebugArrayValue_CreateRelocBreakpoint(This,ppBreakpoint) \ +#define ICorDebugArrayValue_CreateRelocBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateRelocBreakpoint(This,ppBreakpoint) ) -#define ICorDebugArrayValue_GetElementType(This,pType) \ +#define ICorDebugArrayValue_GetElementType(This,pType) \ ( (This)->lpVtbl -> GetElementType(This,pType) ) -#define ICorDebugArrayValue_GetRank(This,pnRank) \ +#define ICorDebugArrayValue_GetRank(This,pnRank) \ ( (This)->lpVtbl -> GetRank(This,pnRank) ) -#define ICorDebugArrayValue_GetCount(This,pnCount) \ +#define ICorDebugArrayValue_GetCount(This,pnCount) \ ( (This)->lpVtbl -> GetCount(This,pnCount) ) -#define ICorDebugArrayValue_GetDimensions(This,cdim,dims) \ +#define ICorDebugArrayValue_GetDimensions(This,cdim,dims) \ ( (This)->lpVtbl -> GetDimensions(This,cdim,dims) ) -#define ICorDebugArrayValue_HasBaseIndicies(This,pbHasBaseIndicies) \ +#define ICorDebugArrayValue_HasBaseIndicies(This,pbHasBaseIndicies) \ ( (This)->lpVtbl -> HasBaseIndicies(This,pbHasBaseIndicies) ) -#define ICorDebugArrayValue_GetBaseIndicies(This,cdim,indicies) \ +#define ICorDebugArrayValue_GetBaseIndicies(This,cdim,indicies) \ ( (This)->lpVtbl -> GetBaseIndicies(This,cdim,indicies) ) -#define ICorDebugArrayValue_GetElement(This,cdim,indices,ppValue) \ +#define ICorDebugArrayValue_GetElement(This,cdim,indices,ppValue) \ ( (This)->lpVtbl -> GetElement(This,cdim,indices,ppValue) ) -#define ICorDebugArrayValue_GetElementAtPosition(This,nPosition,ppValue) \ +#define ICorDebugArrayValue_GetElementAtPosition(This,nPosition,ppValue) \ ( (This)->lpVtbl -> GetElementAtPosition(This,nPosition,ppValue) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugArrayValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugArrayValue_INTERFACE_DEFINED__ */ #ifndef __ICorDebugVariableHome_INTERFACE_DEFINED__ @@ -15279,10 +15499,10 @@ EXTERN_C const IID IID_ICorDebugArrayValue; typedef enum VariableLocationType { - VLT_REGISTER = 0, - VLT_REGISTER_RELATIVE = ( VLT_REGISTER + 1 ) , - VLT_INVALID = ( VLT_REGISTER_RELATIVE + 1 ) - } VariableLocationType; + VLT_REGISTER = 0, + VLT_REGISTER_RELATIVE = ( VLT_REGISTER + 1 ) , + VLT_INVALID = ( VLT_REGISTER_RELATIVE + 1 ) + } VariableLocationType; EXTERN_C const IID IID_ICorDebugVariableHome; @@ -15318,7 +15538,7 @@ EXTERN_C const IID IID_ICorDebugVariableHome; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugVariableHomeVtbl { @@ -15378,46 +15598,46 @@ EXTERN_C const IID IID_ICorDebugVariableHome; #ifdef COBJMACROS -#define ICorDebugVariableHome_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugVariableHome_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugVariableHome_AddRef(This) \ +#define ICorDebugVariableHome_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugVariableHome_Release(This) \ +#define ICorDebugVariableHome_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugVariableHome_GetCode(This,ppCode) \ +#define ICorDebugVariableHome_GetCode(This,ppCode) \ ( (This)->lpVtbl -> GetCode(This,ppCode) ) -#define ICorDebugVariableHome_GetSlotIndex(This,pSlotIndex) \ +#define ICorDebugVariableHome_GetSlotIndex(This,pSlotIndex) \ ( (This)->lpVtbl -> GetSlotIndex(This,pSlotIndex) ) -#define ICorDebugVariableHome_GetArgumentIndex(This,pArgumentIndex) \ +#define ICorDebugVariableHome_GetArgumentIndex(This,pArgumentIndex) \ ( (This)->lpVtbl -> GetArgumentIndex(This,pArgumentIndex) ) -#define ICorDebugVariableHome_GetLiveRange(This,pStartOffset,pEndOffset) \ +#define ICorDebugVariableHome_GetLiveRange(This,pStartOffset,pEndOffset) \ ( (This)->lpVtbl -> GetLiveRange(This,pStartOffset,pEndOffset) ) -#define ICorDebugVariableHome_GetLocationType(This,pLocationType) \ +#define ICorDebugVariableHome_GetLocationType(This,pLocationType) \ ( (This)->lpVtbl -> GetLocationType(This,pLocationType) ) -#define ICorDebugVariableHome_GetRegister(This,pRegister) \ +#define ICorDebugVariableHome_GetRegister(This,pRegister) \ ( (This)->lpVtbl -> GetRegister(This,pRegister) ) -#define ICorDebugVariableHome_GetOffset(This,pOffset) \ +#define ICorDebugVariableHome_GetOffset(This,pOffset) \ ( (This)->lpVtbl -> GetOffset(This,pOffset) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugVariableHome_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugVariableHome_INTERFACE_DEFINED__ */ #ifndef __ICorDebugHandleValue_INTERFACE_DEFINED__ @@ -15443,7 +15663,7 @@ EXTERN_C const IID IID_ICorDebugHandleValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugHandleValueVtbl { @@ -15517,60 +15737,60 @@ EXTERN_C const IID IID_ICorDebugHandleValue; #ifdef COBJMACROS -#define ICorDebugHandleValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugHandleValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugHandleValue_AddRef(This) \ +#define ICorDebugHandleValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugHandleValue_Release(This) \ +#define ICorDebugHandleValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugHandleValue_GetType(This,pType) \ +#define ICorDebugHandleValue_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugHandleValue_GetSize(This,pSize) \ +#define ICorDebugHandleValue_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugHandleValue_GetAddress(This,pAddress) \ +#define ICorDebugHandleValue_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugHandleValue_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugHandleValue_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugHandleValue_IsNull(This,pbNull) \ +#define ICorDebugHandleValue_IsNull(This,pbNull) \ ( (This)->lpVtbl -> IsNull(This,pbNull) ) -#define ICorDebugHandleValue_GetValue(This,pValue) \ +#define ICorDebugHandleValue_GetValue(This,pValue) \ ( (This)->lpVtbl -> GetValue(This,pValue) ) -#define ICorDebugHandleValue_SetValue(This,value) \ +#define ICorDebugHandleValue_SetValue(This,value) \ ( (This)->lpVtbl -> SetValue(This,value) ) -#define ICorDebugHandleValue_Dereference(This,ppValue) \ +#define ICorDebugHandleValue_Dereference(This,ppValue) \ ( (This)->lpVtbl -> Dereference(This,ppValue) ) -#define ICorDebugHandleValue_DereferenceStrong(This,ppValue) \ +#define ICorDebugHandleValue_DereferenceStrong(This,ppValue) \ ( (This)->lpVtbl -> DereferenceStrong(This,ppValue) ) -#define ICorDebugHandleValue_GetHandleType(This,pType) \ +#define ICorDebugHandleValue_GetHandleType(This,pType) \ ( (This)->lpVtbl -> GetHandleType(This,pType) ) -#define ICorDebugHandleValue_Dispose(This) \ +#define ICorDebugHandleValue_Dispose(This) \ ( (This)->lpVtbl -> Dispose(This) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugHandleValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugHandleValue_INTERFACE_DEFINED__ */ #ifndef __ICorDebugContext_INTERFACE_DEFINED__ @@ -15591,7 +15811,7 @@ EXTERN_C const IID IID_ICorDebugContext; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugContextVtbl { @@ -15669,60 +15889,60 @@ EXTERN_C const IID IID_ICorDebugContext; #ifdef COBJMACROS -#define ICorDebugContext_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugContext_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugContext_AddRef(This) \ +#define ICorDebugContext_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugContext_Release(This) \ +#define ICorDebugContext_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugContext_GetType(This,pType) \ +#define ICorDebugContext_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugContext_GetSize(This,pSize) \ +#define ICorDebugContext_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugContext_GetAddress(This,pAddress) \ +#define ICorDebugContext_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugContext_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugContext_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugContext_GetClass(This,ppClass) \ +#define ICorDebugContext_GetClass(This,ppClass) \ ( (This)->lpVtbl -> GetClass(This,ppClass) ) -#define ICorDebugContext_GetFieldValue(This,pClass,fieldDef,ppValue) \ +#define ICorDebugContext_GetFieldValue(This,pClass,fieldDef,ppValue) \ ( (This)->lpVtbl -> GetFieldValue(This,pClass,fieldDef,ppValue) ) -#define ICorDebugContext_GetVirtualMethod(This,memberRef,ppFunction) \ +#define ICorDebugContext_GetVirtualMethod(This,memberRef,ppFunction) \ ( (This)->lpVtbl -> GetVirtualMethod(This,memberRef,ppFunction) ) -#define ICorDebugContext_GetContext(This,ppContext) \ +#define ICorDebugContext_GetContext(This,ppContext) \ ( (This)->lpVtbl -> GetContext(This,ppContext) ) -#define ICorDebugContext_IsValueClass(This,pbIsValueClass) \ +#define ICorDebugContext_IsValueClass(This,pbIsValueClass) \ ( (This)->lpVtbl -> IsValueClass(This,pbIsValueClass) ) -#define ICorDebugContext_GetManagedCopy(This,ppObject) \ +#define ICorDebugContext_GetManagedCopy(This,ppObject) \ ( (This)->lpVtbl -> GetManagedCopy(This,ppObject) ) -#define ICorDebugContext_SetFromManagedCopy(This,pObject) \ +#define ICorDebugContext_SetFromManagedCopy(This,pObject) \ ( (This)->lpVtbl -> SetFromManagedCopy(This,pObject) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugContext_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugContext_INTERFACE_DEFINED__ */ #ifndef __ICorDebugComObjectValue_INTERFACE_DEFINED__ @@ -15753,7 +15973,7 @@ EXTERN_C const IID IID_ICorDebugComObjectValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugComObjectValueVtbl { @@ -15796,31 +16016,31 @@ EXTERN_C const IID IID_ICorDebugComObjectValue; #ifdef COBJMACROS -#define ICorDebugComObjectValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugComObjectValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugComObjectValue_AddRef(This) \ +#define ICorDebugComObjectValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugComObjectValue_Release(This) \ +#define ICorDebugComObjectValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugComObjectValue_GetCachedInterfaceTypes(This,bIInspectableOnly,ppInterfacesEnum) \ +#define ICorDebugComObjectValue_GetCachedInterfaceTypes(This,bIInspectableOnly,ppInterfacesEnum) \ ( (This)->lpVtbl -> GetCachedInterfaceTypes(This,bIInspectableOnly,ppInterfacesEnum) ) -#define ICorDebugComObjectValue_GetCachedInterfacePointers(This,bIInspectableOnly,celt,pcEltFetched,ptrs) \ +#define ICorDebugComObjectValue_GetCachedInterfacePointers(This,bIInspectableOnly,celt,pcEltFetched,ptrs) \ ( (This)->lpVtbl -> GetCachedInterfacePointers(This,bIInspectableOnly,celt,pcEltFetched,ptrs) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugComObjectValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugComObjectValue_INTERFACE_DEFINED__ */ #ifndef __ICorDebugObjectEnum_INTERFACE_DEFINED__ @@ -15846,7 +16066,7 @@ EXTERN_C const IID IID_ICorDebugObjectEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugObjectEnumVtbl { @@ -15898,41 +16118,41 @@ EXTERN_C const IID IID_ICorDebugObjectEnum; #ifdef COBJMACROS -#define ICorDebugObjectEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugObjectEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugObjectEnum_AddRef(This) \ +#define ICorDebugObjectEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugObjectEnum_Release(This) \ +#define ICorDebugObjectEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugObjectEnum_Skip(This,celt) \ +#define ICorDebugObjectEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugObjectEnum_Reset(This) \ +#define ICorDebugObjectEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugObjectEnum_Clone(This,ppEnum) \ +#define ICorDebugObjectEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugObjectEnum_GetCount(This,pcelt) \ +#define ICorDebugObjectEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugObjectEnum_Next(This,celt,objects,pceltFetched) \ +#define ICorDebugObjectEnum_Next(This,celt,objects,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,objects,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugObjectEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugObjectEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugBreakpointEnum_INTERFACE_DEFINED__ @@ -15958,7 +16178,7 @@ EXTERN_C const IID IID_ICorDebugBreakpointEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugBreakpointEnumVtbl { @@ -16010,41 +16230,41 @@ EXTERN_C const IID IID_ICorDebugBreakpointEnum; #ifdef COBJMACROS -#define ICorDebugBreakpointEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugBreakpointEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugBreakpointEnum_AddRef(This) \ +#define ICorDebugBreakpointEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugBreakpointEnum_Release(This) \ +#define ICorDebugBreakpointEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugBreakpointEnum_Skip(This,celt) \ +#define ICorDebugBreakpointEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugBreakpointEnum_Reset(This) \ +#define ICorDebugBreakpointEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugBreakpointEnum_Clone(This,ppEnum) \ +#define ICorDebugBreakpointEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugBreakpointEnum_GetCount(This,pcelt) \ +#define ICorDebugBreakpointEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugBreakpointEnum_Next(This,celt,breakpoints,pceltFetched) \ +#define ICorDebugBreakpointEnum_Next(This,celt,breakpoints,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,breakpoints,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugBreakpointEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugBreakpointEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugStepperEnum_INTERFACE_DEFINED__ @@ -16070,7 +16290,7 @@ EXTERN_C const IID IID_ICorDebugStepperEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugStepperEnumVtbl { @@ -16122,41 +16342,41 @@ EXTERN_C const IID IID_ICorDebugStepperEnum; #ifdef COBJMACROS -#define ICorDebugStepperEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugStepperEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugStepperEnum_AddRef(This) \ +#define ICorDebugStepperEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugStepperEnum_Release(This) \ +#define ICorDebugStepperEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugStepperEnum_Skip(This,celt) \ +#define ICorDebugStepperEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugStepperEnum_Reset(This) \ +#define ICorDebugStepperEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugStepperEnum_Clone(This,ppEnum) \ +#define ICorDebugStepperEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugStepperEnum_GetCount(This,pcelt) \ +#define ICorDebugStepperEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugStepperEnum_Next(This,celt,steppers,pceltFetched) \ +#define ICorDebugStepperEnum_Next(This,celt,steppers,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,steppers,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugStepperEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugStepperEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugProcessEnum_INTERFACE_DEFINED__ @@ -16182,7 +16402,7 @@ EXTERN_C const IID IID_ICorDebugProcessEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcessEnumVtbl { @@ -16234,41 +16454,41 @@ EXTERN_C const IID IID_ICorDebugProcessEnum; #ifdef COBJMACROS -#define ICorDebugProcessEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcessEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcessEnum_AddRef(This) \ +#define ICorDebugProcessEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcessEnum_Release(This) \ +#define ICorDebugProcessEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcessEnum_Skip(This,celt) \ +#define ICorDebugProcessEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugProcessEnum_Reset(This) \ +#define ICorDebugProcessEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugProcessEnum_Clone(This,ppEnum) \ +#define ICorDebugProcessEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugProcessEnum_GetCount(This,pcelt) \ +#define ICorDebugProcessEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugProcessEnum_Next(This,celt,processes,pceltFetched) \ +#define ICorDebugProcessEnum_Next(This,celt,processes,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,processes,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugProcessEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcessEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugThreadEnum_INTERFACE_DEFINED__ @@ -16294,7 +16514,7 @@ EXTERN_C const IID IID_ICorDebugThreadEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugThreadEnumVtbl { @@ -16346,41 +16566,41 @@ EXTERN_C const IID IID_ICorDebugThreadEnum; #ifdef COBJMACROS -#define ICorDebugThreadEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugThreadEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugThreadEnum_AddRef(This) \ +#define ICorDebugThreadEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugThreadEnum_Release(This) \ +#define ICorDebugThreadEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugThreadEnum_Skip(This,celt) \ +#define ICorDebugThreadEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugThreadEnum_Reset(This) \ +#define ICorDebugThreadEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugThreadEnum_Clone(This,ppEnum) \ +#define ICorDebugThreadEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugThreadEnum_GetCount(This,pcelt) \ +#define ICorDebugThreadEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugThreadEnum_Next(This,celt,threads,pceltFetched) \ +#define ICorDebugThreadEnum_Next(This,celt,threads,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,threads,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugThreadEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugThreadEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugFrameEnum_INTERFACE_DEFINED__ @@ -16406,7 +16626,7 @@ EXTERN_C const IID IID_ICorDebugFrameEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugFrameEnumVtbl { @@ -16458,41 +16678,41 @@ EXTERN_C const IID IID_ICorDebugFrameEnum; #ifdef COBJMACROS -#define ICorDebugFrameEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugFrameEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugFrameEnum_AddRef(This) \ +#define ICorDebugFrameEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugFrameEnum_Release(This) \ +#define ICorDebugFrameEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugFrameEnum_Skip(This,celt) \ +#define ICorDebugFrameEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugFrameEnum_Reset(This) \ +#define ICorDebugFrameEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugFrameEnum_Clone(This,ppEnum) \ +#define ICorDebugFrameEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugFrameEnum_GetCount(This,pcelt) \ +#define ICorDebugFrameEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugFrameEnum_Next(This,celt,frames,pceltFetched) \ +#define ICorDebugFrameEnum_Next(This,celt,frames,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,frames,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugFrameEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugFrameEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugChainEnum_INTERFACE_DEFINED__ @@ -16518,7 +16738,7 @@ EXTERN_C const IID IID_ICorDebugChainEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugChainEnumVtbl { @@ -16570,41 +16790,41 @@ EXTERN_C const IID IID_ICorDebugChainEnum; #ifdef COBJMACROS -#define ICorDebugChainEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugChainEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugChainEnum_AddRef(This) \ +#define ICorDebugChainEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugChainEnum_Release(This) \ +#define ICorDebugChainEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugChainEnum_Skip(This,celt) \ +#define ICorDebugChainEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugChainEnum_Reset(This) \ +#define ICorDebugChainEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugChainEnum_Clone(This,ppEnum) \ +#define ICorDebugChainEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugChainEnum_GetCount(This,pcelt) \ +#define ICorDebugChainEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugChainEnum_Next(This,celt,chains,pceltFetched) \ +#define ICorDebugChainEnum_Next(This,celt,chains,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,chains,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugChainEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugChainEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugModuleEnum_INTERFACE_DEFINED__ @@ -16630,7 +16850,7 @@ EXTERN_C const IID IID_ICorDebugModuleEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugModuleEnumVtbl { @@ -16682,41 +16902,41 @@ EXTERN_C const IID IID_ICorDebugModuleEnum; #ifdef COBJMACROS -#define ICorDebugModuleEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugModuleEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugModuleEnum_AddRef(This) \ +#define ICorDebugModuleEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugModuleEnum_Release(This) \ +#define ICorDebugModuleEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugModuleEnum_Skip(This,celt) \ +#define ICorDebugModuleEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugModuleEnum_Reset(This) \ +#define ICorDebugModuleEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugModuleEnum_Clone(This,ppEnum) \ +#define ICorDebugModuleEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugModuleEnum_GetCount(This,pcelt) \ +#define ICorDebugModuleEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugModuleEnum_Next(This,celt,modules,pceltFetched) \ +#define ICorDebugModuleEnum_Next(This,celt,modules,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,modules,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugModuleEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugModuleEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugValueEnum_INTERFACE_DEFINED__ @@ -16742,7 +16962,7 @@ EXTERN_C const IID IID_ICorDebugValueEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugValueEnumVtbl { @@ -16794,41 +17014,41 @@ EXTERN_C const IID IID_ICorDebugValueEnum; #ifdef COBJMACROS -#define ICorDebugValueEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugValueEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugValueEnum_AddRef(This) \ +#define ICorDebugValueEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugValueEnum_Release(This) \ +#define ICorDebugValueEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugValueEnum_Skip(This,celt) \ +#define ICorDebugValueEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugValueEnum_Reset(This) \ +#define ICorDebugValueEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugValueEnum_Clone(This,ppEnum) \ +#define ICorDebugValueEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugValueEnum_GetCount(This,pcelt) \ +#define ICorDebugValueEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugValueEnum_Next(This,celt,values,pceltFetched) \ +#define ICorDebugValueEnum_Next(This,celt,values,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugValueEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugValueEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugVariableHomeEnum_INTERFACE_DEFINED__ @@ -16854,7 +17074,7 @@ EXTERN_C const IID IID_ICorDebugVariableHomeEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugVariableHomeEnumVtbl { @@ -16906,41 +17126,41 @@ EXTERN_C const IID IID_ICorDebugVariableHomeEnum; #ifdef COBJMACROS -#define ICorDebugVariableHomeEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugVariableHomeEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugVariableHomeEnum_AddRef(This) \ +#define ICorDebugVariableHomeEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugVariableHomeEnum_Release(This) \ +#define ICorDebugVariableHomeEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugVariableHomeEnum_Skip(This,celt) \ +#define ICorDebugVariableHomeEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugVariableHomeEnum_Reset(This) \ +#define ICorDebugVariableHomeEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugVariableHomeEnum_Clone(This,ppEnum) \ +#define ICorDebugVariableHomeEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugVariableHomeEnum_GetCount(This,pcelt) \ +#define ICorDebugVariableHomeEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugVariableHomeEnum_Next(This,celt,homes,pceltFetched) \ +#define ICorDebugVariableHomeEnum_Next(This,celt,homes,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,homes,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugVariableHomeEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugVariableHomeEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugCodeEnum_INTERFACE_DEFINED__ @@ -16966,7 +17186,7 @@ EXTERN_C const IID IID_ICorDebugCodeEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugCodeEnumVtbl { @@ -17018,41 +17238,41 @@ EXTERN_C const IID IID_ICorDebugCodeEnum; #ifdef COBJMACROS -#define ICorDebugCodeEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugCodeEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugCodeEnum_AddRef(This) \ +#define ICorDebugCodeEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugCodeEnum_Release(This) \ +#define ICorDebugCodeEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugCodeEnum_Skip(This,celt) \ +#define ICorDebugCodeEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugCodeEnum_Reset(This) \ +#define ICorDebugCodeEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugCodeEnum_Clone(This,ppEnum) \ +#define ICorDebugCodeEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugCodeEnum_GetCount(This,pcelt) \ +#define ICorDebugCodeEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugCodeEnum_Next(This,celt,values,pceltFetched) \ +#define ICorDebugCodeEnum_Next(This,celt,values,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugCodeEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugCodeEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugTypeEnum_INTERFACE_DEFINED__ @@ -17078,7 +17298,7 @@ EXTERN_C const IID IID_ICorDebugTypeEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugTypeEnumVtbl { @@ -17130,41 +17350,41 @@ EXTERN_C const IID IID_ICorDebugTypeEnum; #ifdef COBJMACROS -#define ICorDebugTypeEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugTypeEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugTypeEnum_AddRef(This) \ +#define ICorDebugTypeEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugTypeEnum_Release(This) \ +#define ICorDebugTypeEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugTypeEnum_Skip(This,celt) \ +#define ICorDebugTypeEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugTypeEnum_Reset(This) \ +#define ICorDebugTypeEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugTypeEnum_Clone(This,ppEnum) \ +#define ICorDebugTypeEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugTypeEnum_GetCount(This,pcelt) \ +#define ICorDebugTypeEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugTypeEnum_Next(This,celt,values,pceltFetched) \ +#define ICorDebugTypeEnum_Next(This,celt,values,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugTypeEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugTypeEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugType_INTERFACE_DEFINED__ @@ -17208,7 +17428,7 @@ EXTERN_C const IID IID_ICorDebugType; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugTypeVtbl { @@ -17269,46 +17489,46 @@ EXTERN_C const IID IID_ICorDebugType; #ifdef COBJMACROS -#define ICorDebugType_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugType_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugType_AddRef(This) \ +#define ICorDebugType_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugType_Release(This) \ +#define ICorDebugType_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugType_GetType(This,ty) \ +#define ICorDebugType_GetType(This,ty) \ ( (This)->lpVtbl -> GetType(This,ty) ) -#define ICorDebugType_GetClass(This,ppClass) \ +#define ICorDebugType_GetClass(This,ppClass) \ ( (This)->lpVtbl -> GetClass(This,ppClass) ) -#define ICorDebugType_EnumerateTypeParameters(This,ppTyParEnum) \ +#define ICorDebugType_EnumerateTypeParameters(This,ppTyParEnum) \ ( (This)->lpVtbl -> EnumerateTypeParameters(This,ppTyParEnum) ) -#define ICorDebugType_GetFirstTypeParameter(This,value) \ +#define ICorDebugType_GetFirstTypeParameter(This,value) \ ( (This)->lpVtbl -> GetFirstTypeParameter(This,value) ) -#define ICorDebugType_GetBase(This,pBase) \ +#define ICorDebugType_GetBase(This,pBase) \ ( (This)->lpVtbl -> GetBase(This,pBase) ) -#define ICorDebugType_GetStaticFieldValue(This,fieldDef,pFrame,ppValue) \ +#define ICorDebugType_GetStaticFieldValue(This,fieldDef,pFrame,ppValue) \ ( (This)->lpVtbl -> GetStaticFieldValue(This,fieldDef,pFrame,ppValue) ) -#define ICorDebugType_GetRank(This,pnRank) \ +#define ICorDebugType_GetRank(This,pnRank) \ ( (This)->lpVtbl -> GetRank(This,pnRank) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugType_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugType_INTERFACE_DEFINED__ */ #ifndef __ICorDebugType2_INTERFACE_DEFINED__ @@ -17332,7 +17552,7 @@ EXTERN_C const IID IID_ICorDebugType2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugType2Vtbl { @@ -17367,28 +17587,28 @@ EXTERN_C const IID IID_ICorDebugType2; #ifdef COBJMACROS -#define ICorDebugType2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugType2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugType2_AddRef(This) \ +#define ICorDebugType2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugType2_Release(This) \ +#define ICorDebugType2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugType2_GetTypeID(This,id) \ +#define ICorDebugType2_GetTypeID(This,id) \ ( (This)->lpVtbl -> GetTypeID(This,id) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugType2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugType2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugErrorInfoEnum_INTERFACE_DEFINED__ @@ -17414,7 +17634,7 @@ EXTERN_C const IID IID_ICorDebugErrorInfoEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugErrorInfoEnumVtbl { @@ -17466,41 +17686,41 @@ EXTERN_C const IID IID_ICorDebugErrorInfoEnum; #ifdef COBJMACROS -#define ICorDebugErrorInfoEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugErrorInfoEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugErrorInfoEnum_AddRef(This) \ +#define ICorDebugErrorInfoEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugErrorInfoEnum_Release(This) \ +#define ICorDebugErrorInfoEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugErrorInfoEnum_Skip(This,celt) \ +#define ICorDebugErrorInfoEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugErrorInfoEnum_Reset(This) \ +#define ICorDebugErrorInfoEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugErrorInfoEnum_Clone(This,ppEnum) \ +#define ICorDebugErrorInfoEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugErrorInfoEnum_GetCount(This,pcelt) \ +#define ICorDebugErrorInfoEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugErrorInfoEnum_Next(This,celt,errors,pceltFetched) \ +#define ICorDebugErrorInfoEnum_Next(This,celt,errors,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,errors,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugErrorInfoEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugErrorInfoEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugAppDomainEnum_INTERFACE_DEFINED__ @@ -17526,7 +17746,7 @@ EXTERN_C const IID IID_ICorDebugAppDomainEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugAppDomainEnumVtbl { @@ -17578,41 +17798,41 @@ EXTERN_C const IID IID_ICorDebugAppDomainEnum; #ifdef COBJMACROS -#define ICorDebugAppDomainEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugAppDomainEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugAppDomainEnum_AddRef(This) \ +#define ICorDebugAppDomainEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugAppDomainEnum_Release(This) \ +#define ICorDebugAppDomainEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugAppDomainEnum_Skip(This,celt) \ +#define ICorDebugAppDomainEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugAppDomainEnum_Reset(This) \ +#define ICorDebugAppDomainEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugAppDomainEnum_Clone(This,ppEnum) \ +#define ICorDebugAppDomainEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugAppDomainEnum_GetCount(This,pcelt) \ +#define ICorDebugAppDomainEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugAppDomainEnum_Next(This,celt,values,pceltFetched) \ +#define ICorDebugAppDomainEnum_Next(This,celt,values,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugAppDomainEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugAppDomainEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugAssemblyEnum_INTERFACE_DEFINED__ @@ -17638,7 +17858,7 @@ EXTERN_C const IID IID_ICorDebugAssemblyEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugAssemblyEnumVtbl { @@ -17690,41 +17910,41 @@ EXTERN_C const IID IID_ICorDebugAssemblyEnum; #ifdef COBJMACROS -#define ICorDebugAssemblyEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugAssemblyEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugAssemblyEnum_AddRef(This) \ +#define ICorDebugAssemblyEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugAssemblyEnum_Release(This) \ +#define ICorDebugAssemblyEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugAssemblyEnum_Skip(This,celt) \ +#define ICorDebugAssemblyEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugAssemblyEnum_Reset(This) \ +#define ICorDebugAssemblyEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugAssemblyEnum_Clone(This,ppEnum) \ +#define ICorDebugAssemblyEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugAssemblyEnum_GetCount(This,pcelt) \ +#define ICorDebugAssemblyEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugAssemblyEnum_Next(This,celt,values,pceltFetched) \ +#define ICorDebugAssemblyEnum_Next(This,celt,values,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugAssemblyEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugAssemblyEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugBlockingObjectEnum_INTERFACE_DEFINED__ @@ -17750,7 +17970,7 @@ EXTERN_C const IID IID_ICorDebugBlockingObjectEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugBlockingObjectEnumVtbl { @@ -17802,52 +18022,52 @@ EXTERN_C const IID IID_ICorDebugBlockingObjectEnum; #ifdef COBJMACROS -#define ICorDebugBlockingObjectEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugBlockingObjectEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugBlockingObjectEnum_AddRef(This) \ +#define ICorDebugBlockingObjectEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugBlockingObjectEnum_Release(This) \ +#define ICorDebugBlockingObjectEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugBlockingObjectEnum_Skip(This,celt) \ +#define ICorDebugBlockingObjectEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugBlockingObjectEnum_Reset(This) \ +#define ICorDebugBlockingObjectEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugBlockingObjectEnum_Clone(This,ppEnum) \ +#define ICorDebugBlockingObjectEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugBlockingObjectEnum_GetCount(This,pcelt) \ +#define ICorDebugBlockingObjectEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugBlockingObjectEnum_Next(This,celt,values,pceltFetched) \ +#define ICorDebugBlockingObjectEnum_Next(This,celt,values,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugBlockingObjectEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugBlockingObjectEnum_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0125 */ +/* interface __MIDL_itf_cordebug_0000_0127 */ /* [local] */ #pragma warning(push) #pragma warning(disable:28718) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0125_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0125_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0127_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0127_v0_0_s_ifspec; #ifndef __ICorDebugMDA_INTERFACE_DEFINED__ #define __ICorDebugMDA_INTERFACE_DEFINED__ @@ -17858,8 +18078,8 @@ extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0125_v0_0_s_ifspec; typedef enum CorDebugMDAFlags { - MDA_FLAG_SLIP = 0x2 - } CorDebugMDAFlags; + MDA_FLAG_SLIP = 0x2 + } CorDebugMDAFlags; EXTERN_C const IID IID_ICorDebugMDA; @@ -17894,7 +18114,7 @@ EXTERN_C const IID IID_ICorDebugMDA; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugMDAVtbl { @@ -17951,43 +18171,43 @@ EXTERN_C const IID IID_ICorDebugMDA; #ifdef COBJMACROS -#define ICorDebugMDA_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugMDA_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugMDA_AddRef(This) \ +#define ICorDebugMDA_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugMDA_Release(This) \ +#define ICorDebugMDA_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugMDA_GetName(This,cchName,pcchName,szName) \ +#define ICorDebugMDA_GetName(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) -#define ICorDebugMDA_GetDescription(This,cchName,pcchName,szName) \ +#define ICorDebugMDA_GetDescription(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetDescription(This,cchName,pcchName,szName) ) -#define ICorDebugMDA_GetXML(This,cchName,pcchName,szName) \ +#define ICorDebugMDA_GetXML(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetXML(This,cchName,pcchName,szName) ) -#define ICorDebugMDA_GetFlags(This,pFlags) \ +#define ICorDebugMDA_GetFlags(This,pFlags) \ ( (This)->lpVtbl -> GetFlags(This,pFlags) ) -#define ICorDebugMDA_GetOSThreadId(This,pOsTid) \ +#define ICorDebugMDA_GetOSThreadId(This,pOsTid) \ ( (This)->lpVtbl -> GetOSThreadId(This,pOsTid) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugMDA_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugMDA_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0126 */ +/* interface __MIDL_itf_cordebug_0000_0128 */ /* [local] */ #pragma warning(pop) @@ -17995,8 +18215,8 @@ EXTERN_C const IID IID_ICorDebugMDA; #pragma warning(disable:28718) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0126_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0126_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0128_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0128_v0_0_s_ifspec; #ifndef __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__ #define __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__ @@ -18030,7 +18250,7 @@ EXTERN_C const IID IID_ICorDebugEditAndContinueErrorInfo; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugEditAndContinueErrorInfoVtbl { @@ -18079,47 +18299,47 @@ EXTERN_C const IID IID_ICorDebugEditAndContinueErrorInfo; #ifdef COBJMACROS -#define ICorDebugEditAndContinueErrorInfo_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugEditAndContinueErrorInfo_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugEditAndContinueErrorInfo_AddRef(This) \ +#define ICorDebugEditAndContinueErrorInfo_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugEditAndContinueErrorInfo_Release(This) \ +#define ICorDebugEditAndContinueErrorInfo_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugEditAndContinueErrorInfo_GetModule(This,ppModule) \ +#define ICorDebugEditAndContinueErrorInfo_GetModule(This,ppModule) \ ( (This)->lpVtbl -> GetModule(This,ppModule) ) -#define ICorDebugEditAndContinueErrorInfo_GetToken(This,pToken) \ +#define ICorDebugEditAndContinueErrorInfo_GetToken(This,pToken) \ ( (This)->lpVtbl -> GetToken(This,pToken) ) -#define ICorDebugEditAndContinueErrorInfo_GetErrorCode(This,pHr) \ +#define ICorDebugEditAndContinueErrorInfo_GetErrorCode(This,pHr) \ ( (This)->lpVtbl -> GetErrorCode(This,pHr) ) -#define ICorDebugEditAndContinueErrorInfo_GetString(This,cchString,pcchString,szString) \ +#define ICorDebugEditAndContinueErrorInfo_GetString(This,cchString,pcchString,szString) \ ( (This)->lpVtbl -> GetString(This,cchString,pcchString,szString) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0127 */ +/* interface __MIDL_itf_cordebug_0000_0129 */ /* [local] */ #pragma warning(pop) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0127_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0127_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0129_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0129_v0_0_s_ifspec; #ifndef __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__ #define __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__ @@ -18163,7 +18383,7 @@ EXTERN_C const IID IID_ICorDebugEditAndContinueSnapshot; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugEditAndContinueSnapshotVtbl { @@ -18225,46 +18445,46 @@ EXTERN_C const IID IID_ICorDebugEditAndContinueSnapshot; #ifdef COBJMACROS -#define ICorDebugEditAndContinueSnapshot_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugEditAndContinueSnapshot_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugEditAndContinueSnapshot_AddRef(This) \ +#define ICorDebugEditAndContinueSnapshot_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugEditAndContinueSnapshot_Release(This) \ +#define ICorDebugEditAndContinueSnapshot_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugEditAndContinueSnapshot_CopyMetaData(This,pIStream,pMvid) \ +#define ICorDebugEditAndContinueSnapshot_CopyMetaData(This,pIStream,pMvid) \ ( (This)->lpVtbl -> CopyMetaData(This,pIStream,pMvid) ) -#define ICorDebugEditAndContinueSnapshot_GetMvid(This,pMvid) \ +#define ICorDebugEditAndContinueSnapshot_GetMvid(This,pMvid) \ ( (This)->lpVtbl -> GetMvid(This,pMvid) ) -#define ICorDebugEditAndContinueSnapshot_GetRoDataRVA(This,pRoDataRVA) \ +#define ICorDebugEditAndContinueSnapshot_GetRoDataRVA(This,pRoDataRVA) \ ( (This)->lpVtbl -> GetRoDataRVA(This,pRoDataRVA) ) -#define ICorDebugEditAndContinueSnapshot_GetRwDataRVA(This,pRwDataRVA) \ +#define ICorDebugEditAndContinueSnapshot_GetRwDataRVA(This,pRwDataRVA) \ ( (This)->lpVtbl -> GetRwDataRVA(This,pRwDataRVA) ) -#define ICorDebugEditAndContinueSnapshot_SetPEBytes(This,pIStream) \ +#define ICorDebugEditAndContinueSnapshot_SetPEBytes(This,pIStream) \ ( (This)->lpVtbl -> SetPEBytes(This,pIStream) ) -#define ICorDebugEditAndContinueSnapshot_SetILMap(This,mdFunction,cMapSize,map) \ +#define ICorDebugEditAndContinueSnapshot_SetILMap(This,mdFunction,cMapSize,map) \ ( (This)->lpVtbl -> SetILMap(This,mdFunction,cMapSize,map) ) -#define ICorDebugEditAndContinueSnapshot_SetPESymbolBytes(This,pIStream) \ +#define ICorDebugEditAndContinueSnapshot_SetPESymbolBytes(This,pIStream) \ ( (This)->lpVtbl -> SetPESymbolBytes(This,pIStream) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__ */ #ifndef __ICorDebugExceptionObjectCallStackEnum_INTERFACE_DEFINED__ @@ -18290,7 +18510,7 @@ EXTERN_C const IID IID_ICorDebugExceptionObjectCallStackEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugExceptionObjectCallStackEnumVtbl { @@ -18342,41 +18562,41 @@ EXTERN_C const IID IID_ICorDebugExceptionObjectCallStackEnum; #ifdef COBJMACROS -#define ICorDebugExceptionObjectCallStackEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugExceptionObjectCallStackEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugExceptionObjectCallStackEnum_AddRef(This) \ +#define ICorDebugExceptionObjectCallStackEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugExceptionObjectCallStackEnum_Release(This) \ +#define ICorDebugExceptionObjectCallStackEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugExceptionObjectCallStackEnum_Skip(This,celt) \ +#define ICorDebugExceptionObjectCallStackEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugExceptionObjectCallStackEnum_Reset(This) \ +#define ICorDebugExceptionObjectCallStackEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugExceptionObjectCallStackEnum_Clone(This,ppEnum) \ +#define ICorDebugExceptionObjectCallStackEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugExceptionObjectCallStackEnum_GetCount(This,pcelt) \ +#define ICorDebugExceptionObjectCallStackEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugExceptionObjectCallStackEnum_Next(This,celt,values,pceltFetched) \ +#define ICorDebugExceptionObjectCallStackEnum_Next(This,celt,values,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugExceptionObjectCallStackEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugExceptionObjectCallStackEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugExceptionObjectValue_INTERFACE_DEFINED__ @@ -18400,7 +18620,7 @@ EXTERN_C const IID IID_ICorDebugExceptionObjectValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugExceptionObjectValueVtbl { @@ -18435,28 +18655,28 @@ EXTERN_C const IID IID_ICorDebugExceptionObjectValue; #ifdef COBJMACROS -#define ICorDebugExceptionObjectValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugExceptionObjectValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugExceptionObjectValue_AddRef(This) \ +#define ICorDebugExceptionObjectValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugExceptionObjectValue_Release(This) \ +#define ICorDebugExceptionObjectValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugExceptionObjectValue_EnumerateExceptionCallStack(This,ppCallStackEnum) \ +#define ICorDebugExceptionObjectValue_EnumerateExceptionCallStack(This,ppCallStackEnum) \ ( (This)->lpVtbl -> EnumerateExceptionCallStack(This,ppCallStackEnum) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugExceptionObjectValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugExceptionObjectValue_INTERFACE_DEFINED__ */ @@ -18525,5 +18745,3 @@ EmbeddedCLRCorDebug; #endif #endif - - diff --git a/src/coreclr/src/pal/src/CMakeLists.txt b/src/coreclr/src/pal/src/CMakeLists.txt index 89c3ed934454..094f14cabf82 100644 --- a/src/coreclr/src/pal/src/CMakeLists.txt +++ b/src/coreclr/src/pal/src/CMakeLists.txt @@ -18,6 +18,8 @@ if(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND) add_subdirectory(libunwind) elseif(NOT CLR_CMAKE_TARGET_OSX) find_unwind_libs(UNWIND_LIBS) +else() + add_subdirectory(libunwind) endif(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND) include(configure.cmake) @@ -39,6 +41,10 @@ include_directories(include) # Compile options +if(CLR_CMAKE_USE_SYSTEM_LIBUNWIND) + add_definitions(-DFEATURE_USE_SYSTEM_LIBUNWIND) +endif(CLR_CMAKE_USE_SYSTEM_LIBUNWIND) + if(CLR_CMAKE_TARGET_OSX) add_definitions(-DTARGET_OSX) add_definitions(-DXSTATE_SUPPORTED) @@ -131,7 +137,6 @@ set(SOURCES debug/debug.cpp exception/seh.cpp exception/signal.cpp - exception/remote-unwind.cpp file/directory.cpp file/file.cpp file/filetime.cpp @@ -214,6 +219,12 @@ set(SOURCES thread/threadsusp.cpp ) +if(NOT CLR_CMAKE_TARGET_OSX) + list(APPEND SOURCES + exception/remote-unwind.cpp + ) +endif(NOT CLR_CMAKE_TARGET_OSX) + if(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND) set(LIBUNWIND_OBJECTS $) endif(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND) @@ -226,6 +237,29 @@ add_library(coreclrpal ${LIBUNWIND_OBJECTS} ) +# Build separate pal library for DAC (addition to regular pal library) +if(CLR_CMAKE_TARGET_OSX) + set(LIBUNWIND_DAC_OBJECTS $) + + add_library(coreclrpal_dac STATIC + exception/remote-unwind.cpp + ${LIBUNWIND_DAC_OBJECTS} + ) + + target_compile_definitions(coreclrpal_dac PUBLIC + "-D_XOPEN_SOURCE" + "-DUNW_REMOTE_ONLY" + ) + + target_include_directories(coreclrpal_dac PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/libunwind/include + ${CMAKE_CURRENT_SOURCE_DIR}/libunwind/include/tdep + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/libunwind/include + ${CMAKE_CURRENT_BINARY_DIR}/libunwind/include/tdep + ) +endif(CLR_CMAKE_TARGET_OSX) + # There is only one function exported in 'tracepointprovider.cpp' namely 'PAL_InitializeTracing', # which is guarded with '#if defined(__linux__)'. On macOS, Xcode issues the following warning: # @@ -309,6 +343,5 @@ if(FEATURE_EVENT_TRACE) add_subdirectory(eventprovider) endif(FEATURE_EVENT_TRACE) - # Install the static PAL library for VS _install (TARGETS coreclrpal DESTINATION lib) diff --git a/src/coreclr/src/pal/src/arch/arm64/context2.S b/src/coreclr/src/pal/src/arch/arm64/context2.S index f7d6d3fe059d..2ebce4b44004 100644 --- a/src/coreclr/src/pal/src/arch/arm64/context2.S +++ b/src/coreclr/src/pal/src/arch/arm64/context2.S @@ -13,7 +13,9 @@ // x0: Context* // LEAF_ENTRY CONTEXT_CaptureContext, _TEXT - sub sp, sp, #32 + PROLOG_STACK_ALLOC 32 + .cfi_adjust_cfa_offset 32 + // save x1, x2 and x3 on stack so we can use them as scratch stp x1, x2, [sp] str x3, [sp, 16] @@ -103,7 +105,7 @@ LOCAL_LABEL(Done_CONTEXT_INTEGER): LOCAL_LABEL(Done_CONTEXT_FLOATING_POINT): - add sp, sp, #32 + EPILOG_STACK_FREE 32 ret LEAF_END CONTEXT_CaptureContext, _TEXT @@ -111,7 +113,8 @@ LEAF_END CONTEXT_CaptureContext, _TEXT // x0: Context* LEAF_ENTRY RtlCaptureContext, _TEXT - sub sp, sp, #16 + PROLOG_STACK_ALLOC 16 + .cfi_adjust_cfa_offset 16 str x1, [sp] // same as above, clang doesn't like mov with #imm32 // keep this in sync if CONTEXT_FULL changes @@ -122,7 +125,7 @@ LEAF_ENTRY RtlCaptureContext, _TEXT orr w1, w1, #0x8 str w1, [x0, CONTEXT_ContextFlags] ldr x1, [sp] - add sp, sp, #16 + EPILOG_STACK_FREE 16 b C_FUNC(CONTEXT_CaptureContext) LEAF_END RtlCaptureContext, _TEXT diff --git a/src/coreclr/src/pal/src/exception/compact_unwind_encoding.h b/src/coreclr/src/pal/src/exception/compact_unwind_encoding.h new file mode 100644 index 000000000000..3e9b0546e973 --- /dev/null +++ b/src/coreclr/src/pal/src/exception/compact_unwind_encoding.h @@ -0,0 +1,474 @@ +//===------------------ mach-o/compact_unwind_encoding.h ------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +// +// Darwin's alternative to dwarf based unwind encodings. +// +//===----------------------------------------------------------------------===// + + +#ifndef __COMPACT_UNWIND_ENCODING__ +#define __COMPACT_UNWIND_ENCODING__ + +#include + +// +// Compilers can emit standard Dwarf FDEs in the __TEXT,__eh_frame section +// of object files. Or compilers can emit compact unwind information in +// the __LD,__compact_unwind section. +// +// When the linker creates a final linked image, it will create a +// __TEXT,__unwind_info section. This section is a small and fast way for the +// runtime to access unwind info for any given function. If the compiler +// emitted compact unwind info for the function, that compact unwind info will +// be encoded in the __TEXT,__unwind_info section. If the compiler emitted +// dwarf unwind info, the __TEXT,__unwind_info section will contain the offset +// of the FDE in the __TEXT,__eh_frame section in the final linked image. +// +// Note: Previously, the linker would transform some dwarf unwind infos into +// compact unwind info. But that is fragile and no longer done. + + +// +// The compact unwind endoding is a 32-bit value which encoded in an +// architecture specific way, which registers to restore from where, and how +// to unwind out of the function. +// +typedef uint32_t compact_unwind_encoding_t; + + +// architecture independent bits +enum { + UNWIND_IS_NOT_FUNCTION_START = 0x80000000, + UNWIND_HAS_LSDA = 0x40000000, + UNWIND_PERSONALITY_MASK = 0x30000000, +}; + + + + +// +// x86 +// +// 1-bit: start +// 1-bit: has lsda +// 2-bit: personality index +// +// 4-bits: 0=old, 1=ebp based, 2=stack-imm, 3=stack-ind, 4=dwarf +// ebp based: +// 15-bits (5*3-bits per reg) register permutation +// 8-bits for stack offset +// frameless: +// 8-bits stack size +// 3-bits stack adjust +// 3-bits register count +// 10-bits register permutation +// +enum { + UNWIND_X86_MODE_MASK = 0x0F000000, + UNWIND_X86_MODE_EBP_FRAME = 0x01000000, + UNWIND_X86_MODE_STACK_IMMD = 0x02000000, + UNWIND_X86_MODE_STACK_IND = 0x03000000, + UNWIND_X86_MODE_DWARF = 0x04000000, + + UNWIND_X86_EBP_FRAME_REGISTERS = 0x00007FFF, + UNWIND_X86_EBP_FRAME_OFFSET = 0x00FF0000, + + UNWIND_X86_FRAMELESS_STACK_SIZE = 0x00FF0000, + UNWIND_X86_FRAMELESS_STACK_ADJUST = 0x0000E000, + UNWIND_X86_FRAMELESS_STACK_REG_COUNT = 0x00001C00, + UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF, + + UNWIND_X86_DWARF_SECTION_OFFSET = 0x00FFFFFF, +}; + +enum { + UNWIND_X86_REG_NONE = 0, + UNWIND_X86_REG_EBX = 1, + UNWIND_X86_REG_ECX = 2, + UNWIND_X86_REG_EDX = 3, + UNWIND_X86_REG_EDI = 4, + UNWIND_X86_REG_ESI = 5, + UNWIND_X86_REG_EBP = 6, +}; + +// +// For x86 there are four modes for the compact unwind encoding: +// UNWIND_X86_MODE_EBP_FRAME: +// EBP based frame where EBP is push on stack immediately after return address, +// then ESP is moved to EBP. Thus, to unwind ESP is restored with the current +// EPB value, then EBP is restored by popping off the stack, and the return +// is done by popping the stack once more into the pc. +// All non-volatile registers that need to be restored must have been saved +// in a small range in the stack that starts EBP-4 to EBP-1020. The offset/4 +// is encoded in the UNWIND_X86_EBP_FRAME_OFFSET bits. The registers saved +// are encoded in the UNWIND_X86_EBP_FRAME_REGISTERS bits as five 3-bit entries. +// Each entry contains which register to restore. +// UNWIND_X86_MODE_STACK_IMMD: +// A "frameless" (EBP not used as frame pointer) function with a small +// constant stack size. To return, a constant (encoded in the compact +// unwind encoding) is added to the ESP. Then the return is done by +// popping the stack into the pc. +// All non-volatile registers that need to be restored must have been saved +// on the stack immediately after the return address. The stack_size/4 is +// encoded in the UNWIND_X86_FRAMELESS_STACK_SIZE (max stack size is 1024). +// The number of registers saved is encoded in UNWIND_X86_FRAMELESS_STACK_REG_COUNT. +// UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION constains which registers were +// saved and their order. +// UNWIND_X86_MODE_STACK_IND: +// A "frameless" (EBP not used as frame pointer) function large constant +// stack size. This case is like the previous, except the stack size is too +// large to encode in the compact unwind encoding. Instead it requires that +// the function contains "subl $nnnnnnnn,ESP" in its prolog. The compact +// encoding contains the offset to the nnnnnnnn value in the function in +// UNWIND_X86_FRAMELESS_STACK_SIZE. +// UNWIND_X86_MODE_DWARF: +// No compact unwind encoding is available. Instead the low 24-bits of the +// compact encoding is the offset of the dwarf FDE in the __eh_frame section. +// This mode is never used in object files. It is only generated by the +// linker in final linked images which have only dwarf unwind info for a +// function. +// +// The following is the algorithm used to create the permutation encoding used +// with frameless stacks. It is passed the number of registers to be saved and +// an array of the register numbers saved. +// +//uint32_t permute_encode(uint32_t registerCount, const uint32_t registers[6]) +//{ +// uint32_t renumregs[6]; +// for (int i=6-registerCount; i < 6; ++i) { +// int countless = 0; +// for (int j=6-registerCount; j < i; ++j) { +// if ( registers[j] < registers[i] ) +// ++countless; +// } +// renumregs[i] = registers[i] - countless -1; +// } +// uint32_t permutationEncoding = 0; +// switch ( registerCount ) { +// case 6: +// permutationEncoding |= (120*renumregs[0] + 24*renumregs[1] +// + 6*renumregs[2] + 2*renumregs[3] +// + renumregs[4]); +// break; +// case 5: +// permutationEncoding |= (120*renumregs[1] + 24*renumregs[2] +// + 6*renumregs[3] + 2*renumregs[4] +// + renumregs[5]); +// break; +// case 4: +// permutationEncoding |= (60*renumregs[2] + 12*renumregs[3] +// + 3*renumregs[4] + renumregs[5]); +// break; +// case 3: +// permutationEncoding |= (20*renumregs[3] + 4*renumregs[4] +// + renumregs[5]); +// break; +// case 2: +// permutationEncoding |= (5*renumregs[4] + renumregs[5]); +// break; +// case 1: +// permutationEncoding |= (renumregs[5]); +// break; +// } +// return permutationEncoding; +//} +// + + + + +// +// x86_64 +// +// 1-bit: start +// 1-bit: has lsda +// 2-bit: personality index +// +// 4-bits: 0=old, 1=rbp based, 2=stack-imm, 3=stack-ind, 4=dwarf +// rbp based: +// 15-bits (5*3-bits per reg) register permutation +// 8-bits for stack offset +// frameless: +// 8-bits stack size +// 3-bits stack adjust +// 3-bits register count +// 10-bits register permutation +// +enum { + UNWIND_X86_64_MODE_MASK = 0x0F000000, + UNWIND_X86_64_MODE_RBP_FRAME = 0x01000000, + UNWIND_X86_64_MODE_STACK_IMMD = 0x02000000, + UNWIND_X86_64_MODE_STACK_IND = 0x03000000, + UNWIND_X86_64_MODE_DWARF = 0x04000000, + + UNWIND_X86_64_RBP_FRAME_REGISTERS = 0x00007FFF, + UNWIND_X86_64_RBP_FRAME_OFFSET = 0x00FF0000, + + UNWIND_X86_64_FRAMELESS_STACK_SIZE = 0x00FF0000, + UNWIND_X86_64_FRAMELESS_STACK_ADJUST = 0x0000E000, + UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT = 0x00001C00, + UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF, + + UNWIND_X86_64_DWARF_SECTION_OFFSET = 0x00FFFFFF, +}; + +enum { + UNWIND_X86_64_REG_NONE = 0, + UNWIND_X86_64_REG_RBX = 1, + UNWIND_X86_64_REG_R12 = 2, + UNWIND_X86_64_REG_R13 = 3, + UNWIND_X86_64_REG_R14 = 4, + UNWIND_X86_64_REG_R15 = 5, + UNWIND_X86_64_REG_RBP = 6, +}; +// +// For x86_64 there are four modes for the compact unwind encoding: +// UNWIND_X86_64_MODE_RBP_FRAME: +// RBP based frame where RBP is push on stack immediately after return address, +// then RSP is moved to RBP. Thus, to unwind RSP is restored with the current +// EPB value, then RBP is restored by popping off the stack, and the return +// is done by popping the stack once more into the pc. +// All non-volatile registers that need to be restored must have been saved +// in a small range in the stack that starts RBP-8 to RBP-1020. The offset/4 +// is encoded in the UNWIND_X86_64_RBP_FRAME_OFFSET bits. The registers saved +// are encoded in the UNWIND_X86_64_RBP_FRAME_REGISTERS bits as five 3-bit entries. +// Each entry contains which register to restore. +// UNWIND_X86_64_MODE_STACK_IMMD: +// A "frameless" (RBP not used as frame pointer) function with a small +// constant stack size. To return, a constant (encoded in the compact +// unwind encoding) is added to the RSP. Then the return is done by +// popping the stack into the pc. +// All non-volatile registers that need to be restored must have been saved +// on the stack immediately after the return address. The stack_size/4 is +// encoded in the UNWIND_X86_64_FRAMELESS_STACK_SIZE (max stack size is 1024). +// The number of registers saved is encoded in UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT. +// UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION constains which registers were +// saved and their order. +// UNWIND_X86_64_MODE_STACK_IND: +// A "frameless" (RBP not used as frame pointer) function large constant +// stack size. This case is like the previous, except the stack size is too +// large to encode in the compact unwind encoding. Instead it requires that +// the function contains "subq $nnnnnnnn,RSP" in its prolog. The compact +// encoding contains the offset to the nnnnnnnn value in the function in +// UNWIND_X86_64_FRAMELESS_STACK_SIZE. +// UNWIND_X86_64_MODE_DWARF: +// No compact unwind encoding is available. Instead the low 24-bits of the +// compact encoding is the offset of the dwarf FDE in the __eh_frame section. +// This mode is never used in object files. It is only generated by the +// linker in final linked images which have only dwarf unwind info for a +// function. +// + + +// ARM64 +// +// 1-bit: start +// 1-bit: has lsda +// 2-bit: personality index +// +// 4-bits: 4=frame-based, 3=dwarf, 2=frameless +// frameless: +// 12-bits of stack size +// frame-based: +// 4-bits D reg pairs saved +// 5-bits X reg pairs saved +// dwarf: +// 24-bits offset of dwarf FDE in __eh_frame section +// +enum { + UNWIND_ARM64_MODE_MASK = 0x0F000000, + UNWIND_ARM64_MODE_FRAMELESS = 0x02000000, + UNWIND_ARM64_MODE_DWARF = 0x03000000, + UNWIND_ARM64_MODE_FRAME = 0x04000000, + + UNWIND_ARM64_FRAME_X19_X20_PAIR = 0x00000001, + UNWIND_ARM64_FRAME_X21_X22_PAIR = 0x00000002, + UNWIND_ARM64_FRAME_X23_X24_PAIR = 0x00000004, + UNWIND_ARM64_FRAME_X25_X26_PAIR = 0x00000008, + UNWIND_ARM64_FRAME_X27_X28_PAIR = 0x00000010, + UNWIND_ARM64_FRAME_D8_D9_PAIR = 0x00000100, + UNWIND_ARM64_FRAME_D10_D11_PAIR = 0x00000200, + UNWIND_ARM64_FRAME_D12_D13_PAIR = 0x00000400, + UNWIND_ARM64_FRAME_D14_D15_PAIR = 0x00000800, + + UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK = 0x00FFF000, + UNWIND_ARM64_DWARF_SECTION_OFFSET = 0x00FFFFFF, +}; +// For arm64 there are three modes for the compact unwind encoding: +// UNWIND_ARM64_MODE_FRAME: +// This is a standard arm64 prolog where FP/LR are immediately pushed on the +// stack, then SP is copied to FP. If there are any non-volatile registers +// saved, then are copied into the stack frame in pairs in a contiguous +// range right below the saved FP/LR pair. Any subset of the five X pairs +// and four D pairs can be saved, but the memory layout must be in register +// number order. +// UNWIND_ARM64_MODE_FRAMELESS: +// A "frameless" leaf function, where FP/LR are not saved. The return address +// remains in LR throughout the function. If any non-volatile registers +// are saved, they must be pushed onto the stack before any stack space is +// allocated for local variables. The stack sized (including any saved +// non-volatile registers) divided by 16 is encoded in the bits +// UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK. +// UNWIND_ARM64_MODE_DWARF: +// No compact unwind encoding is available. Instead the low 24-bits of the +// compact encoding is the offset of the dwarf FDE in the __eh_frame section. +// This mode is never used in object files. It is only generated by the +// linker in final linked images which have only dwarf unwind info for a +// function. +// + + + + + +//////////////////////////////////////////////////////////////////////////////// +// +// Relocatable Object Files: __LD,__compact_unwind +// +//////////////////////////////////////////////////////////////////////////////// + +// +// A compiler can generated compact unwind information for a function by adding +// a "row" to the __LD,__compact_unwind section. This section has the +// S_ATTR_DEBUG bit set, so the section will be ignored by older linkers. +// It is removed by the new linker, so never ends up in final executables. +// This section is a table, initially with one row per function (that needs +// unwind info). The table columns and some conceptual entries are: +// +// range-start pointer to start of function/range +// range-length +// compact-unwind-encoding 32-bit encoding +// personality-function or zero if no personality function +// lsda or zero if no LSDA data +// +// The length and encoding fields are 32-bits. The other are all pointer sized. +// +// In x86_64 assembly, these entry would look like: +// +// .section __LD,__compact_unwind,regular,debug +// +// #compact unwind for _foo +// .quad _foo +// .set L1,LfooEnd-_foo +// .long L1 +// .long 0x01010001 +// .quad 0 +// .quad 0 +// +// #compact unwind for _bar +// .quad _bar +// .set L2,LbarEnd-_bar +// .long L2 +// .long 0x01020011 +// .quad __gxx_personality +// .quad except_tab1 +// +// +// Notes: There is no need for any labels in the the __compact_unwind section. +// The use of the .set directive is to force the evaluation of the +// range-length at assembly time, instead of generating relocations. +// +// To support future compiler optimizations where which non-volatile registers +// are saved changes within a function (e.g. delay saving non-volatiles until +// necessary), there can by multiple lines in the __compact_unwind table for one +// function, each with a different (non-overlapping) range and each with +// different compact unwind encodings that correspond to the non-volatiles +// saved at that range of the function. +// +// If a particular function is so wacky that there is no compact unwind way +// to encode it, then the compiler can emit traditional dwarf unwind info. +// The runtime will use which ever is available. +// +// Runtime support for compact unwind encodings are only available on 10.6 +// and later. So, the compiler should not generate it when targeting pre-10.6. + + + + +//////////////////////////////////////////////////////////////////////////////// +// +// Final Linked Images: __TEXT,__unwind_info +// +//////////////////////////////////////////////////////////////////////////////// + +// +// The __TEXT,__unwind_info section is laid out for an efficient two level lookup. +// The header of the section contains a coarse index that maps function address +// to the page (4096 byte block) containing the unwind info for that function. +// + +#define UNWIND_SECTION_VERSION 1 +struct unwind_info_section_header +{ + uint32_t version; // UNWIND_SECTION_VERSION + uint32_t commonEncodingsArraySectionOffset; + uint32_t commonEncodingsArrayCount; + uint32_t personalityArraySectionOffset; + uint32_t personalityArrayCount; + uint32_t indexSectionOffset; + uint32_t indexCount; + // compact_unwind_encoding_t[] + // uintptr_t personalities[] + // unwind_info_section_header_index_entry[] + // unwind_info_section_header_lsda_index_entry[] +}; + +struct unwind_info_section_header_index_entry +{ + uint32_t functionOffset; + uint32_t secondLevelPagesSectionOffset; // section offset to start of regular or compress page + uint32_t lsdaIndexArraySectionOffset; // section offset to start of lsda_index array for this range +}; + +struct unwind_info_section_header_lsda_index_entry +{ + uint32_t functionOffset; + uint32_t lsdaOffset; +}; + +// +// There are two kinds of second level index pages: regular and compressed. +// A compressed page can hold up to 1021 entries, but it cannot be used +// if too many different encoding types are used. The regular page holds +// 511 entries. +// + +struct unwind_info_regular_second_level_entry +{ + uint32_t functionOffset; + compact_unwind_encoding_t encoding; +}; + +#define UNWIND_SECOND_LEVEL_REGULAR 2 +struct unwind_info_regular_second_level_page_header +{ + uint32_t kind; // UNWIND_SECOND_LEVEL_REGULAR + uint16_t entryPageOffset; + uint16_t entryCount; + // entry array +}; + +#define UNWIND_SECOND_LEVEL_COMPRESSED 3 +struct unwind_info_compressed_second_level_page_header +{ + uint32_t kind; // UNWIND_SECOND_LEVEL_COMPRESSED + uint16_t entryPageOffset; + uint16_t entryCount; + uint16_t encodingsPageOffset; + uint16_t encodingsCount; + // 32-bit entry array + // encodings array +}; + +#define UNWIND_INFO_COMPRESSED_ENTRY_FUNC_OFFSET(entry) (entry & 0x00FFFFFF) +#define UNWIND_INFO_COMPRESSED_ENTRY_ENCODING_INDEX(entry) ((entry >> 24) & 0xFF) + + + +#endif + diff --git a/src/coreclr/src/pal/src/exception/remote-unwind.cpp b/src/coreclr/src/pal/src/exception/remote-unwind.cpp index 7adfb57803bc..91f819370f40 100644 --- a/src/coreclr/src/pal/src/exception/remote-unwind.cpp +++ b/src/coreclr/src/pal/src/exception/remote-unwind.cpp @@ -39,6 +39,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --*/ #ifdef HOST_UNIX + #include "config.h" #include "pal/palinternal.h" #include "pal/dbgmsg.h" @@ -50,6 +51,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include +#ifdef __APPLE__ +#include +#include +#include +#include +#include "compact_unwind_encoding.h" +#endif + // Sub-headers included from the libunwind.h contain an empty struct // and clang issues a warning. Until the libunwind is fixed, disable // the warning. @@ -64,6 +73,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. SET_DEFAULT_DEBUG_CHANNEL(EXCEPT); +#define TRACE_VERBOSE + #else // HOST_UNIX #include @@ -83,7 +94,6 @@ typedef BOOL(*UnwindReadMemoryCallback)(PVOID address, PVOID buffer, SIZE_T size #undef ERROR #define ERROR(x, ...) - #ifdef TARGET_64BIT #define ElfW(foo) Elf64_ ## foo #else // TARGET_64BIT @@ -94,7 +104,7 @@ typedef BOOL(*UnwindReadMemoryCallback)(PVOID address, PVOID buffer, SIZE_T size #endif // HOST_UNIX -#if defined(HAVE_UNW_GET_ACCESSORS) +#ifdef HAVE_UNW_GET_ACCESSORS #ifdef HOST_UNIX #include @@ -125,7 +135,7 @@ typedef BOOL(*UnwindReadMemoryCallback)(PVOID address, PVOID buffer, SIZE_T size #define Nhdr ElfW(Nhdr) #define Dyn ElfW(Dyn) - +#ifndef FEATURE_USE_SYSTEM_LIBUNWIND extern "C" int _OOP_find_proc_info( unw_word_t start_ip, @@ -139,11 +149,11 @@ _OOP_find_proc_info( unw_proc_info_t *pi, int need_unwind_info, void *arg); +#endif // FEATURE_USE_SYSTEM_LIBUNWIND + +#endif // HAVE_UNW_GET_ACCESSORS -extern void GetContextPointers( - unw_cursor_t *cursor, - unw_context_t *unwContext, - KNONVOLATILE_CONTEXT_POINTERS *contextPointers); +#if defined(__APPLE__) || defined(HAVE_UNW_GET_ACCESSORS) typedef struct _libunwindInfo { @@ -152,6 +162,1293 @@ typedef struct _libunwindInfo UnwindReadMemoryCallback ReadMemory; } libunwindInfo; +#if defined(__APPLE__) || defined(FEATURE_USE_SYSTEM_LIBUNWIND) + +#define EXTRACT_BITS(value, mask) ((value >> __builtin_ctz(mask)) & (((1 << __builtin_popcount(mask))) - 1)) + +#define DW_EH_VERSION 1 + +// DWARF Pointer-Encoding (PEs). +// +// Pointer-Encodings were invented for the GCC exception-handling +// support for C++, but they represent a rather generic way of +// describing the format in which an address/pointer is stored. +// The Pointer-Encoding format is partially documented in Linux Base +// Spec v1.3 (http://www.linuxbase.org/spec/). + +// These defines and struct (dwarf_cie_info) were copied from libunwind's dwarf.h + +#define DW_EH_PE_FORMAT_MASK 0x0f // format of the encoded value +#define DW_EH_PE_APPL_MASK 0x70 // how the value is to be applied +#define DW_EH_PE_indirect 0x80 // Flag bit. If set, the resulting pointer is the + // address of the word that contains the final address +// Pointer-encoding formats +#define DW_EH_PE_omit 0xff +#define DW_EH_PE_ptr 0x00 // pointer-sized unsigned value +#define DW_EH_PE_uleb128 0x01 // unsigned LE base-128 value +#define DW_EH_PE_udata2 0x02 // unsigned 16-bit value +#define DW_EH_PE_udata4 0x03 // unsigned 32-bit value +#define DW_EH_PE_udata8 0x04 // unsigned 64-bit value +#define DW_EH_PE_sleb128 0x09 // signed LE base-128 value +#define DW_EH_PE_sdata2 0x0a // signed 16-bit value +#define DW_EH_PE_sdata4 0x0b // signed 32-bit value +#define DW_EH_PE_sdata8 0x0c // signed 64-bit value + +// Pointer-encoding application +#define DW_EH_PE_absptr 0x00 // absolute value +#define DW_EH_PE_pcrel 0x10 // rel. to addr. of encoded value +#define DW_EH_PE_textrel 0x20 // text-relative (GCC-specific???) +#define DW_EH_PE_datarel 0x30 // data-relative + +// The following are not documented by LSB v1.3, yet they are used by +// GCC, presumably they aren't documented by LSB since they aren't +// used on Linux +#define DW_EH_PE_funcrel 0x40 // start-of-procedure-relative +#define DW_EH_PE_aligned 0x50 // aligned pointer + +#define DWARF_CIE_VERSION 3 // GCC emits version 1??? + +// DWARF frame header +typedef struct __attribute__((packed)) _eh_frame_hdr +{ + unsigned char version; + unsigned char eh_frame_ptr_enc; + unsigned char fde_count_enc; + unsigned char table_enc; + // The rest of the header is variable-length and consists of the + // following members: + // + // encoded_t eh_frame_ptr; + // encoded_t fde_count; + // struct + // { + // encoded_t start_ip; // first address covered by this FDE + // encoded_t fde_offset; // offset of the FDE + // } binary_search_table[fde_count]; +} eh_frame_hdr; + +// "DW_EH_PE_datarel|DW_EH_PE_sdata4" encoded fde table entry +typedef struct table_entry +{ + int32_t start_ip; + int32_t fde_offset; +} table_entry_t; + +// DWARF unwind info +typedef struct dwarf_cie_info +{ + unw_word_t cie_instr_start; // start addr. of CIE "initial_instructions" + unw_word_t cie_instr_end; // end addr. of CIE "initial_instructions" + unw_word_t fde_instr_start; // start addr. of FDE "instructions" + unw_word_t fde_instr_end; // end addr. of FDE "instructions" + unw_word_t code_align; // code-alignment factor + unw_word_t data_align; // data-alignment factor + unw_word_t ret_addr_column; // column of return-address register + unw_word_t handler; // address of personality-routine + uint16_t abi; + uint16_t tag; + uint8_t fde_encoding; + uint8_t lsda_encoding; + unsigned int sized_augmentation : 1; + unsigned int have_abi_marker : 1; + unsigned int signal_frame : 1; +} dwarf_cie_info_t; + +static bool +ReadValue8( + const libunwindInfo* info, + unw_word_t* addr, + uint8_t* valp) +{ + uint8_t value; + if (!info->ReadMemory((PVOID)*addr, &value, sizeof(value))) { + return false; + } + *addr += sizeof(value); + *valp = value; + return true; +} + +static bool +ReadValue16( + const libunwindInfo* info, + unw_word_t* addr, + uint16_t* valp) +{ + uint16_t value; + if (!info->ReadMemory((PVOID)*addr, &value, sizeof(value))) { + return false; + } + *addr += sizeof(value); + *valp = VAL16(value); + return true; +} + +static bool +ReadValue32( + const libunwindInfo* info, + unw_word_t* addr, + uint32_t* valp) +{ + uint32_t value; + if (!info->ReadMemory((PVOID)*addr, &value, sizeof(value))) { + return false; + } + *addr += sizeof(value); + *valp = VAL32(value); + return true; +} + +static bool +ReadValue64( + const libunwindInfo* info, + unw_word_t* addr, + uint64_t* valp) +{ + uint64_t value; + if (!info->ReadMemory((PVOID)*addr, &value, sizeof(value))) { + return false; + } + *addr += sizeof(value); + *valp = VAL64(value); + return true; +} + +static bool +ReadPointer( + const libunwindInfo* info, + unw_word_t* addr, + unw_word_t* valp) +{ +#ifdef TARGET_64BIT + uint64_t val64; + if (ReadValue64(info, addr, &val64)) { + *valp = val64; + return true; + } +#else + uint32_t val32; + if (ReadValue32(info, addr, &val32)) { + *valp = val32; + return true; + } +#endif + return false; +} + +// Read a unsigned "little-endian base 128" value. See Chapter 7.6 of DWARF spec v3. +static bool +ReadULEB128( + const libunwindInfo* info, + unw_word_t* addr, + unw_word_t* valp) +{ + unw_word_t value = 0; + unsigned char byte; + int shift = 0; + + do + { + if (!ReadValue8(info, addr, &byte)) { + return false; + } + value |= ((unw_word_t)byte & 0x7f) << shift; + shift += 7; + } while (byte & 0x80); + + *valp = value; + return true; +} + +// Read a signed "little-endian base 128" value. See Chapter 7.6 of DWARF spec v3. +static bool +ReadSLEB128( + const libunwindInfo* info, + unw_word_t* addr, + unw_word_t* valp) +{ + unw_word_t value = 0; + unsigned char byte; + int shift = 0; + + do + { + if (!ReadValue8(info, addr, &byte)) { + return false; + } + value |= ((unw_word_t)byte & 0x7f) << shift; + shift += 7; + } while (byte & 0x80); + + if (((size_t)shift < (8 * sizeof(unw_word_t))) && ((byte & 0x40) != 0)) { + value |= ((unw_word_t)-1) << shift; + } + + *valp = value; + return true; +} + +static bool +ReadEncodedPointer( + const libunwindInfo* info, + unw_word_t* addr, + unsigned char encoding, + unw_word_t funcRel, + unw_word_t* valp) +{ + unw_word_t initialAddr = *addr; + uint16_t value16; + uint32_t value32; + uint64_t value64; + unw_word_t value; + + if (encoding == DW_EH_PE_omit) + { + *valp = 0; + return true; + } + else if (encoding == DW_EH_PE_aligned) + { + int size = sizeof(unw_word_t); + *addr = (initialAddr + size - 1) & -size; + return ReadPointer(info, addr, valp); + } + + switch (encoding & DW_EH_PE_FORMAT_MASK) + { + case DW_EH_PE_ptr: + if (!ReadPointer(info, addr, &value)) { + return false; + } + break; + + case DW_EH_PE_uleb128: + if (!ReadULEB128(info, addr, &value)) { + return false; + } + break; + + case DW_EH_PE_sleb128: + if (!ReadSLEB128(info, addr, &value)) { + return false; + } + break; + + case DW_EH_PE_udata2: + if (!ReadValue16(info, addr, &value16)) { + return false; + } + value = value16; + break; + + case DW_EH_PE_udata4: + if (!ReadValue32(info, addr, &value32)) { + return false; + } + value = value32; + break; + + case DW_EH_PE_udata8: + if (!ReadValue64(info, addr, &value64)) { + return false; + } + value = value64; + break; + + case DW_EH_PE_sdata2: + if (!ReadValue16(info, addr, &value16)) { + return false; + } + value = (int16_t)value16; + break; + + case DW_EH_PE_sdata4: + if (!ReadValue32(info, addr, &value32)) { + return false; + } + value = (int32_t)value32; + break; + + case DW_EH_PE_sdata8: + if (!ReadValue64(info, addr, &value64)) { + return false; + } + value = (int64_t)value64; + break; + + default: + ASSERT("ReadEncodedPointer: invalid encoding format %x\n", encoding); + return false; + } + + // 0 is a special value and always absolute + if (value == 0) { + *valp = 0; + return true; + } + + switch (encoding & DW_EH_PE_APPL_MASK) + { + case DW_EH_PE_absptr: + break; + + case DW_EH_PE_pcrel: + value += initialAddr; + break; + + case DW_EH_PE_funcrel: + _ASSERTE(funcRel != UINTPTR_MAX); + value += funcRel; + break; + + case DW_EH_PE_textrel: + case DW_EH_PE_datarel: + default: + ASSERT("ReadEncodedPointer: invalid application type %x\n", encoding); + return false; + } + + if (encoding & DW_EH_PE_indirect) + { + unw_word_t indirect_addr = value; + if (!ReadPointer(info, &indirect_addr, &value)) { + return false; + } + } + + *valp = value; + return true; +} + +template +static bool +BinarySearchEntries( + const libunwindInfo* info, + int32_t ip, + unw_word_t tableAddr, + size_t tableCount, + T* entry, + T* entryNext, + bool compressed, + bool* found) +{ + size_t low, high, mid; + unw_word_t addr; + int32_t functionOffset; + + *found = false; + + static_assert_no_msg(sizeof(T) >= sizeof(uint32_t)); + +#ifdef __APPLE__ + static_assert_no_msg(offsetof(unwind_info_section_header_index_entry, functionOffset) == 0); + static_assert_no_msg(sizeof(unwind_info_section_header_index_entry::functionOffset) == sizeof(uint32_t)); + + static_assert_no_msg(offsetof(unwind_info_regular_second_level_entry, functionOffset) == 0); + static_assert_no_msg(sizeof(unwind_info_regular_second_level_entry::functionOffset) == sizeof(uint32_t)); + + static_assert_no_msg(offsetof(unwind_info_section_header_lsda_index_entry, functionOffset) == 0); + static_assert_no_msg(sizeof(unwind_info_section_header_lsda_index_entry::functionOffset) == sizeof(uint32_t)); +#endif // __APPLE__ + + // Do a binary search on table + for (low = 0, high = tableCount; low < high;) + { + mid = (low + high) / 2; + + // Assumes that the first uint32_t in T is the offset to compare + addr = tableAddr + (mid * sizeof(T)); + if (!ReadValue32(info, &addr, (uint32_t*)&functionOffset)) { + return false; + } +#ifdef __APPLE__ + if (compressed) { + functionOffset = UNWIND_INFO_COMPRESSED_ENTRY_FUNC_OFFSET(functionOffset); + } +#endif // __APPLE__ + if (ip < functionOffset) { + high = mid; + } + else { + low = mid + 1; + } + } + + if (high > 0) + { + *found = true; + + addr = tableAddr + (high * sizeof(T)); + if (!info->ReadMemory((PVOID)addr, entryNext, sizeof(T))) { + return false; + } + } + else + { + // When the ip isn't found return the last entry in the table + high = tableCount; + + // No next entry + memset(entryNext, 0, sizeof(T)); + } + + addr = tableAddr + ((high - 1) * sizeof(T)); + if (!info->ReadMemory((PVOID)addr, entry, sizeof(T))) { + return false; + } + + return true; +} + +static bool +ParseCie( + const libunwindInfo* info, + unw_word_t addr, + dwarf_cie_info_t* dci) +{ + uint8_t ch, version, fdeEncoding, handlerEncoding; + unw_word_t cieLength, cieEndAddr; + uint32_t value32; + uint64_t value64; + + memset(dci, 0, sizeof(dwarf_cie_info_t)); + + // Pick appropriate default for FDE-encoding. DWARF spec says + // start-IP (initial_location) and the code-size (address_range) are + // "address-unit sized constants". The `R' augmentation can be used + // to override this, but by default, we pick an address-sized unit + // for fde_encoding. +#if TARGET_64BIT + fdeEncoding = DW_EH_PE_udata8; +#else + fdeEncoding = DW_EH_PE_udata4; +#endif + + dci->lsda_encoding = DW_EH_PE_omit; + dci->handler = 0; + + if (!ReadValue32(info, &addr, &value32)) { + return false; + } + + if (value32 != 0xffffffff) + { + // The CIE is in the 32-bit DWARF format + uint32_t cieId; + + // DWARF says CIE id should be 0xffffffff, but in .eh_frame, it's 0 + const uint32_t expectedId = 0; + + cieLength = value32; + cieEndAddr = addr + cieLength; + + if (!ReadValue32(info, &addr, &cieId)) { + return false; + } + if (cieId != expectedId) { + ASSERT("ParseCie: unexpected cie id %x\n", cieId); + return false; + } + } + else + { + // The CIE is in the 64-bit DWARF format + uint64_t cieId; + + // DWARF says CIE id should be 0xffffffffffffffff, but in .eh_frame, it's 0 + const uint64_t expectedId = 0; + + if (!ReadValue64(info, &addr, &value64)) { + return false; + } + cieLength = value64; + cieEndAddr = addr + cieLength; + + if (!ReadValue64(info, &addr, &cieId)) { + return false; + } + if (cieId != expectedId) { + ASSERT("ParseCie: unexpected cie id %lx\n", cieId); + return false; + } + } + dci->cie_instr_end = cieEndAddr; + + if (!ReadValue8(info, &addr, &version)) { + return false; + } + if (version != 1 && version != DWARF_CIE_VERSION) { + ASSERT("ParseCie: invalid cie version %x\n", version); + return false; + } + + // Read the augmentation string + uint8_t augmentationString[8]; + memset(augmentationString, 0, sizeof(augmentationString)); + + for (size_t i = 0; i < sizeof(augmentationString); i++) + { + if (!ReadValue8(info, &addr, &ch)) { + return false; + } + if (ch == 0) { + break; + } + augmentationString[i] = ch; + } + + // Read the code and data alignment + if (!ReadULEB128(info, &addr, &dci->code_align)) { + return false; + } + if (!ReadSLEB128(info, &addr, &dci->data_align)) { + return false; + } + + // Read the return-address column either as a u8 or as a uleb128 + if (version == 1) + { + if (!ReadValue8(info, &addr, &ch)) { + return false; + } + dci->ret_addr_column = ch; + } + else + { + if (!ReadULEB128(info, &addr, &dci->ret_addr_column)) { + return false; + } + } + + // Parse the augmentation string + for (size_t i = 0; i < sizeof(augmentationString); i++) + { + bool done = false; + unw_word_t augmentationSize; + + switch (augmentationString[i]) + { + case '\0': + done = true; + break; + + case 'z': + dci->sized_augmentation = 1; + if (!ReadULEB128(info, &addr, &augmentationSize)) { + return false; + } + break; + + case 'L': + // read the LSDA pointer-encoding format + if (!ReadValue8(info, &addr, &ch)) { + return false; + } + dci->lsda_encoding = ch; + break; + + case 'R': + // read the FDE pointer-encoding format + if (!ReadValue8(info, &addr, &fdeEncoding)) { + return false; + } + break; + + case 'P': + // read the personality-routine pointer-encoding format + if (!ReadValue8(info, &addr, &handlerEncoding)) { + return false; + } + if (!ReadEncodedPointer(info, &addr, handlerEncoding, UINTPTR_MAX, &dci->handler)) { + return false; + } + break; + + case 'S': + // This is a signal frame + dci->signal_frame = 1; + + // Temporarily set it to one so dwarf_parse_fde() knows that + // it should fetch the actual ABI/TAG pair from the FDE. + dci->have_abi_marker = 1; + break; + + default: + if (dci->sized_augmentation) { + // If we have the size of the augmentation body, we can skip + // over the parts that we don't understand, so we're OK + done = true; + break; + } + ASSERT("ParseCie: unexpected argumentation string '%s'\n", augmentationString[i]); + return false; + } + + if (done) { + break; + } + } + dci->fde_encoding = fdeEncoding; + dci->cie_instr_start = addr; + return true; +} + +static bool +ExtractFde( + const libunwindInfo* info, + unw_word_t* addr, + unw_word_t* fdeEndAddr, + unw_word_t* ipStart, + unw_word_t* ipEnd, + dwarf_cie_info_t* dci) +{ + unw_word_t cieOffsetAddr, cieAddr; + uint32_t value32; + uint64_t value64; + + *fdeEndAddr = 0; + *ipStart = UINT64_MAX; + *ipEnd = 0; + + if (!ReadValue32(info, addr, &value32)) { + return false; + } + if (value32 != 0xffffffff) + { + int32_t cieOffset = 0; + + // In some configurations, an FDE with a 0 length indicates the end of the FDE-table + if (value32 == 0) { + return false; + } + // the FDE is in the 32-bit DWARF format */ + *fdeEndAddr = *addr + value32; + cieOffsetAddr = *addr; + + if (!ReadValue32(info, addr, (uint32_t*)&cieOffset)) { + return false; + } + // Ignore CIEs (happens during linear search) + if (cieOffset == 0) { + return true; + } + // DWARF says that the CIE_pointer in the FDE is a .debug_frame-relative offset, + // but the GCC-generated .eh_frame sections instead store a "pcrelative" offset, + // which is just as fine as it's self-contained + cieAddr = cieOffsetAddr - cieOffset; + } + else + { + int64_t cieOffset = 0; + + // the FDE is in the 64-bit DWARF format */ + if (!ReadValue64(info, addr, (uint64_t*)&value64)) { + return false; + } + *fdeEndAddr = *addr + value64; + cieOffsetAddr = *addr; + + if (!ReadValue64(info, addr, (uint64_t*)&cieOffset)) { + return false; + } + // Ignore CIEs (happens during linear search) + if (cieOffset == 0) { + return true; + } + // DWARF says that the CIE_pointer in the FDE is a .debug_frame-relative offset, + // but the GCC-generated .eh_frame sections instead store a "pcrelative" offset, + // which is just as fine as it's self-contained + cieAddr = (unw_word_t)((uint64_t)cieOffsetAddr - cieOffset); + } + + if (!ParseCie(info, cieAddr, dci)) { + return false; + } + + unw_word_t start, range; + if (!ReadEncodedPointer(info, addr, dci->fde_encoding, UINTPTR_MAX, &start)) { + return false; + } + + // IP-range has same encoding as FDE pointers, except that it's always an absolute value + uint8_t ipRangeEncoding = dci->fde_encoding & DW_EH_PE_FORMAT_MASK; + if (!ReadEncodedPointer(info, addr, ipRangeEncoding, UINTPTR_MAX, &range)) { + return false; + } + + *ipStart = start; + *ipEnd = start + range; + + return true; +} + +static bool +ExtractProcInfoFromFde( + const libunwindInfo* info, + unw_word_t* addrp, + unw_proc_info_t *pip, + int need_unwind_info) +{ + unw_word_t addr = *addrp; + + unw_word_t ipStart, ipEnd; + unw_word_t fdeEndAddr; + dwarf_cie_info_t dci; + if (!ExtractFde(info, &addr, &fdeEndAddr, &ipStart, &ipEnd, &dci)) { + return false; + } + *addrp = fdeEndAddr; + + pip->start_ip = ipStart; + pip->end_ip = ipEnd; + pip->handler = dci.handler; + + unw_word_t augmentationSize, augmentationEndAddr; + if (dci.sized_augmentation) { + if (!ReadULEB128(info, &addr, &augmentationSize)) { + return false; + } + augmentationEndAddr = addr + augmentationSize; + } + + // Read language specific data area address + if (!ReadEncodedPointer(info, &addr, dci.lsda_encoding, pip->start_ip, &pip->lsda)) { + return false; + } + + // Now fill out the proc info if requested + if (need_unwind_info) + { + if (dci.have_abi_marker) + { + if (!ReadValue16(info, &addr, &dci.abi)) { + return false; + } + if (!ReadValue16(info, &addr, &dci.tag)) { + return false; + } + } + if (dci.sized_augmentation) { + dci.fde_instr_start = augmentationEndAddr; + } + else { + dci.fde_instr_start = addr; + } + dci.fde_instr_end = fdeEndAddr; + + pip->format = UNW_INFO_FORMAT_TABLE; + pip->unwind_info_size = sizeof(dci); + pip->unwind_info = malloc(sizeof(dci)); + if (pip->unwind_info == nullptr) { + return -UNW_ENOMEM; + } + memcpy(pip->unwind_info, &dci, sizeof(dci)); + } + + return true; +} + +#ifdef __APPLE__ + +static bool +SearchCompactEncodingSection( + const libunwindInfo* info, + unw_word_t ip, + unw_word_t compactUnwindSectionAddr, + unw_proc_info_t *pip) +{ + unwind_info_section_header sectionHeader; + if (!info->ReadMemory((PVOID)compactUnwindSectionAddr, §ionHeader, sizeof(sectionHeader))) { + return false; + } + TRACE("Unwind ver %d common off: %08x common cnt: %d pers off: %08x pers cnt: %d index off: %08x index cnt: %d\n", + sectionHeader.version, + sectionHeader.commonEncodingsArraySectionOffset, + sectionHeader.commonEncodingsArrayCount, + sectionHeader.personalityArraySectionOffset, + sectionHeader.personalityArrayCount, + sectionHeader.indexSectionOffset, + sectionHeader.indexCount); + + if (sectionHeader.version != UNWIND_SECTION_VERSION) { + return false; + } + + int32_t offset = ip - info->BaseAddress; + unwind_info_section_header_index_entry entry; + unwind_info_section_header_index_entry entryNext; + bool found; + if (!BinarySearchEntries(info, offset, compactUnwindSectionAddr + sectionHeader.indexSectionOffset, sectionHeader.indexCount, &entry, &entryNext, false, &found)) { + return false; + } + if (!found) { + ERROR("Top level index not found\n"); + return false; + } + + uint32_t firstLevelFunctionOffset = entry.functionOffset; + uint32_t firstLevelNextPageFunctionOffset = entryNext.functionOffset; + + unw_word_t secondLevelAddr = compactUnwindSectionAddr + entry.secondLevelPagesSectionOffset; + unw_word_t lsdaArrayStartAddr = compactUnwindSectionAddr + entry.lsdaIndexArraySectionOffset; + unw_word_t lsdaArrayEndAddr = compactUnwindSectionAddr + entryNext.lsdaIndexArraySectionOffset; + + uint32_t encoding = 0; + unw_word_t funcStart = 0; + unw_word_t funcEnd = 0; + unw_word_t lsda = 0; + unw_word_t personality = 0; + + uint32_t pageKind; + if (!info->ReadMemory((PVOID)secondLevelAddr, &pageKind, sizeof(pageKind))) { + return false; + } + if (pageKind == UNWIND_SECOND_LEVEL_REGULAR) + { + unwind_info_regular_second_level_page_header pageHeader; + if (!info->ReadMemory((PVOID)secondLevelAddr, &pageHeader, sizeof(pageHeader))) { + return false; + } + + unwind_info_regular_second_level_entry pageEntry; + unwind_info_regular_second_level_entry pageEntryNext; + if (!BinarySearchEntries(info, offset, secondLevelAddr + pageHeader.entryPageOffset, pageHeader.entryCount, &pageEntry, &pageEntryNext, false, &found)) { + return false; + } + + encoding = pageEntry.encoding; + TRACE("Second level regular: %08x for offset %08x\n", encoding, offset); + funcStart = pageEntry.functionOffset + info->BaseAddress; + if (found) { + funcEnd = pageEntryNext.functionOffset + info->BaseAddress; + } + else { + funcEnd = firstLevelNextPageFunctionOffset + info->BaseAddress; + TRACE("Second level regular pageEntry not found start %p end %p\n", (void*)funcStart, (void*)funcEnd); + } + + if (ip < funcStart || ip > funcEnd) { + ERROR("ip %p not in regular second level\n", (void*)ip); + return false; + } + } + else if (pageKind == UNWIND_SECOND_LEVEL_COMPRESSED) + { + unwind_info_compressed_second_level_page_header pageHeader; + if (!info->ReadMemory((PVOID)secondLevelAddr, &pageHeader, sizeof(pageHeader))) { + return false; + } + + uint32_t pageOffset = offset - firstLevelFunctionOffset; + uint32_t pageEntry; + uint32_t pageEntryNext; + if (!BinarySearchEntries(info, pageOffset, secondLevelAddr + pageHeader.entryPageOffset, pageHeader.entryCount, &pageEntry, &pageEntryNext, true, &found)) { + return false; + } + + funcStart = UNWIND_INFO_COMPRESSED_ENTRY_FUNC_OFFSET(pageEntry) + firstLevelFunctionOffset + info->BaseAddress; + if (found) { + funcEnd = UNWIND_INFO_COMPRESSED_ENTRY_FUNC_OFFSET(pageEntryNext) + firstLevelFunctionOffset + info->BaseAddress; + } + else { + funcEnd = firstLevelNextPageFunctionOffset + info->BaseAddress; + TRACE("Second level compressed pageEntry not found start %p end %p\n", (void*)funcStart, (void*)funcEnd); + } + + if (ip < funcStart || ip > funcEnd) { + ERROR("ip %p not in compressed second level\n", (void*)ip); + return false; + } + + uint16_t encodingIndex = UNWIND_INFO_COMPRESSED_ENTRY_ENCODING_INDEX(pageEntry); + if (encodingIndex < sectionHeader.commonEncodingsArrayCount) + { + // Encoding is in common table in section header + unw_word_t addr = compactUnwindSectionAddr + sectionHeader.commonEncodingsArraySectionOffset + (encodingIndex * sizeof(uint32_t)); + if (!ReadValue32(info, &addr, &encoding)) { + return false; + } + TRACE("Second level compressed common table: %08x for offset %08x\n", encoding, pageOffset); + } + else + { + // Encoding is in page specific table + uint16_t pageEncodingIndex = encodingIndex - (uint16_t)sectionHeader.commonEncodingsArrayCount; + if (pageEncodingIndex >= pageHeader.encodingsCount) { + ERROR("pageEncodingIndex(%d) > page specific table encodingsCount(%d)\n", pageEncodingIndex, pageHeader.encodingsCount); + return false; + } + unw_word_t addr = secondLevelAddr + pageHeader.encodingsPageOffset + (pageEncodingIndex * sizeof(uint32_t)); + if (!ReadValue32(info, &addr, &encoding)) { + return false; + } + TRACE("Second level compressed page specific table: %08x for offset %08x\n", encoding, pageOffset); + } + } + else + { + ERROR("Invalid __unwind_info\n"); + return false; + } + + if (encoding & UNWIND_HAS_LSDA) + { + uint32_t funcStartOffset = funcStart - info->BaseAddress; + size_t lsdaArrayCount = (lsdaArrayEndAddr - lsdaArrayStartAddr) / sizeof(unwind_info_section_header_lsda_index_entry); + + unwind_info_section_header_lsda_index_entry lsdaEntry; + unwind_info_section_header_lsda_index_entry lsdaEntryNext; + if (!BinarySearchEntries(info, funcStartOffset, lsdaArrayStartAddr, lsdaArrayCount, &lsdaEntry, &lsdaEntryNext, false, &found)) { + return false; + } + if (!found || funcStartOffset != lsdaEntry.functionOffset || lsdaEntry.lsdaOffset == 0) { + ERROR("lsda not found(%d), not exact match (%08x != %08x) or lsda(%08x) == 0\n", + found, funcStartOffset, lsdaEntry.functionOffset, lsdaEntry.lsdaOffset); + return false; + } + lsda = lsdaEntry.lsdaOffset + info->BaseAddress; + } + + uint32_t personalityIndex = (encoding & UNWIND_PERSONALITY_MASK) >> (__builtin_ctz(UNWIND_PERSONALITY_MASK)); + if (personalityIndex != 0) + { + --personalityIndex; // change 1-based to zero-based index + if (personalityIndex > sectionHeader.personalityArrayCount) + { + ERROR("Invalid personality index\n"); + return false; + } + int32_t personalityDelta; + unw_word_t addr = compactUnwindSectionAddr + sectionHeader.personalityArraySectionOffset + personalityIndex * sizeof(uint32_t); + if (!ReadValue32(info, &addr, (uint32_t*)&personalityDelta)) { + return false; + } + addr = personalityDelta + info->BaseAddress; + if (!ReadPointer(info, &addr, &personality)) { + return false; + } + } + + pip->start_ip = funcStart; + pip->end_ip = funcEnd; + pip->lsda = lsda; + pip->handler = personality; + pip->gp = 0; + pip->flags = 0; + pip->format = encoding; + pip->unwind_info = 0; + pip->unwind_info_size = 0; + + TRACE("Encoding %08x start %p end %p found for ip %p\n", encoding, (void*)funcStart, (void*)funcEnd, (void*)ip); + return true; +} + +static bool +SearchDwarfSection( + const libunwindInfo* info, + unw_word_t ip, + unw_word_t dwarfSectionAddr, + unw_word_t dwarfSectionSize, + uint32_t fdeSectionHint, + unw_proc_info_t *pip, + int need_unwind_info) +{ + unw_word_t addr = dwarfSectionAddr + fdeSectionHint; + unw_word_t fdeAddr; + while (addr < (dwarfSectionAddr + dwarfSectionSize)) + { + fdeAddr = addr; + + unw_word_t ipStart, ipEnd; + unw_word_t fdeEndAddr; + dwarf_cie_info_t dci; + if (!ExtractFde(info, &addr, &fdeEndAddr, &ipStart, &ipEnd, &dci)) { + ERROR("ExtractFde FAILED for ip %p\n", (void*)ip); + break; + } + if (ip >= ipStart && ip < ipEnd) { + if (!ExtractProcInfoFromFde(info, &fdeAddr, pip, need_unwind_info)) { + ERROR("ExtractProcInfoFromFde FAILED for ip %p\n", (void*)ip); + break; + } + return true; + } + addr = fdeEndAddr; + } + return false; +} + + +static bool +GetProcInfo(unw_word_t ip, unw_proc_info_t *pip, const libunwindInfo* info, bool* step, int need_unwind_info) +{ + memset(pip, 0, sizeof(*pip)); + *step = false; + + mach_header_64 header; + if (!info->ReadMemory((void*)info->BaseAddress, &header, sizeof(mach_header_64))) { + ERROR("Reading header %p\n", (void*)info->BaseAddress); + return false; + } + // Read load commands + void* commandsAddress = (void*)(info->BaseAddress + sizeof(mach_header_64)); + load_command* commands = (load_command*)malloc(header.sizeofcmds); + if (commands == nullptr) + { + ERROR("Failed to allocate %d byte load commands\n", header.sizeofcmds); + return false; + } + if (!info->ReadMemory(commandsAddress, commands, header.sizeofcmds)) + { + ERROR("Failed to read load commands at %p of %d\n", commandsAddress, header.sizeofcmds); + return false; + } + unw_word_t compactUnwindSectionAddr = 0; + unw_word_t compactUnwindSectionSize = 0; + unw_word_t ehframeSectionAddr = 0; + unw_word_t ehframeSectionSize = 0; + mach_vm_address_t loadBias = 0; + + load_command* command = commands; + for (int i = 0; i < header.ncmds; i++) + { + if (command->cmd == LC_SEGMENT_64) + { + segment_command_64* segment = (segment_command_64*)command; + + // Calculate the load bias for the module. This is the value to add to the vmaddr of a + // segment to get the actual address. + if (strcmp(segment->segname, SEG_TEXT) == 0) + { + loadBias = info->BaseAddress - segment->vmaddr; + TRACE_VERBOSE("CMD: load bias %016llx\n", loadBias); + } + + section_64* section = (section_64*)((uint64_t)segment + sizeof(segment_command_64)); + for (int s = 0; s < segment->nsects; s++, section++) + { + TRACE_VERBOSE(" addr %016llx size %016llx off %08x align %02x flags %02x %s %s\n", + section->addr, + section->size, + section->offset, + section->align, + section->flags, + section->segname, + section->sectname); + + if (strcmp(section->sectname, "__unwind_info") == 0) + { + compactUnwindSectionAddr = section->addr + loadBias; + compactUnwindSectionSize = section->size; + } + if (strcmp(section->sectname, "__eh_frame") == 0) + { + ehframeSectionAddr = section->addr + loadBias; + ehframeSectionSize = section->size; + } + } + } + // Get next load command + command = (load_command*)((char*)command + command->cmdsize); + } + + // If there is a compact unwind encoding table, look there first + if (compactUnwindSectionAddr != 0) + { + if (SearchCompactEncodingSection(info, ip, compactUnwindSectionAddr, pip)) + { + if (ehframeSectionAddr != 0) + { +#ifdef TARGET_AMD64 + if ((pip->format & UNWIND_X86_64_MODE_MASK) == UNWIND_X86_64_MODE_DWARF) + { + uint32_t dwarfOffsetHint = pip->format & UNWIND_X86_64_DWARF_SECTION_OFFSET; +#elif TARGET_ARM64 + if ((pip->format & UNWIND_ARM64_MODE_MASK) == UNWIND_ARM64_MODE_DWARF) + { + uint32_t dwarfOffsetHint = pip->format & UNWIND_ARM64_DWARF_SECTION_OFFSET; +#else +#error unsupported architecture +#endif + if (SearchDwarfSection(info, ip, ehframeSectionAddr, ehframeSectionSize, dwarfOffsetHint, pip, need_unwind_info)) { + TRACE("SUCCESS: found in eh frame from compact hint for %p\n", (void*)ip); + return true; + } + } + } + // Need to do a compact step based on pip->format and pip->start_ip + TRACE("Compact step %p format %08x start_ip %p\n", (void*)ip, pip->format, (void*)pip->start_ip); + *step = true; + return true; + } + } + + // Look in dwarf unwind info next + if (ehframeSectionAddr != 0) + { + if (SearchDwarfSection(info, ip, ehframeSectionAddr, ehframeSectionSize, 0, pip, need_unwind_info)) { + TRACE("SUCCESS: found in eh frame for %p\n", (void*)ip); + return true; + } + } + + ERROR("Unwind info not found for %p format %08x\n", (void*)ip, pip->format); + return false; +} + +static bool +StepWithCompactEncodingRBPFrame(const libunwindInfo* info, compact_unwind_encoding_t compactEncoding) +{ + CONTEXT* context = info->Context; + uint32_t savedRegistersOffset = EXTRACT_BITS(compactEncoding, UNWIND_X86_64_RBP_FRAME_OFFSET); + uint32_t savedRegistersLocations = EXTRACT_BITS(compactEncoding, UNWIND_X86_64_RBP_FRAME_REGISTERS); + unw_word_t savedRegisters = context->Rbp - (sizeof(uint64_t) * savedRegistersOffset); + + // See compact_unwind_encoding.h for the format bit layout details + for (int i = 0; i < 5; ++i) + { + switch (savedRegistersLocations & 0x7) + { + case UNWIND_X86_64_REG_NONE: + // no register saved in this slot + break; + case UNWIND_X86_64_REG_RBX: + if (!ReadValue64(info, &savedRegisters, (uint64_t*)&context->Rbx)) { + return false; + } + break; + case UNWIND_X86_64_REG_R12: + if (!ReadValue64(info, &savedRegisters, (uint64_t*)&context->R12)) { + return false; + } + break; + case UNWIND_X86_64_REG_R13: + if (!ReadValue64(info, &savedRegisters, (uint64_t*)&context->R13)) { + return false; + } + break; + case UNWIND_X86_64_REG_R14: + if (!ReadValue64(info, &savedRegisters, (uint64_t*)&context->R14)) { + return false; + } + break; + case UNWIND_X86_64_REG_R15: + if (!ReadValue64(info, &savedRegisters, (uint64_t*)&context->R15)) { + return false; + } + break; + default: + ERROR("Invalid register for RBP frame %08x\n", compactEncoding); + return false; + } + savedRegistersLocations = (savedRegistersLocations >> 3); + } + uint64_t rbp = context->Rbp; + + // ebp points to old ebp + unw_word_t addr = rbp; + if (!ReadValue64(info, &addr, (uint64_t*)&context->Rbp)) { + return false; + } + + // old esp is ebp less saved ebp and return address + context->Rsp = rbp + (sizeof(uint64_t) * 2); + + // pop return address into eip + addr = rbp + sizeof(uint64_t); + if (!ReadValue64(info, &addr, (uint64_t*)&context->Rip)) { + return false; + } + + TRACE("SUCCESS: compact step encoding %08x rip %p rsp %p rbp %p\n", + compactEncoding, (void*)context->Rip, (void*)context->Rsp, (void*)context->Rbp); + return true; +} + +static bool +StepWithCompactEncoding(const libunwindInfo* info, compact_unwind_encoding_t compactEncoding, unw_word_t functionStart) +{ + if (compactEncoding == 0) + { + TRACE("Compact unwind missing for %p\n", (void*)info->Context->Rip); + return false; + } + switch (compactEncoding & UNWIND_X86_64_MODE_MASK) + { + case UNWIND_X86_64_MODE_RBP_FRAME: + return StepWithCompactEncodingRBPFrame(info, compactEncoding); + + case UNWIND_X86_64_MODE_STACK_IMMD: + case UNWIND_X86_64_MODE_STACK_IND: + break; + + } + ERROR("Invalid encoding %08x\n", compactEncoding); + return false; +} + +#endif // __APPLE__ + +#endif // defined(__APPLE__) || defined(FEATURE_USE_SYSTEM_LIBUNWIND) + +static void GetContextPointer(unw_cursor_t *cursor, unw_context_t *unwContext, int reg, SIZE_T **contextPointer) +{ +#if defined(HAVE_UNW_GET_SAVE_LOC) + unw_save_loc_t saveLoc; + unw_get_save_loc(cursor, reg, &saveLoc); + if (saveLoc.type == UNW_SLT_MEMORY) + { + SIZE_T *pLoc = (SIZE_T *)saveLoc.u.addr; + // Filter out fake save locations that point to unwContext + if (unwContext == NULL || (pLoc < (SIZE_T *)unwContext) || ((SIZE_T *)(unwContext + 1) <= pLoc)) + *contextPointer = (SIZE_T *)saveLoc.u.addr; + } +#else + // Returning NULL indicates that we don't have context pointers available + *contextPointer = NULL; +#endif +} + +static void GetContextPointers(unw_cursor_t *cursor, unw_context_t *unwContext, KNONVOLATILE_CONTEXT_POINTERS *contextPointers) +{ +#if (defined(HOST_UNIX) && defined(HOST_AMD64)) || (defined(HOST_WINDOWS) && defined(TARGET_AMD64)) + GetContextPointer(cursor, unwContext, UNW_X86_64_RBP, &contextPointers->Rbp); + GetContextPointer(cursor, unwContext, UNW_X86_64_RBX, &contextPointers->Rbx); + GetContextPointer(cursor, unwContext, UNW_X86_64_R12, &contextPointers->R12); + GetContextPointer(cursor, unwContext, UNW_X86_64_R13, &contextPointers->R13); + GetContextPointer(cursor, unwContext, UNW_X86_64_R14, &contextPointers->R14); + GetContextPointer(cursor, unwContext, UNW_X86_64_R15, &contextPointers->R15); +#elif (defined(HOST_UNIX) && defined(HOST_X86)) || (defined(HOST_WINDOWS) && defined(TARGET_X86)) + GetContextPointer(cursor, unwContext, UNW_X86_EBX, &contextPointers->Ebx); + GetContextPointer(cursor, unwContext, UNW_X86_EBP, &contextPointers->Ebp); + GetContextPointer(cursor, unwContext, UNW_X86_ESI, &contextPointers->Esi); + GetContextPointer(cursor, unwContext, UNW_X86_EDI, &contextPointers->Edi); +#elif (defined(HOST_UNIX) && defined(HOST_ARM)) || (defined(HOST_WINDOWS) && defined(TARGET_ARM)) + GetContextPointer(cursor, unwContext, UNW_ARM_R4, &contextPointers->R4); + GetContextPointer(cursor, unwContext, UNW_ARM_R5, &contextPointers->R5); + GetContextPointer(cursor, unwContext, UNW_ARM_R6, &contextPointers->R6); + GetContextPointer(cursor, unwContext, UNW_ARM_R7, &contextPointers->R7); + GetContextPointer(cursor, unwContext, UNW_ARM_R8, &contextPointers->R8); + GetContextPointer(cursor, unwContext, UNW_ARM_R9, &contextPointers->R9); + GetContextPointer(cursor, unwContext, UNW_ARM_R10, &contextPointers->R10); + GetContextPointer(cursor, unwContext, UNW_ARM_R11, &contextPointers->R11); +#elif (defined(HOST_UNIX) && defined(HOST_ARM64)) || (defined(HOST_WINDOWS) && defined(TARGET_ARM64)) + GetContextPointer(cursor, unwContext, UNW_AARCH64_X19, &contextPointers->X19); + GetContextPointer(cursor, unwContext, UNW_AARCH64_X20, &contextPointers->X20); + GetContextPointer(cursor, unwContext, UNW_AARCH64_X21, &contextPointers->X21); + GetContextPointer(cursor, unwContext, UNW_AARCH64_X22, &contextPointers->X22); + GetContextPointer(cursor, unwContext, UNW_AARCH64_X23, &contextPointers->X23); + GetContextPointer(cursor, unwContext, UNW_AARCH64_X24, &contextPointers->X24); + GetContextPointer(cursor, unwContext, UNW_AARCH64_X25, &contextPointers->X25); + GetContextPointer(cursor, unwContext, UNW_AARCH64_X26, &contextPointers->X26); + GetContextPointer(cursor, unwContext, UNW_AARCH64_X27, &contextPointers->X27); + GetContextPointer(cursor, unwContext, UNW_AARCH64_X28, &contextPointers->X28); + GetContextPointer(cursor, unwContext, UNW_AARCH64_X29, &contextPointers->Fp); +#else +#error unsupported architecture +#endif +} + static void UnwindContextToContext(unw_cursor_t *cursor, CONTEXT *winContext) { #if (defined(HOST_UNIX) && defined(HOST_AMD64)) || (defined(HOST_WINDOWS) && defined(TARGET_AMD64)) @@ -294,7 +1591,7 @@ access_reg(unw_addr_space_t as, unw_regnum_t regnum, unw_word_t *valp, int write ASSERT("Attempt to read an unknown register %d\n", regnum); return -UNW_EBADREG; } - TRACE("REG: %d %p\n", regnum, *valp); + TRACE("REG: %d %p\n", regnum, (void*)*valp); return UNW_ESUCCESS; } @@ -323,6 +1620,14 @@ static int find_proc_info(unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pip, int need_unwind_info, void *arg) { const auto *info = (libunwindInfo*)arg; +#ifdef __APPLE__ + bool step; + if (!GetProcInfo(ip, pip, info, &step, need_unwind_info)) { + return -UNW_EINVAL; + } + _ASSERTE(!step); + return UNW_ESUCCESS; +#else memset(pip, 0, sizeof(*pip)); Ehdr ehdr; @@ -423,7 +1728,82 @@ find_proc_info(unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pip, int nee } } +#ifdef FEATURE_USE_SYSTEM_LIBUNWIND + if (ehFrameHdrAddr == 0) { + ASSERT("ELF: No PT_GNU_EH_FRAME program header\n"); + return -UNW_EINVAL; + } + eh_frame_hdr ehFrameHdr; + if (!info->ReadMemory((PVOID)ehFrameHdrAddr, &ehFrameHdr, sizeof(eh_frame_hdr))) { + ERROR("ELF: reading ehFrameHdrAddr %p\n", ehFrameHdrAddr); + return -UNW_EINVAL; + } + TRACE("ehFrameHdrAddr %p version %d eh_frame_ptr_enc %d fde_count_enc %d table_enc %d\n", + ehFrameHdrAddr, ehFrameHdr.version, ehFrameHdr.eh_frame_ptr_enc, ehFrameHdr.fde_count_enc, ehFrameHdr.table_enc); + + if (ehFrameHdr.version != DW_EH_VERSION) { + ASSERT("ehFrameHdr version %x not supported\n", ehFrameHdr.version); + return -UNW_EBADVERSION; + } + unw_word_t addr = ehFrameHdrAddr + sizeof(eh_frame_hdr); + unw_word_t ehFrameStart; + unw_word_t fdeCount; + + // Decode the eh_frame_hdr info + if (!ReadEncodedPointer(info, &addr, ehFrameHdr.eh_frame_ptr_enc, UINTPTR_MAX, &ehFrameStart)) { + ERROR("decoding eh_frame_ptr\n"); + return -UNW_EINVAL; + } + if (!ReadEncodedPointer(info, &addr, ehFrameHdr.fde_count_enc, UINTPTR_MAX, &fdeCount)) { + ERROR("decoding fde_count_enc\n"); + return -UNW_EINVAL; + } + TRACE("ehFrameStart %p fdeCount %p ip offset %08x\n", ehFrameStart, fdeCount, (int32_t)(ip - ehFrameHdrAddr)); + + // If there are no frame table entries + if (fdeCount == 0) { + TRACE("No frame table entries\n"); + return -UNW_ENOINFO; + } + + // We assume this encoding + if (ehFrameHdr.table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)) { + ASSERT("Table encoding not supported %x\n", ehFrameHdr.table_enc); + return -UNW_EINVAL; + } + + // Find the fde using a binary search on the frame table + table_entry_t entry; + table_entry_t entryNext; + bool found; + if (!BinarySearchEntries(info, ip - ehFrameHdrAddr, addr, fdeCount, &entry, &entryNext, false, &found)) { + ERROR("LookupTableEntry\n"); + return -UNW_EINVAL; + } + unw_word_t fdeAddr = entry.fde_offset + ehFrameHdrAddr; + TRACE("start_ip %08x fde_offset %08x fdeAddr %p found %d\n", entry.start_ip, entry.fde_offset, fdeAddr, found); + + // Unwind info not found + if (!found) { + return -UNW_ENOINFO; + } + + // Now get the unwind info + if (!ExtractProcInfoFromFde(info, &fdeAddr, pip, need_unwind_info)) { + ERROR("ExtractProcInfoFromFde\n"); + return -UNW_EINVAL; + } + + if (ip < pip->start_ip || ip >= pip->end_ip) { + TRACE("ip %p not in range start_ip %p end_ip %p\n", ip, pip->start_ip, pip->end_ip); + return -UNW_ENOINFO; + } + return UNW_ESUCCESS; +#else return _OOP_find_proc_info(start_ip, end_ip, ehFrameHdrAddr, ehFrameHdrLen, exidxFrameHdrAddr, exidxFrameHdrLen, as, ip, pip, need_unwind_info, arg); +#endif // FEATURE_USE_SYSTEM_LIBUNWIND + +#endif // __APPLE__ } static void @@ -472,6 +1852,22 @@ PAL_VirtualUnwindOutOfProc(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *cont info.Context = context; info.ReadMemory = readMemoryCallback; +#ifdef __APPLE__ + TRACE("Unwind: rip %p rsp %p rbp %p\n", (void*)context->Rip, (void*)context->Rsp, (void*)context->Rbp); + unw_proc_info_t procInfo; + bool step; + result = GetProcInfo(context->Rip, &procInfo, &info, &step, false); + if (!result) + { + goto exit; + } + if (step) + { + result = StepWithCompactEncoding(&info, procInfo.format, procInfo.start_ip); + goto exit; + } +#endif + addrSpace = unw_create_addr_space(&unwind_accessors, 0); st = unw_init_remote(&cursor, addrSpace, &info); @@ -513,4 +1909,4 @@ PAL_VirtualUnwindOutOfProc(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *cont return FALSE; } -#endif // defined(HAVE_UNW_GET_ACCESSORS) +#endif // defined(__APPLE__) || defined(HAVE_UNW_GET_ACCESSORS) diff --git a/src/coreclr/src/pal/src/libunwind/CMakeLists.txt b/src/coreclr/src/pal/src/libunwind/CMakeLists.txt index 169023e12b8f..bf26aca20235 100644 --- a/src/coreclr/src/pal/src/libunwind/CMakeLists.txt +++ b/src/coreclr/src/pal/src/libunwind/CMakeLists.txt @@ -1,6 +1,5 @@ # This is a custom file written for .NET Core's build system # It overwrites the one found in upstream - project(unwind) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -69,6 +68,28 @@ if(CLR_CMAKE_HOST_UNIX) # Disable warning for a bug in the libunwind source src/x86/Gos-linux.c, but not in code that we exercise add_compile_options(-Wno-incompatible-pointer-types) endif() + + if (CLR_CMAKE_HOST_OSX) + add_definitions(-D_XOPEN_SOURCE) + add_definitions(-DUNW_REMOTE_ONLY) + add_definitions(-D__APPLE__) + add_compile_options(-Wno-sometimes-uninitialized) + add_compile_options(-Wno-implicit-function-declaration) + + # Our posix abstraction layer will provide these headers + set(HAVE_ELF_H 1) + set(HAVE_ENDIAN_H 1) + + # include paths + include_directories(include/tdep) + include_directories(include) + include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/tdep) + include_directories(${CMAKE_CURRENT_BINARY_DIR}/include) + + # files for macos compilation + include_directories(../libunwind_mac/include) + endif(CLR_CMAKE_HOST_OSX) + endif(CLR_CMAKE_HOST_UNIX) if(CLR_CMAKE_HOST_WIN32) diff --git a/src/coreclr/src/pal/src/libunwind/src/CMakeLists.txt b/src/coreclr/src/pal/src/libunwind/src/CMakeLists.txt index c7cc497f3109..656f913ab073 100644 --- a/src/coreclr/src/pal/src/libunwind/src/CMakeLists.txt +++ b/src/coreclr/src/pal/src/libunwind/src/CMakeLists.txt @@ -299,15 +299,26 @@ if(CLR_CMAKE_HOST_UNIX) list(APPEND libunwind_setjmp_la_SOURCES x86_64/longjmp.S x86_64/siglongjmp.SA) endif() - add_library(libunwind - OBJECT - ${libunwind_la_SOURCES} - ${libunwind_remote_la_SOURCES} - ${libunwind_dwarf_local_la_SOURCES} - ${libunwind_dwarf_common_la_SOURCES} - ${libunwind_dwarf_generic_la_SOURCES} - ${libunwind_elf_la_SOURCES} - ) + if(CLR_CMAKE_HOST_OSX) + add_library(libunwind_dac + OBJECT + ../../libunwind_mac/src/missing-functions.c + ${libunwind_remote_la_SOURCES} + ${libunwind_dwarf_common_la_SOURCES} + ${libunwind_dwarf_generic_la_SOURCES} + ) + else() + add_library(libunwind + OBJECT + ${libunwind_la_SOURCES} + ${libunwind_remote_la_SOURCES} + ${libunwind_dwarf_local_la_SOURCES} + ${libunwind_dwarf_common_la_SOURCES} + ${libunwind_dwarf_generic_la_SOURCES} + ${libunwind_elf_la_SOURCES} + ) + endif(CLR_CMAKE_HOST_OSX) + else(CLR_CMAKE_HOST_UNIX) if(CLR_CMAKE_TARGET_ARCH_ARM64) SET(libunwind_la_SOURCES ${libunwind_la_SOURCES_aarch64}) @@ -332,11 +343,10 @@ else(CLR_CMAKE_HOST_UNIX) endif() set_source_files_properties(${CLR_DIR}/src/pal/src/exception/remote-unwind.cpp PROPERTIES COMPILE_FLAGS /TP INCLUDE_DIRECTORIES ${CLR_DIR}/src/inc) - set_source_files_properties(${CLR_DIR}/src/pal/src/exception/seh-unwind.cpp PROPERTIES COMPILE_FLAGS /TP INCLUDE_DIRECTORIES ${CLR_DIR}/src/inc) + add_library(libunwind_xdac OBJECT ../../exception/remote-unwind.cpp - ../../exception/seh-unwind.cpp win/pal-single-threaded.c # ${libunwind_la_SOURCES} Local... ${libunwind_remote_la_SOURCES} @@ -348,4 +358,3 @@ else(CLR_CMAKE_HOST_UNIX) ${libunwind_elf_la_SOURCES} ) endif(CLR_CMAKE_HOST_UNIX) - diff --git a/src/coreclr/src/pal/src/libunwind_mac/include/elf.h b/src/coreclr/src/pal/src/libunwind_mac/include/elf.h new file mode 100644 index 000000000000..d843777e426a --- /dev/null +++ b/src/coreclr/src/pal/src/libunwind_mac/include/elf.h @@ -0,0 +1,10 @@ +// This is an incomplete & imprecice implementation +// It defers to the open source freebsd-elf implementations. + +#pragma once + +#include + +#include "freebsd-elf_common.h" +#include "freebsd-elf32.h" +#include "freebsd-elf64.h" diff --git a/src/coreclr/src/pal/src/libunwind_mac/include/endian.h b/src/coreclr/src/pal/src/libunwind_mac/include/endian.h new file mode 100644 index 000000000000..409750756069 --- /dev/null +++ b/src/coreclr/src/pal/src/libunwind_mac/include/endian.h @@ -0,0 +1,9 @@ +// This is an incomplete & imprecice implementation of the +// standard file by the same name + +#pragma once + +#define __LITTLE_ENDIAN 1234 +#define __BIG_ENDIAN 4321 + +#define __BYTE_ORDER __LITTLE_ENDIAN diff --git a/src/coreclr/src/pal/src/libunwind_mac/include/fakestdalign.h.in b/src/coreclr/src/pal/src/libunwind_mac/include/fakestdalign.h.in new file mode 100644 index 000000000000..3e94006d8cae --- /dev/null +++ b/src/coreclr/src/pal/src/libunwind_mac/include/fakestdalign.h.in @@ -0,0 +1,9 @@ +// This is a fake implementatino of stdaliagn.h for when +// compiler C11 stdaliagn.h support is missing + +#ifndef FAKE_STD_ALIGN_H +#define FAKE_STD_ALIGN_H + +#define alignas(x) + +#endif // FAKE_STD_ALIGN_H diff --git a/src/coreclr/src/pal/src/libunwind_mac/include/fakestdatomic.h.in b/src/coreclr/src/pal/src/libunwind_mac/include/fakestdatomic.h.in new file mode 100644 index 000000000000..7b9dcd5a9d8a --- /dev/null +++ b/src/coreclr/src/pal/src/libunwind_mac/include/fakestdatomic.h.in @@ -0,0 +1,36 @@ +// This is a non-atomic fake implementatino of stdatomics for when +// compiler C11 stdatomic support is missing and only single threaded +// operation is required + +#ifndef FAKE_STD_ATOMICS_H +#define FAKE_STD_ATOMICS_H + +#include + +#define _Atomic volatile +#define ATOMIC_FLAG_INIT 0 + +typedef uint8_t atomic_bool; +typedef uint8_t atomic_flag; + +#define atomic_compare_and_exchange_strong(x, y, z) return ((*(x) == *(y)) ? ((*(x) = z), true) : ((*(y) = *(x)),false)) + +#define atomic_fetch_add(x, y) *(x) += (y), (*(x) - (y)) + +static inline void atomic_flag_clear(volatile atomic_flag* flag) +{ + *flag = ATOMIC_FLAG_INIT; +} + +static inline atomic_bool atomic_flag_test_and_set( volatile atomic_flag* flag ) +{ + atomic_bool result = *flag; + *flag = 1; + return result; +} + +#define atomic_load(x) (*(x)) +#define atomic_store(x, y) do { *(x) = (y); } while (0) + + +#endif // FAKE_STD_ATOMICS_H diff --git a/src/coreclr/src/pal/src/libunwind_mac/include/freebsd-elf32.h b/src/coreclr/src/pal/src/libunwind_mac/include/freebsd-elf32.h new file mode 100644 index 000000000000..b4c0d94210d9 --- /dev/null +++ b/src/coreclr/src/pal/src/libunwind_mac/include/freebsd-elf32.h @@ -0,0 +1,245 @@ +/*- + * Copyright (c) 1996-1998 John D. Polstra. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/sys/sys/elf32.h,v 1.8.14.2.2.1 2008/10/02 02:57:24 kensmith Exp $ + */ + +#ifndef _SYS_ELF32_H_ +#define _SYS_ELF32_H_ 1 + +#include "freebsd-elf_common.h" + +/* + * ELF definitions common to all 32-bit architectures. + */ + +typedef uint32_t Elf32_Addr; +typedef uint16_t Elf32_Half; +typedef uint32_t Elf32_Off; +typedef int32_t Elf32_Sword; +typedef uint32_t Elf32_Word; +typedef uint64_t Elf32_Lword; + +typedef Elf32_Word Elf32_Hashelt; + +/* Non-standard class-dependent datatype used for abstraction. */ +typedef Elf32_Word Elf32_Size; +typedef Elf32_Sword Elf32_Ssize; + +/* + * ELF header. + */ + +typedef struct { + unsigned char e_ident[EI_NIDENT]; /* File identification. */ + Elf32_Half e_type; /* File type. */ + Elf32_Half e_machine; /* Machine architecture. */ + Elf32_Word e_version; /* ELF format version. */ + Elf32_Addr e_entry; /* Entry point. */ + Elf32_Off e_phoff; /* Program header file offset. */ + Elf32_Off e_shoff; /* Section header file offset. */ + Elf32_Word e_flags; /* Architecture-specific flags. */ + Elf32_Half e_ehsize; /* Size of ELF header in bytes. */ + Elf32_Half e_phentsize; /* Size of program header entry. */ + Elf32_Half e_phnum; /* Number of program header entries. */ + Elf32_Half e_shentsize; /* Size of section header entry. */ + Elf32_Half e_shnum; /* Number of section header entries. */ + Elf32_Half e_shstrndx; /* Section name strings section. */ +} Elf32_Ehdr; + +/* + * Section header. + */ + +typedef struct { + Elf32_Word sh_name; /* Section name (index into the + section header string table). */ + Elf32_Word sh_type; /* Section type. */ + Elf32_Word sh_flags; /* Section flags. */ + Elf32_Addr sh_addr; /* Address in memory image. */ + Elf32_Off sh_offset; /* Offset in file. */ + Elf32_Word sh_size; /* Size in bytes. */ + Elf32_Word sh_link; /* Index of a related section. */ + Elf32_Word sh_info; /* Depends on section type. */ + Elf32_Word sh_addralign; /* Alignment in bytes. */ + Elf32_Word sh_entsize; /* Size of each entry in section. */ +} Elf32_Shdr; + +/* + * Program header. + */ + +typedef struct { + Elf32_Word p_type; /* Entry type. */ + Elf32_Off p_offset; /* File offset of contents. */ + Elf32_Addr p_vaddr; /* Virtual address in memory image. */ + Elf32_Addr p_paddr; /* Physical address (not used). */ + Elf32_Word p_filesz; /* Size of contents in file. */ + Elf32_Word p_memsz; /* Size of contents in memory. */ + Elf32_Word p_flags; /* Access permission flags. */ + Elf32_Word p_align; /* Alignment in memory and file. */ +} Elf32_Phdr; + +/* + * Dynamic structure. The ".dynamic" section contains an array of them. + */ + +typedef struct { + Elf32_Sword d_tag; /* Entry type. */ + union { + Elf32_Word d_val; /* Integer value. */ + Elf32_Addr d_ptr; /* Address value. */ + } d_un; +} Elf32_Dyn; + +/* + * Relocation entries. + */ + +/* Relocations that don't need an addend field. */ +typedef struct { + Elf32_Addr r_offset; /* Location to be relocated. */ + Elf32_Word r_info; /* Relocation type and symbol index. */ +} Elf32_Rel; + +/* Relocations that need an addend field. */ +typedef struct { + Elf32_Addr r_offset; /* Location to be relocated. */ + Elf32_Word r_info; /* Relocation type and symbol index. */ + Elf32_Sword r_addend; /* Addend. */ +} Elf32_Rela; + +/* Macros for accessing the fields of r_info. */ +#define ELF32_R_SYM(info) ((info) >> 8) +#define ELF32_R_TYPE(info) ((unsigned char)(info)) + +/* Macro for constructing r_info from field values. */ +#define ELF32_R_INFO(sym, type) (((sym) << 8) + (unsigned char)(type)) + +/* + * Note entry header + */ +typedef Elf_Note Elf32_Nhdr; + +/* + * Move entry + */ +typedef struct { + Elf32_Lword m_value; /* symbol value */ + Elf32_Word m_info; /* size + index */ + Elf32_Word m_poffset; /* symbol offset */ + Elf32_Half m_repeat; /* repeat count */ + Elf32_Half m_stride; /* stride info */ +} Elf32_Move; + +/* + * The macros compose and decompose values for Move.r_info + * + * sym = ELF32_M_SYM(M.m_info) + * size = ELF32_M_SIZE(M.m_info) + * M.m_info = ELF32_M_INFO(sym, size) + */ +#define ELF32_M_SYM(info) ((info)>>8) +#define ELF32_M_SIZE(info) ((unsigned char)(info)) +#define ELF32_M_INFO(sym, size) (((sym)<<8)+(unsigned char)(size)) + +/* + * Hardware/Software capabilities entry + */ +typedef struct { + Elf32_Word c_tag; /* how to interpret value */ + union { + Elf32_Word c_val; + Elf32_Addr c_ptr; + } c_un; +} Elf32_Cap; + +/* + * Symbol table entries. + */ + +typedef struct { + Elf32_Word st_name; /* String table index of name. */ + Elf32_Addr st_value; /* Symbol value. */ + Elf32_Word st_size; /* Size of associated object. */ + unsigned char st_info; /* Type and binding information. */ + unsigned char st_other; /* Reserved (not used). */ + Elf32_Half st_shndx; /* Section index of symbol. */ +} Elf32_Sym; + +/* Macros for accessing the fields of st_info. */ +#define ELF32_ST_BIND(info) ((info) >> 4) +#define ELF32_ST_TYPE(info) ((info) & 0xf) + +/* Macro for constructing st_info from field values. */ +#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) + +/* Macro for accessing the fields of st_other. */ +#define ELF32_ST_VISIBILITY(oth) ((oth) & 0x3) + +/* Structures used by Sun & GNU symbol versioning. */ +typedef struct +{ + Elf32_Half vd_version; + Elf32_Half vd_flags; + Elf32_Half vd_ndx; + Elf32_Half vd_cnt; + Elf32_Word vd_hash; + Elf32_Word vd_aux; + Elf32_Word vd_next; +} Elf32_Verdef; + +typedef struct +{ + Elf32_Word vda_name; + Elf32_Word vda_next; +} Elf32_Verdaux; + +typedef struct +{ + Elf32_Half vn_version; + Elf32_Half vn_cnt; + Elf32_Word vn_file; + Elf32_Word vn_aux; + Elf32_Word vn_next; +} Elf32_Verneed; + +typedef struct +{ + Elf32_Word vna_hash; + Elf32_Half vna_flags; + Elf32_Half vna_other; + Elf32_Word vna_name; + Elf32_Word vna_next; +} Elf32_Vernaux; + +typedef Elf32_Half Elf32_Versym; + +typedef struct { + Elf32_Half si_boundto; /* direct bindings - symbol bound to */ + Elf32_Half si_flags; /* per symbol flags */ +} Elf32_Syminfo; + +#endif /* !_SYS_ELF32_H_ */ diff --git a/src/coreclr/src/pal/src/libunwind_mac/include/freebsd-elf64.h b/src/coreclr/src/pal/src/libunwind_mac/include/freebsd-elf64.h new file mode 100644 index 000000000000..0991fe356f97 --- /dev/null +++ b/src/coreclr/src/pal/src/libunwind_mac/include/freebsd-elf64.h @@ -0,0 +1,252 @@ +/*- + * Copyright (c) 1996-1998 John D. Polstra. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/sys/sys/elf64.h,v 1.10.14.2.2.1 2008/10/02 02:57:24 kensmith Exp $ + */ + +#ifndef _SYS_ELF64_H_ +#define _SYS_ELF64_H_ 1 + +#include "freebsd-elf_common.h" + +/* + * ELF definitions common to all 64-bit architectures. + */ + +typedef uint64_t Elf64_Addr; +typedef uint16_t Elf64_Half; +typedef uint64_t Elf64_Off; +typedef int32_t Elf64_Sword; +typedef int64_t Elf64_Sxword; +typedef uint32_t Elf64_Word; +typedef uint64_t Elf64_Lword; +typedef uint64_t Elf64_Xword; + +/* + * Types of dynamic symbol hash table bucket and chain elements. + * + * This is inconsistent among 64 bit architectures, so a machine dependent + * typedef is required. + */ + +#ifdef __alpha__ +typedef Elf64_Off Elf64_Hashelt; +#else +typedef Elf64_Word Elf64_Hashelt; +#endif + +/* Non-standard class-dependent datatype used for abstraction. */ +typedef Elf64_Xword Elf64_Size; +typedef Elf64_Sxword Elf64_Ssize; + +/* + * ELF header. + */ + +typedef struct { + unsigned char e_ident[EI_NIDENT]; /* File identification. */ + Elf64_Half e_type; /* File type. */ + Elf64_Half e_machine; /* Machine architecture. */ + Elf64_Word e_version; /* ELF format version. */ + Elf64_Addr e_entry; /* Entry point. */ + Elf64_Off e_phoff; /* Program header file offset. */ + Elf64_Off e_shoff; /* Section header file offset. */ + Elf64_Word e_flags; /* Architecture-specific flags. */ + Elf64_Half e_ehsize; /* Size of ELF header in bytes. */ + Elf64_Half e_phentsize; /* Size of program header entry. */ + Elf64_Half e_phnum; /* Number of program header entries. */ + Elf64_Half e_shentsize; /* Size of section header entry. */ + Elf64_Half e_shnum; /* Number of section header entries. */ + Elf64_Half e_shstrndx; /* Section name strings section. */ +} Elf64_Ehdr; + +/* + * Section header. + */ + +typedef struct { + Elf64_Word sh_name; /* Section name (index into the + section header string table). */ + Elf64_Word sh_type; /* Section type. */ + Elf64_Xword sh_flags; /* Section flags. */ + Elf64_Addr sh_addr; /* Address in memory image. */ + Elf64_Off sh_offset; /* Offset in file. */ + Elf64_Xword sh_size; /* Size in bytes. */ + Elf64_Word sh_link; /* Index of a related section. */ + Elf64_Word sh_info; /* Depends on section type. */ + Elf64_Xword sh_addralign; /* Alignment in bytes. */ + Elf64_Xword sh_entsize; /* Size of each entry in section. */ +} Elf64_Shdr; + +/* + * Program header. + */ + +typedef struct { + Elf64_Word p_type; /* Entry type. */ + Elf64_Word p_flags; /* Access permission flags. */ + Elf64_Off p_offset; /* File offset of contents. */ + Elf64_Addr p_vaddr; /* Virtual address in memory image. */ + Elf64_Addr p_paddr; /* Physical address (not used). */ + Elf64_Xword p_filesz; /* Size of contents in file. */ + Elf64_Xword p_memsz; /* Size of contents in memory. */ + Elf64_Xword p_align; /* Alignment in memory and file. */ +} Elf64_Phdr; + +/* + * Dynamic structure. The ".dynamic" section contains an array of them. + */ + +typedef struct { + Elf64_Sxword d_tag; /* Entry type. */ + union { + Elf64_Xword d_val; /* Integer value. */ + Elf64_Addr d_ptr; /* Address value. */ + } d_un; +} Elf64_Dyn; + +/* + * Relocation entries. + */ + +/* Relocations that don't need an addend field. */ +typedef struct { + Elf64_Addr r_offset; /* Location to be relocated. */ + Elf64_Xword r_info; /* Relocation type and symbol index. */ +} Elf64_Rel; + +/* Relocations that need an addend field. */ +typedef struct { + Elf64_Addr r_offset; /* Location to be relocated. */ + Elf64_Xword r_info; /* Relocation type and symbol index. */ + Elf64_Sxword r_addend; /* Addend. */ +} Elf64_Rela; + +/* Macros for accessing the fields of r_info. */ +#define ELF64_R_SYM(info) ((info) >> 32) +#define ELF64_R_TYPE(info) ((info) & 0xffffffffL) + +/* Macro for constructing r_info from field values. */ +#define ELF64_R_INFO(sym, type) (((sym) << 32) + ((type) & 0xffffffffL)) + +#define ELF64_R_TYPE_DATA(info) (((Elf64_Xword)(info)<<32)>>40) +#define ELF64_R_TYPE_ID(info) (((Elf64_Xword)(info)<<56)>>56) +#define ELF64_R_TYPE_INFO(data, type) \ + (((Elf64_Xword)(data)<<8)+(Elf64_Xword)(type)) + +/* + * Note entry header + */ +typedef Elf_Note Elf64_Nhdr; + +/* + * Move entry + */ +typedef struct { + Elf64_Lword m_value; /* symbol value */ + Elf64_Xword m_info; /* size + index */ + Elf64_Xword m_poffset; /* symbol offset */ + Elf64_Half m_repeat; /* repeat count */ + Elf64_Half m_stride; /* stride info */ +} Elf64_Move; + +#define ELF64_M_SYM(info) ((info)>>8) +#define ELF64_M_SIZE(info) ((unsigned char)(info)) +#define ELF64_M_INFO(sym, size) (((sym)<<8)+(unsigned char)(size)) + +/* + * Hardware/Software capabilities entry + */ +typedef struct { + Elf64_Xword c_tag; /* how to interpret value */ + union { + Elf64_Xword c_val; + Elf64_Addr c_ptr; + } c_un; +} Elf64_Cap; + +/* + * Symbol table entries. + */ + +typedef struct { + Elf64_Word st_name; /* String table index of name. */ + unsigned char st_info; /* Type and binding information. */ + unsigned char st_other; /* Reserved (not used). */ + Elf64_Half st_shndx; /* Section index of symbol. */ + Elf64_Addr st_value; /* Symbol value. */ + Elf64_Xword st_size; /* Size of associated object. */ +} Elf64_Sym; + +/* Macros for accessing the fields of st_info. */ +#define ELF64_ST_BIND(info) ((info) >> 4) +#define ELF64_ST_TYPE(info) ((info) & 0xf) + +/* Macro for constructing st_info from field values. */ +#define ELF64_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) + +/* Macro for accessing the fields of st_other. */ +#define ELF64_ST_VISIBILITY(oth) ((oth) & 0x3) + +/* Structures used by Sun & GNU-style symbol versioning. */ +typedef struct { + Elf64_Half vd_version; + Elf64_Half vd_flags; + Elf64_Half vd_ndx; + Elf64_Half vd_cnt; + Elf64_Word vd_hash; + Elf64_Word vd_aux; + Elf64_Word vd_next; +} Elf64_Verdef; + +typedef struct { + Elf64_Word vda_name; + Elf64_Word vda_next; +} Elf64_Verdaux; + +typedef struct { + Elf64_Half vn_version; + Elf64_Half vn_cnt; + Elf64_Word vn_file; + Elf64_Word vn_aux; + Elf64_Word vn_next; +} Elf64_Verneed; + +typedef struct { + Elf64_Word vna_hash; + Elf64_Half vna_flags; + Elf64_Half vna_other; + Elf64_Word vna_name; + Elf64_Word vna_next; +} Elf64_Vernaux; + +typedef Elf64_Half Elf64_Versym; + +typedef struct { + Elf64_Half si_boundto; /* direct bindings - symbol bound to */ + Elf64_Half si_flags; /* per symbol flags */ +} Elf64_Syminfo; + +#endif /* !_SYS_ELF64_H_ */ diff --git a/src/coreclr/src/pal/src/libunwind_mac/include/freebsd-elf_common.h b/src/coreclr/src/pal/src/libunwind_mac/include/freebsd-elf_common.h new file mode 100644 index 000000000000..7aef2d49667e --- /dev/null +++ b/src/coreclr/src/pal/src/libunwind_mac/include/freebsd-elf_common.h @@ -0,0 +1,865 @@ +/*- + * Copyright (c) 1998 John D. Polstra. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/sys/sys/elf_common.h,v 1.24 2008/08/02 01:20:10 imp Exp $ + */ + +#ifndef _SYS_ELF_COMMON_H_ +#define _SYS_ELF_COMMON_H_ 1 + +/* + * ELF definitions that are independent of architecture or word size. + */ + +/* + * Note header. The ".note" section contains an array of notes. Each + * begins with this header, aligned to a word boundary. Immediately + * following the note header is n_namesz bytes of name, padded to the + * next word boundary. Then comes n_descsz bytes of descriptor, again + * padded to a word boundary. The values of n_namesz and n_descsz do + * not include the padding. + */ + +typedef struct { + uint32_t n_namesz; /* Length of name. */ + uint32_t n_descsz; /* Length of descriptor. */ + uint32_t n_type; /* Type of this note. */ +} Elf_Note; + +/* Indexes into the e_ident array. Keep synced with + http://www.sco.com/developers/gabi/latest/ch4.eheader.html */ +#define EI_MAG0 0 /* Magic number, byte 0. */ +#define EI_MAG1 1 /* Magic number, byte 1. */ +#define EI_MAG2 2 /* Magic number, byte 2. */ +#define EI_MAG3 3 /* Magic number, byte 3. */ +#define EI_CLASS 4 /* Class of machine. */ +#define EI_DATA 5 /* Data format. */ +#define EI_VERSION 6 /* ELF format version. */ +#define EI_OSABI 7 /* Operating system / ABI identification */ +#define EI_ABIVERSION 8 /* ABI version */ +#define OLD_EI_BRAND 8 /* Start of architecture identification. */ +#define EI_PAD 9 /* Start of padding (per SVR4 ABI). */ +#define EI_NIDENT 16 /* Size of e_ident array. */ + +/* Values for the magic number bytes. */ +#define ELFMAG0 0x7f +#define ELFMAG1 'E' +#define ELFMAG2 'L' +#define ELFMAG3 'F' +#define ELFMAG "\177ELF" /* magic string */ +#define SELFMAG 4 /* magic string size */ + +/* Values for e_ident[EI_VERSION] and e_version. */ +#define EV_NONE 0 +#define EV_CURRENT 1 + +/* Values for e_ident[EI_CLASS]. */ +#define ELFCLASSNONE 0 /* Unknown class. */ +#define ELFCLASS32 1 /* 32-bit architecture. */ +#define ELFCLASS64 2 /* 64-bit architecture. */ + +/* Values for e_ident[EI_DATA]. */ +#define ELFDATANONE 0 /* Unknown data format. */ +#define ELFDATA2LSB 1 /* 2's complement little-endian. */ +#define ELFDATA2MSB 2 /* 2's complement big-endian. */ + +/* Values for e_ident[EI_OSABI]. */ +#define ELFOSABI_NONE 0 /* UNIX System V ABI */ +#define ELFOSABI_HPUX 1 /* HP-UX operating system */ +#define ELFOSABI_NETBSD 2 /* NetBSD */ +#define ELFOSABI_LINUX 3 /* GNU/Linux */ +#define ELFOSABI_HURD 4 /* GNU/Hurd */ +#define ELFOSABI_86OPEN 5 /* 86Open common IA32 ABI */ +#define ELFOSABI_SOLARIS 6 /* Solaris */ +#define ELFOSABI_AIX 7 /* AIX */ +#define ELFOSABI_IRIX 8 /* IRIX */ +#define ELFOSABI_FREEBSD 9 /* FreeBSD */ +#define ELFOSABI_TRU64 10 /* TRU64 UNIX */ +#define ELFOSABI_MODESTO 11 /* Novell Modesto */ +#define ELFOSABI_OPENBSD 12 /* OpenBSD */ +#define ELFOSABI_OPENVMS 13 /* Open VMS */ +#define ELFOSABI_NSK 14 /* HP Non-Stop Kernel */ +#define ELFOSABI_ARM 97 /* ARM */ +#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ + +#define ELFOSABI_SYSV ELFOSABI_NONE /* symbol used in old spec */ +#define ELFOSABI_MONTEREY ELFOSABI_AIX /* Monterey */ + +/* e_ident */ +#define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \ + (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \ + (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \ + (ehdr).e_ident[EI_MAG3] == ELFMAG3) + +/* Values for e_type. */ +#define ET_NONE 0 /* Unknown type. */ +#define ET_REL 1 /* Relocatable. */ +#define ET_EXEC 2 /* Executable. */ +#define ET_DYN 3 /* Shared object. */ +#define ET_CORE 4 /* Core file. */ +#define ET_LOOS 0xfe00 /* First operating system specific. */ +#define ET_HIOS 0xfeff /* Last operating system-specific. */ +#define ET_LOPROC 0xff00 /* First processor-specific. */ +#define ET_HIPROC 0xffff /* Last processor-specific. */ + +/* Values for e_machine. */ +#define EM_NONE 0 /* Unknown machine. */ +#define EM_M32 1 /* AT&T WE32100. */ +#define EM_SPARC 2 /* Sun SPARC. */ +#define EM_386 3 /* Intel i386. */ +#define EM_68K 4 /* Motorola 68000. */ +#define EM_88K 5 /* Motorola 88000. */ +#define EM_860 7 /* Intel i860. */ +#define EM_MIPS 8 /* MIPS R3000 Big-Endian only. */ +#define EM_S370 9 /* IBM System/370. */ +#define EM_MIPS_RS3_LE 10 /* MIPS R3000 Little-Endian. */ +#define EM_PARISC 15 /* HP PA-RISC. */ +#define EM_VPP500 17 /* Fujitsu VPP500. */ +#define EM_SPARC32PLUS 18 /* SPARC v8plus. */ +#define EM_960 19 /* Intel 80960. */ +#define EM_PPC 20 /* PowerPC 32-bit. */ +#define EM_PPC64 21 /* PowerPC 64-bit. */ +#define EM_S390 22 /* IBM System/390. */ +#define EM_V800 36 /* NEC V800. */ +#define EM_FR20 37 /* Fujitsu FR20. */ +#define EM_RH32 38 /* TRW RH-32. */ +#define EM_RCE 39 /* Motorola RCE. */ +#define EM_ARM 40 /* ARM. */ +#define EM_SH 42 /* Hitachi SH. */ +#define EM_SPARCV9 43 /* SPARC v9 64-bit. */ +#define EM_TRICORE 44 /* Siemens TriCore embedded processor. */ +#define EM_ARC 45 /* Argonaut RISC Core. */ +#define EM_H8_300 46 /* Hitachi H8/300. */ +#define EM_H8_300H 47 /* Hitachi H8/300H. */ +#define EM_H8S 48 /* Hitachi H8S. */ +#define EM_H8_500 49 /* Hitachi H8/500. */ +#define EM_IA_64 50 /* Intel IA-64 Processor. */ +#define EM_MIPS_X 51 /* Stanford MIPS-X. */ +#define EM_COLDFIRE 52 /* Motorola ColdFire. */ +#define EM_68HC12 53 /* Motorola M68HC12. */ +#define EM_MMA 54 /* Fujitsu MMA. */ +#define EM_PCP 55 /* Siemens PCP. */ +#define EM_NCPU 56 /* Sony nCPU. */ +#define EM_NDR1 57 /* Denso NDR1 microprocessor. */ +#define EM_STARCORE 58 /* Motorola Star*Core processor. */ +#define EM_ME16 59 /* Toyota ME16 processor. */ +#define EM_ST100 60 /* STMicroelectronics ST100 processor. */ +#define EM_TINYJ 61 /* Advanced Logic Corp. TinyJ processor. */ +#define EM_X86_64 62 /* Advanced Micro Devices x86-64 */ +#define EM_AMD64 EM_X86_64 /* Advanced Micro Devices x86-64 (compat) */ + +/* Non-standard or deprecated. */ +#define EM_486 6 /* Intel i486. */ +#define EM_MIPS_RS4_BE 10 /* MIPS R4000 Big-Endian */ +#define EM_ALPHA_STD 41 /* Digital Alpha (standard value). */ +#define EM_ALPHA 0x9026 /* Alpha (written in the absence of an ABI) */ + +/* Special section indexes. */ +#define SHN_UNDEF 0 /* Undefined, missing, irrelevant. */ +#define SHN_LORESERVE 0xff00 /* First of reserved range. */ +#define SHN_LOPROC 0xff00 /* First processor-specific. */ +#define SHN_HIPROC 0xff1f /* Last processor-specific. */ +#define SHN_LOOS 0xff20 /* First operating system-specific. */ +#define SHN_HIOS 0xff3f /* Last operating system-specific. */ +#define SHN_ABS 0xfff1 /* Absolute values. */ +#define SHN_COMMON 0xfff2 /* Common data. */ +#define SHN_XINDEX 0xffff /* Escape -- index stored elsewhere. */ +#define SHN_HIRESERVE 0xffff /* Last of reserved range. */ + +/* sh_type */ +#define SHT_NULL 0 /* inactive */ +#define SHT_PROGBITS 1 /* program defined information */ +#define SHT_SYMTAB 2 /* symbol table section */ +#define SHT_STRTAB 3 /* string table section */ +#define SHT_RELA 4 /* relocation section with addends */ +#define SHT_HASH 5 /* symbol hash table section */ +#define SHT_DYNAMIC 6 /* dynamic section */ +#define SHT_NOTE 7 /* note section */ +#define SHT_NOBITS 8 /* no space section */ +#define SHT_REL 9 /* relocation section - no addends */ +#define SHT_SHLIB 10 /* reserved - purpose unknown */ +#define SHT_DYNSYM 11 /* dynamic symbol table section */ +#define SHT_INIT_ARRAY 14 /* Initialization function pointers. */ +#define SHT_FINI_ARRAY 15 /* Termination function pointers. */ +#define SHT_PREINIT_ARRAY 16 /* Pre-initialization function ptrs. */ +#define SHT_GROUP 17 /* Section group. */ +#define SHT_SYMTAB_SHNDX 18 /* Section indexes (see SHN_XINDEX). */ +#define SHT_LOOS 0x60000000 /* First of OS specific semantics */ +#define SHT_LOSUNW 0x6ffffff4 +#define SHT_SUNW_dof 0x6ffffff4 +#define SHT_SUNW_cap 0x6ffffff5 +#define SHT_SUNW_SIGNATURE 0x6ffffff6 +#define SHT_SUNW_ANNOTATE 0x6ffffff7 +#define SHT_SUNW_DEBUGSTR 0x6ffffff8 +#define SHT_SUNW_DEBUG 0x6ffffff9 +#define SHT_SUNW_move 0x6ffffffa +#define SHT_SUNW_COMDAT 0x6ffffffb +#define SHT_SUNW_syminfo 0x6ffffffc +#define SHT_SUNW_verdef 0x6ffffffd +#define SHT_GNU_verdef 0x6ffffffd /* Symbol versions provided */ +#define SHT_SUNW_verneed 0x6ffffffe +#define SHT_GNU_verneed 0x6ffffffe /* Symbol versions required */ +#define SHT_SUNW_versym 0x6fffffff +#define SHT_GNU_versym 0x6fffffff /* Symbol version table */ +#define SHT_HISUNW 0x6fffffff +#define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */ +#define SHT_LOPROC 0x70000000 /* reserved range for processor */ +#define SHT_AMD64_UNWIND 0x70000001 /* unwind information */ +#define SHT_HIPROC 0x7fffffff /* specific section header types */ +#define SHT_LOUSER 0x80000000 /* reserved range for application */ +#define SHT_HIUSER 0xffffffff /* specific indexes */ + +/* Flags for sh_flags. */ +#define SHF_WRITE 0x1 /* Section contains writable data. */ +#define SHF_ALLOC 0x2 /* Section occupies memory. */ +#define SHF_EXECINSTR 0x4 /* Section contains instructions. */ +#define SHF_MERGE 0x10 /* Section may be merged. */ +#define SHF_STRINGS 0x20 /* Section contains strings. */ +#define SHF_INFO_LINK 0x40 /* sh_info holds section index. */ +#define SHF_LINK_ORDER 0x80 /* Special ordering requirements. */ +#define SHF_OS_NONCONFORMING 0x100 /* OS-specific processing required. */ +#define SHF_GROUP 0x200 /* Member of section group. */ +#define SHF_TLS 0x400 /* Section contains TLS data. */ +#define SHF_MASKOS 0x0ff00000 /* OS-specific semantics. */ +#define SHF_MASKPROC 0xf0000000 /* Processor-specific semantics. */ + +/* Values for p_type. */ +#define PT_NULL 0 /* Unused entry. */ +#define PT_LOAD 1 /* Loadable segment. */ +#define PT_DYNAMIC 2 /* Dynamic linking information segment. */ +#define PT_INTERP 3 /* Pathname of interpreter. */ +#define PT_NOTE 4 /* Auxiliary information. */ +#define PT_SHLIB 5 /* Reserved (not used). */ +#define PT_PHDR 6 /* Location of program header itself. */ +#define PT_TLS 7 /* Thread local storage segment */ +#define PT_LOOS 0x60000000 /* First OS-specific. */ +#define PT_SUNW_UNWIND 0x6464e550 /* amd64 UNWIND program header */ +#define PT_GNU_EH_FRAME 0x6474e550 +#define PT_GNU_STACK 0x6474e551 +#define PT_LOSUNW 0x6ffffffa +#define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ +#define PT_SUNWSTACK 0x6ffffffb /* describes the stack segment */ +#define PT_SUNWDTRACE 0x6ffffffc /* private */ +#define PT_SUNWCAP 0x6ffffffd /* hard/soft capabilities segment */ +#define PT_HISUNW 0x6fffffff +#define PT_HIOS 0x6fffffff /* Last OS-specific. */ +#define PT_LOPROC 0x70000000 /* First processor-specific type. */ +#define PT_HIPROC 0x7fffffff /* Last processor-specific type. */ + +/* Values for p_flags. */ +#define PF_X 0x1 /* Executable. */ +#define PF_W 0x2 /* Writable. */ +#define PF_R 0x4 /* Readable. */ +#define PF_MASKOS 0x0ff00000 /* Operating system-specific. */ +#define PF_MASKPROC 0xf0000000 /* Processor-specific. */ + +/* Extended program header index. */ +#define PN_XNUM 0xffff + +/* Values for d_tag. */ +#define DT_NULL 0 /* Terminating entry. */ +#define DT_NEEDED 1 /* String table offset of a needed shared + library. */ +#define DT_PLTRELSZ 2 /* Total size in bytes of PLT relocations. */ +#define DT_PLTGOT 3 /* Processor-dependent address. */ +#define DT_HASH 4 /* Address of symbol hash table. */ +#define DT_STRTAB 5 /* Address of string table. */ +#define DT_SYMTAB 6 /* Address of symbol table. */ +#define DT_RELA 7 /* Address of ElfNN_Rela relocations. */ +#define DT_RELASZ 8 /* Total size of ElfNN_Rela relocations. */ +#define DT_RELAENT 9 /* Size of each ElfNN_Rela relocation entry. */ +#define DT_STRSZ 10 /* Size of string table. */ +#define DT_SYMENT 11 /* Size of each symbol table entry. */ +#define DT_INIT 12 /* Address of initialization function. */ +#define DT_FINI 13 /* Address of finalization function. */ +#define DT_SONAME 14 /* String table offset of shared object + name. */ +#define DT_RPATH 15 /* String table offset of library path. [sup] */ +#define DT_SYMBOLIC 16 /* Indicates "symbolic" linking. [sup] */ +#define DT_REL 17 /* Address of ElfNN_Rel relocations. */ +#define DT_RELSZ 18 /* Total size of ElfNN_Rel relocations. */ +#define DT_RELENT 19 /* Size of each ElfNN_Rel relocation. */ +#define DT_PLTREL 20 /* Type of relocation used for PLT. */ +#define DT_DEBUG 21 /* Reserved (not used). */ +#define DT_TEXTREL 22 /* Indicates there may be relocations in + non-writable segments. [sup] */ +#define DT_JMPREL 23 /* Address of PLT relocations. */ +#define DT_BIND_NOW 24 /* [sup] */ +#define DT_INIT_ARRAY 25 /* Address of the array of pointers to + initialization functions */ +#define DT_FINI_ARRAY 26 /* Address of the array of pointers to + termination functions */ +#define DT_INIT_ARRAYSZ 27 /* Size in bytes of the array of + initialization functions. */ +#define DT_FINI_ARRAYSZ 28 /* Size in bytes of the array of + terminationfunctions. */ +#define DT_RUNPATH 29 /* String table offset of a null-terminated + library search path string. */ +#define DT_FLAGS 30 /* Object specific flag values. */ +#define DT_ENCODING 32 /* Values greater than or equal to DT_ENCODING + and less than DT_LOOS follow the rules for + the interpretation of the d_un union + as follows: even == 'd_ptr', even == 'd_val' + or none */ +#define DT_PREINIT_ARRAY 32 /* Address of the array of pointers to + pre-initialization functions. */ +#define DT_PREINIT_ARRAYSZ 33 /* Size in bytes of the array of + pre-initialization functions. */ +#define DT_MAXPOSTAGS 34 /* number of positive tags */ +#define DT_LOOS 0x6000000d /* First OS-specific */ +#define DT_SUNW_AUXILIARY 0x6000000d /* symbol auxiliary name */ +#define DT_SUNW_RTLDINF 0x6000000e /* ld.so.1 info (private) */ +#define DT_SUNW_FILTER 0x6000000f /* symbol filter name */ +#define DT_SUNW_CAP 0x60000010 /* hardware/software */ +#define DT_HIOS 0x6ffff000 /* Last OS-specific */ + +/* + * DT_* entries which fall between DT_VALRNGHI & DT_VALRNGLO use the + * Dyn.d_un.d_val field of the Elf*_Dyn structure. + */ +#define DT_VALRNGLO 0x6ffffd00 +#define DT_CHECKSUM 0x6ffffdf8 /* elf checksum */ +#define DT_PLTPADSZ 0x6ffffdf9 /* pltpadding size */ +#define DT_MOVEENT 0x6ffffdfa /* move table entry size */ +#define DT_MOVESZ 0x6ffffdfb /* move table size */ +#define DT_FEATURE_1 0x6ffffdfc /* feature holder */ +#define DT_POSFLAG_1 0x6ffffdfd /* flags for DT_* entries, effecting */ + /* the following DT_* entry. */ + /* See DF_P1_* definitions */ +#define DT_SYMINSZ 0x6ffffdfe /* syminfo table size (in bytes) */ +#define DT_SYMINENT 0x6ffffdff /* syminfo entry size (in bytes) */ +#define DT_VALRNGHI 0x6ffffdff + +/* + * DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the + * Dyn.d_un.d_ptr field of the Elf*_Dyn structure. + * + * If any adjustment is made to the ELF object after it has been + * built, these entries will need to be adjusted. + */ +#define DT_ADDRRNGLO 0x6ffffe00 +#define DT_CONFIG 0x6ffffefa /* configuration information */ +#define DT_DEPAUDIT 0x6ffffefb /* dependency auditing */ +#define DT_AUDIT 0x6ffffefc /* object auditing */ +#define DT_PLTPAD 0x6ffffefd /* pltpadding (sparcv9) */ +#define DT_MOVETAB 0x6ffffefe /* move table */ +#define DT_SYMINFO 0x6ffffeff /* syminfo table */ +#define DT_ADDRRNGHI 0x6ffffeff + +#define DT_VERSYM 0x6ffffff0 /* Address of versym section. */ +#define DT_RELACOUNT 0x6ffffff9 /* number of RELATIVE relocations */ +#define DT_RELCOUNT 0x6ffffffa /* number of RELATIVE relocations */ +#define DT_FLAGS_1 0x6ffffffb /* state flags - see DF_1_* defs */ +#define DT_VERDEF 0x6ffffffc /* Address of verdef section. */ +#define DT_VERDEFNUM 0x6ffffffd /* Number of elems in verdef section */ +#define DT_VERNEED 0x6ffffffe /* Address of verneed section. */ +#define DT_VERNEEDNUM 0x6fffffff /* Number of elems in verneed section */ + +#define DT_LOPROC 0x70000000 /* First processor-specific type. */ +#define DT_DEPRECATED_SPARC_REGISTER 0x7000001 +#define DT_AUXILIARY 0x7ffffffd /* shared library auxiliary name */ +#define DT_USED 0x7ffffffe /* ignored - same as needed */ +#define DT_FILTER 0x7fffffff /* shared library filter name */ +#define DT_HIPROC 0x7fffffff /* Last processor-specific type. */ + +/* Values for DT_FLAGS */ +#define DF_ORIGIN 0x0001 /* Indicates that the object being loaded may + make reference to the $ORIGIN substitution + string */ +#define DF_SYMBOLIC 0x0002 /* Indicates "symbolic" linking. */ +#define DF_TEXTREL 0x0004 /* Indicates there may be relocations in + non-writable segments. */ +#define DF_BIND_NOW 0x0008 /* Indicates that the dynamic linker should + process all relocations for the object + containing this entry before transferring + control to the program. */ +#define DF_STATIC_TLS 0x0010 /* Indicates that the shared object or + executable contains code using a static + thread-local storage scheme. */ + +/* Values for n_type. Used in core files. */ +#define NT_PRSTATUS 1 /* Process status. */ +#define NT_FPREGSET 2 /* Floating point registers. */ +#define NT_PRPSINFO 3 /* Process state info. */ + +/* Symbol Binding - ELFNN_ST_BIND - st_info */ +#define STB_LOCAL 0 /* Local symbol */ +#define STB_GLOBAL 1 /* Global symbol */ +#define STB_WEAK 2 /* like global - lower precedence */ +#define STB_LOOS 10 /* Reserved range for operating system */ +#define STB_HIOS 12 /* specific semantics. */ +#define STB_LOPROC 13 /* reserved range for processor */ +#define STB_HIPROC 15 /* specific semantics. */ + +/* Symbol type - ELFNN_ST_TYPE - st_info */ +#define STT_NOTYPE 0 /* Unspecified type. */ +#define STT_OBJECT 1 /* Data object. */ +#define STT_FUNC 2 /* Function. */ +#define STT_SECTION 3 /* Section. */ +#define STT_FILE 4 /* Source file. */ +#define STT_COMMON 5 /* Uninitialized common block. */ +#define STT_TLS 6 /* TLS object. */ +#define STT_NUM 7 +#define STT_LOOS 10 /* Reserved range for operating system */ +#define STT_HIOS 12 /* specific semantics. */ +#define STT_LOPROC 13 /* reserved range for processor */ +#define STT_HIPROC 15 /* specific semantics. */ + +/* Symbol visibility - ELFNN_ST_VISIBILITY - st_other */ +#define STV_DEFAULT 0x0 /* Default visibility (see binding). */ +#define STV_INTERNAL 0x1 /* Special meaning in relocatable objects. */ +#define STV_HIDDEN 0x2 /* Not visible. */ +#define STV_PROTECTED 0x3 /* Visible but not preemptible. */ +#define STV_EXPORTED 0x4 +#define STV_SINGLETON 0x5 +#define STV_ELIMINATE 0x6 + +/* Special symbol table indexes. */ +#define STN_UNDEF 0 /* Undefined symbol index. */ + +/* Symbol versioning flags. */ +#define VER_DEF_CURRENT 1 +#define VER_DEF_IDX(x) VER_NDX(x) + +#define VER_FLG_BASE 0x01 +#define VER_FLG_WEAK 0x02 + +#define VER_NEED_CURRENT 1 +#define VER_NEED_WEAK (1u << 15) +#define VER_NEED_HIDDEN VER_NDX_HIDDEN +#define VER_NEED_IDX(x) VER_NDX(x) + +#define VER_NDX_LOCAL 0 +#define VER_NDX_GLOBAL 1 +#define VER_NDX_GIVEN 2 + +#define VER_NDX_HIDDEN (1u << 15) +#define VER_NDX(x) ((x) & ~(1u << 15)) + +#define CA_SUNW_NULL 0 +#define CA_SUNW_HW_1 1 /* first hardware capabilities entry */ +#define CA_SUNW_SF_1 2 /* first software capabilities entry */ + +/* + * Syminfo flag values + */ +#define SYMINFO_FLG_DIRECT 0x0001 /* symbol ref has direct association */ + /* to object containing defn. */ +#define SYMINFO_FLG_PASSTHRU 0x0002 /* ignored - see SYMINFO_FLG_FILTER */ +#define SYMINFO_FLG_COPY 0x0004 /* symbol is a copy-reloc */ +#define SYMINFO_FLG_LAZYLOAD 0x0008 /* object containing defn should be */ + /* lazily-loaded */ +#define SYMINFO_FLG_DIRECTBIND 0x0010 /* ref should be bound directly to */ + /* object containing defn. */ +#define SYMINFO_FLG_NOEXTDIRECT 0x0020 /* don't let an external reference */ + /* directly bind to this symbol */ +#define SYMINFO_FLG_FILTER 0x0002 /* symbol ref is associated to a */ +#define SYMINFO_FLG_AUXILIARY 0x0040 /* standard or auxiliary filter */ + +/* + * Syminfo.si_boundto values. + */ +#define SYMINFO_BT_SELF 0xffff /* symbol bound to self */ +#define SYMINFO_BT_PARENT 0xfffe /* symbol bound to parent */ +#define SYMINFO_BT_NONE 0xfffd /* no special symbol binding */ +#define SYMINFO_BT_EXTERN 0xfffc /* symbol defined as external */ +#define SYMINFO_BT_LOWRESERVE 0xff00 /* beginning of reserved entries */ + +/* + * Syminfo version values. + */ +#define SYMINFO_NONE 0 /* Syminfo version */ +#define SYMINFO_CURRENT 1 +#define SYMINFO_NUM 2 + +/* + * Relocation types. + * + * All machine architectures are defined here to allow tools on one to + * handle others. + */ + +#define R_386_NONE 0 /* No relocation. */ +#define R_386_32 1 /* Add symbol value. */ +#define R_386_PC32 2 /* Add PC-relative symbol value. */ +#define R_386_GOT32 3 /* Add PC-relative GOT offset. */ +#define R_386_PLT32 4 /* Add PC-relative PLT offset. */ +#define R_386_COPY 5 /* Copy data from shared object. */ +#define R_386_GLOB_DAT 6 /* Set GOT entry to data address. */ +#define R_386_JMP_SLOT 7 /* Set GOT entry to code address. */ +#define R_386_RELATIVE 8 /* Add load address of shared object. */ +#define R_386_GOTOFF 9 /* Add GOT-relative symbol address. */ +#define R_386_GOTPC 10 /* Add PC-relative GOT table address. */ +#define R_386_TLS_TPOFF 14 /* Negative offset in static TLS block */ +#define R_386_TLS_IE 15 /* Absolute address of GOT for -ve static TLS */ +#define R_386_TLS_GOTIE 16 /* GOT entry for negative static TLS block */ +#define R_386_TLS_LE 17 /* Negative offset relative to static TLS */ +#define R_386_TLS_GD 18 /* 32 bit offset to GOT (index,off) pair */ +#define R_386_TLS_LDM 19 /* 32 bit offset to GOT (index,zero) pair */ +#define R_386_TLS_GD_32 24 /* 32 bit offset to GOT (index,off) pair */ +#define R_386_TLS_GD_PUSH 25 /* pushl instruction for Sun ABI GD sequence */ +#define R_386_TLS_GD_CALL 26 /* call instruction for Sun ABI GD sequence */ +#define R_386_TLS_GD_POP 27 /* popl instruction for Sun ABI GD sequence */ +#define R_386_TLS_LDM_32 28 /* 32 bit offset to GOT (index,zero) pair */ +#define R_386_TLS_LDM_PUSH 29 /* pushl instruction for Sun ABI LD sequence */ +#define R_386_TLS_LDM_CALL 30 /* call instruction for Sun ABI LD sequence */ +#define R_386_TLS_LDM_POP 31 /* popl instruction for Sun ABI LD sequence */ +#define R_386_TLS_LDO_32 32 /* 32 bit offset from start of TLS block */ +#define R_386_TLS_IE_32 33 /* 32 bit offset to GOT static TLS offset entry */ +#define R_386_TLS_LE_32 34 /* 32 bit offset within static TLS block */ +#define R_386_TLS_DTPMOD32 35 /* GOT entry containing TLS index */ +#define R_386_TLS_DTPOFF32 36 /* GOT entry containing TLS offset */ +#define R_386_TLS_TPOFF32 37 /* GOT entry of -ve static TLS offset */ + +#define R_ARM_NONE 0 /* No relocation. */ +#define R_ARM_PC24 1 +#define R_ARM_ABS32 2 +#define R_ARM_REL32 3 +#define R_ARM_PC13 4 +#define R_ARM_ABS16 5 +#define R_ARM_ABS12 6 +#define R_ARM_THM_ABS5 7 +#define R_ARM_ABS8 8 +#define R_ARM_SBREL32 9 +#define R_ARM_THM_PC22 10 +#define R_ARM_THM_PC8 11 +#define R_ARM_AMP_VCALL9 12 +#define R_ARM_SWI24 13 +#define R_ARM_THM_SWI8 14 +#define R_ARM_XPC25 15 +#define R_ARM_THM_XPC22 16 +#define R_ARM_COPY 20 /* Copy data from shared object. */ +#define R_ARM_GLOB_DAT 21 /* Set GOT entry to data address. */ +#define R_ARM_JUMP_SLOT 22 /* Set GOT entry to code address. */ +#define R_ARM_RELATIVE 23 /* Add load address of shared object. */ +#define R_ARM_GOTOFF 24 /* Add GOT-relative symbol address. */ +#define R_ARM_GOTPC 25 /* Add PC-relative GOT table address. */ +#define R_ARM_GOT32 26 /* Add PC-relative GOT offset. */ +#define R_ARM_PLT32 27 /* Add PC-relative PLT offset. */ +#define R_ARM_GNU_VTENTRY 100 +#define R_ARM_GNU_VTINHERIT 101 +#define R_ARM_RSBREL32 250 +#define R_ARM_THM_RPC22 251 +#define R_ARM_RREL32 252 +#define R_ARM_RABS32 253 +#define R_ARM_RPC24 254 +#define R_ARM_RBASE 255 + +/* Name Value Field Calculation */ +#define R_IA_64_NONE 0 /* None */ +#define R_IA_64_IMM14 0x21 /* immediate14 S + A */ +#define R_IA_64_IMM22 0x22 /* immediate22 S + A */ +#define R_IA_64_IMM64 0x23 /* immediate64 S + A */ +#define R_IA_64_DIR32MSB 0x24 /* word32 MSB S + A */ +#define R_IA_64_DIR32LSB 0x25 /* word32 LSB S + A */ +#define R_IA_64_DIR64MSB 0x26 /* word64 MSB S + A */ +#define R_IA_64_DIR64LSB 0x27 /* word64 LSB S + A */ +#define R_IA_64_GPREL22 0x2a /* immediate22 @gprel(S + A) */ +#define R_IA_64_GPREL64I 0x2b /* immediate64 @gprel(S + A) */ +#define R_IA_64_GPREL32MSB 0x2c /* word32 MSB @gprel(S + A) */ +#define R_IA_64_GPREL32LSB 0x2d /* word32 LSB @gprel(S + A) */ +#define R_IA_64_GPREL64MSB 0x2e /* word64 MSB @gprel(S + A) */ +#define R_IA_64_GPREL64LSB 0x2f /* word64 LSB @gprel(S + A) */ +#define R_IA_64_LTOFF22 0x32 /* immediate22 @ltoff(S + A) */ +#define R_IA_64_LTOFF64I 0x33 /* immediate64 @ltoff(S + A) */ +#define R_IA_64_PLTOFF22 0x3a /* immediate22 @pltoff(S + A) */ +#define R_IA_64_PLTOFF64I 0x3b /* immediate64 @pltoff(S + A) */ +#define R_IA_64_PLTOFF64MSB 0x3e /* word64 MSB @pltoff(S + A) */ +#define R_IA_64_PLTOFF64LSB 0x3f /* word64 LSB @pltoff(S + A) */ +#define R_IA_64_FPTR64I 0x43 /* immediate64 @fptr(S + A) */ +#define R_IA_64_FPTR32MSB 0x44 /* word32 MSB @fptr(S + A) */ +#define R_IA_64_FPTR32LSB 0x45 /* word32 LSB @fptr(S + A) */ +#define R_IA_64_FPTR64MSB 0x46 /* word64 MSB @fptr(S + A) */ +#define R_IA_64_FPTR64LSB 0x47 /* word64 LSB @fptr(S + A) */ +#define R_IA_64_PCREL60B 0x48 /* immediate60 form1 S + A - P */ +#define R_IA_64_PCREL21B 0x49 /* immediate21 form1 S + A - P */ +#define R_IA_64_PCREL21M 0x4a /* immediate21 form2 S + A - P */ +#define R_IA_64_PCREL21F 0x4b /* immediate21 form3 S + A - P */ +#define R_IA_64_PCREL32MSB 0x4c /* word32 MSB S + A - P */ +#define R_IA_64_PCREL32LSB 0x4d /* word32 LSB S + A - P */ +#define R_IA_64_PCREL64MSB 0x4e /* word64 MSB S + A - P */ +#define R_IA_64_PCREL64LSB 0x4f /* word64 LSB S + A - P */ +#define R_IA_64_LTOFF_FPTR22 0x52 /* immediate22 @ltoff(@fptr(S + A)) */ +#define R_IA_64_LTOFF_FPTR64I 0x53 /* immediate64 @ltoff(@fptr(S + A)) */ +#define R_IA_64_LTOFF_FPTR32MSB 0x54 /* word32 MSB @ltoff(@fptr(S + A)) */ +#define R_IA_64_LTOFF_FPTR32LSB 0x55 /* word32 LSB @ltoff(@fptr(S + A)) */ +#define R_IA_64_LTOFF_FPTR64MSB 0x56 /* word64 MSB @ltoff(@fptr(S + A)) */ +#define R_IA_64_LTOFF_FPTR64LSB 0x57 /* word64 LSB @ltoff(@fptr(S + A)) */ +#define R_IA_64_SEGREL32MSB 0x5c /* word32 MSB @segrel(S + A) */ +#define R_IA_64_SEGREL32LSB 0x5d /* word32 LSB @segrel(S + A) */ +#define R_IA_64_SEGREL64MSB 0x5e /* word64 MSB @segrel(S + A) */ +#define R_IA_64_SEGREL64LSB 0x5f /* word64 LSB @segrel(S + A) */ +#define R_IA_64_SECREL32MSB 0x64 /* word32 MSB @secrel(S + A) */ +#define R_IA_64_SECREL32LSB 0x65 /* word32 LSB @secrel(S + A) */ +#define R_IA_64_SECREL64MSB 0x66 /* word64 MSB @secrel(S + A) */ +#define R_IA_64_SECREL64LSB 0x67 /* word64 LSB @secrel(S + A) */ +#define R_IA_64_REL32MSB 0x6c /* word32 MSB BD + A */ +#define R_IA_64_REL32LSB 0x6d /* word32 LSB BD + A */ +#define R_IA_64_REL64MSB 0x6e /* word64 MSB BD + A */ +#define R_IA_64_REL64LSB 0x6f /* word64 LSB BD + A */ +#define R_IA_64_LTV32MSB 0x74 /* word32 MSB S + A */ +#define R_IA_64_LTV32LSB 0x75 /* word32 LSB S + A */ +#define R_IA_64_LTV64MSB 0x76 /* word64 MSB S + A */ +#define R_IA_64_LTV64LSB 0x77 /* word64 LSB S + A */ +#define R_IA_64_PCREL21BI 0x79 /* immediate21 form1 S + A - P */ +#define R_IA_64_PCREL22 0x7a /* immediate22 S + A - P */ +#define R_IA_64_PCREL64I 0x7b /* immediate64 S + A - P */ +#define R_IA_64_IPLTMSB 0x80 /* function descriptor MSB special */ +#define R_IA_64_IPLTLSB 0x81 /* function descriptor LSB speciaal */ +#define R_IA_64_SUB 0x85 /* immediate64 A - S */ +#define R_IA_64_LTOFF22X 0x86 /* immediate22 special */ +#define R_IA_64_LDXMOV 0x87 /* immediate22 special */ +#define R_IA_64_TPREL14 0x91 /* imm14 @tprel(S + A) */ +#define R_IA_64_TPREL22 0x92 /* imm22 @tprel(S + A) */ +#define R_IA_64_TPREL64I 0x93 /* imm64 @tprel(S + A) */ +#define R_IA_64_TPREL64MSB 0x96 /* word64 MSB @tprel(S + A) */ +#define R_IA_64_TPREL64LSB 0x97 /* word64 LSB @tprel(S + A) */ +#define R_IA_64_LTOFF_TPREL22 0x9a /* imm22 @ltoff(@tprel(S+A)) */ +#define R_IA_64_DTPMOD64MSB 0xa6 /* word64 MSB @dtpmod(S + A) */ +#define R_IA_64_DTPMOD64LSB 0xa7 /* word64 LSB @dtpmod(S + A) */ +#define R_IA_64_LTOFF_DTPMOD22 0xaa /* imm22 @ltoff(@dtpmod(S+A)) */ +#define R_IA_64_DTPREL14 0xb1 /* imm14 @dtprel(S + A) */ +#define R_IA_64_DTPREL22 0xb2 /* imm22 @dtprel(S + A) */ +#define R_IA_64_DTPREL64I 0xb3 /* imm64 @dtprel(S + A) */ +#define R_IA_64_DTPREL32MSB 0xb4 /* word32 MSB @dtprel(S + A) */ +#define R_IA_64_DTPREL32LSB 0xb5 /* word32 LSB @dtprel(S + A) */ +#define R_IA_64_DTPREL64MSB 0xb6 /* word64 MSB @dtprel(S + A) */ +#define R_IA_64_DTPREL64LSB 0xb7 /* word64 LSB @dtprel(S + A) */ +#define R_IA_64_LTOFF_DTPREL22 0xba /* imm22 @ltoff(@dtprel(S+A)) */ + +#define R_MIPS_NONE 0 /* No reloc */ +#define R_MIPS_16 1 /* Direct 16 bit */ +#define R_MIPS_32 2 /* Direct 32 bit */ +#define R_MIPS_REL32 3 /* PC relative 32 bit */ +#define R_MIPS_26 4 /* Direct 26 bit shifted */ +#define R_MIPS_HI16 5 /* High 16 bit */ +#define R_MIPS_LO16 6 /* Low 16 bit */ +#define R_MIPS_GPREL16 7 /* GP relative 16 bit */ +#define R_MIPS_LITERAL 8 /* 16 bit literal entry */ +#define R_MIPS_GOT16 9 /* 16 bit GOT entry */ +#define R_MIPS_PC16 10 /* PC relative 16 bit */ +#define R_MIPS_CALL16 11 /* 16 bit GOT entry for function */ +#define R_MIPS_GPREL32 12 /* GP relative 32 bit */ +#define R_MIPS_GOTHI16 21 /* GOT HI 16 bit */ +#define R_MIPS_GOTLO16 22 /* GOT LO 16 bit */ +#define R_MIPS_CALLHI16 30 /* upper 16 bit GOT entry for function */ +#define R_MIPS_CALLLO16 31 /* lower 16 bit GOT entry for function */ + +#define R_PPC_NONE 0 /* No relocation. */ +#define R_PPC_ADDR32 1 +#define R_PPC_ADDR24 2 +#define R_PPC_ADDR16 3 +#define R_PPC_ADDR16_LO 4 +#define R_PPC_ADDR16_HI 5 +#define R_PPC_ADDR16_HA 6 +#define R_PPC_ADDR14 7 +#define R_PPC_ADDR14_BRTAKEN 8 +#define R_PPC_ADDR14_BRNTAKEN 9 +#define R_PPC_REL24 10 +#define R_PPC_REL14 11 +#define R_PPC_REL14_BRTAKEN 12 +#define R_PPC_REL14_BRNTAKEN 13 +#define R_PPC_GOT16 14 +#define R_PPC_GOT16_LO 15 +#define R_PPC_GOT16_HI 16 +#define R_PPC_GOT16_HA 17 +#define R_PPC_PLTREL24 18 +#define R_PPC_COPY 19 +#define R_PPC_GLOB_DAT 20 +#define R_PPC_JMP_SLOT 21 +#define R_PPC_RELATIVE 22 +#define R_PPC_LOCAL24PC 23 +#define R_PPC_UADDR32 24 +#define R_PPC_UADDR16 25 +#define R_PPC_REL32 26 +#define R_PPC_PLT32 27 +#define R_PPC_PLTREL32 28 +#define R_PPC_PLT16_LO 29 +#define R_PPC_PLT16_HI 30 +#define R_PPC_PLT16_HA 31 +#define R_PPC_SDAREL16 32 +#define R_PPC_SECTOFF 33 +#define R_PPC_SECTOFF_LO 34 +#define R_PPC_SECTOFF_HI 35 +#define R_PPC_SECTOFF_HA 36 + +/* + * TLS relocations + */ +#define R_PPC_TLS 67 +#define R_PPC_DTPMOD32 68 +#define R_PPC_TPREL16 69 +#define R_PPC_TPREL16_LO 70 +#define R_PPC_TPREL16_HI 71 +#define R_PPC_TPREL16_HA 72 +#define R_PPC_TPREL32 73 +#define R_PPC_DTPREL16 74 +#define R_PPC_DTPREL16_LO 75 +#define R_PPC_DTPREL16_HI 76 +#define R_PPC_DTPREL16_HA 77 +#define R_PPC_DTPREL32 78 +#define R_PPC_GOT_TLSGD16 79 +#define R_PPC_GOT_TLSGD16_LO 80 +#define R_PPC_GOT_TLSGD16_HI 81 +#define R_PPC_GOT_TLSGD16_HA 82 +#define R_PPC_GOT_TLSLD16 83 +#define R_PPC_GOT_TLSLD16_LO 84 +#define R_PPC_GOT_TLSLD16_HI 85 +#define R_PPC_GOT_TLSLD16_HA 86 +#define R_PPC_GOT_TPREL16 87 +#define R_PPC_GOT_TPREL16_LO 88 +#define R_PPC_GOT_TPREL16_HI 89 +#define R_PPC_GOT_TPREL16_HA 90 + +/* + * The remaining relocs are from the Embedded ELF ABI, and are not in the + * SVR4 ELF ABI. + */ + +#define R_PPC_EMB_NADDR32 101 +#define R_PPC_EMB_NADDR16 102 +#define R_PPC_EMB_NADDR16_LO 103 +#define R_PPC_EMB_NADDR16_HI 104 +#define R_PPC_EMB_NADDR16_HA 105 +#define R_PPC_EMB_SDAI16 106 +#define R_PPC_EMB_SDA2I16 107 +#define R_PPC_EMB_SDA2REL 108 +#define R_PPC_EMB_SDA21 109 +#define R_PPC_EMB_MRKREF 110 +#define R_PPC_EMB_RELSEC16 111 +#define R_PPC_EMB_RELST_LO 112 +#define R_PPC_EMB_RELST_HI 113 +#define R_PPC_EMB_RELST_HA 114 +#define R_PPC_EMB_BIT_FLD 115 +#define R_PPC_EMB_RELSDA 116 + +#define R_SPARC_NONE 0 +#define R_SPARC_8 1 +#define R_SPARC_16 2 +#define R_SPARC_32 3 +#define R_SPARC_DISP8 4 +#define R_SPARC_DISP16 5 +#define R_SPARC_DISP32 6 +#define R_SPARC_WDISP30 7 +#define R_SPARC_WDISP22 8 +#define R_SPARC_HI22 9 +#define R_SPARC_22 10 +#define R_SPARC_13 11 +#define R_SPARC_LO10 12 +#define R_SPARC_GOT10 13 +#define R_SPARC_GOT13 14 +#define R_SPARC_GOT22 15 +#define R_SPARC_PC10 16 +#define R_SPARC_PC22 17 +#define R_SPARC_WPLT30 18 +#define R_SPARC_COPY 19 +#define R_SPARC_GLOB_DAT 20 +#define R_SPARC_JMP_SLOT 21 +#define R_SPARC_RELATIVE 22 +#define R_SPARC_UA32 23 +#define R_SPARC_PLT32 24 +#define R_SPARC_HIPLT22 25 +#define R_SPARC_LOPLT10 26 +#define R_SPARC_PCPLT32 27 +#define R_SPARC_PCPLT22 28 +#define R_SPARC_PCPLT10 29 +#define R_SPARC_10 30 +#define R_SPARC_11 31 +#define R_SPARC_64 32 +#define R_SPARC_OLO10 33 +#define R_SPARC_HH22 34 +#define R_SPARC_HM10 35 +#define R_SPARC_LM22 36 +#define R_SPARC_PC_HH22 37 +#define R_SPARC_PC_HM10 38 +#define R_SPARC_PC_LM22 39 +#define R_SPARC_WDISP16 40 +#define R_SPARC_WDISP19 41 +#define R_SPARC_GLOB_JMP 42 +#define R_SPARC_7 43 +#define R_SPARC_5 44 +#define R_SPARC_6 45 +#define R_SPARC_DISP64 46 +#define R_SPARC_PLT64 47 +#define R_SPARC_HIX22 48 +#define R_SPARC_LOX10 49 +#define R_SPARC_H44 50 +#define R_SPARC_M44 51 +#define R_SPARC_L44 52 +#define R_SPARC_REGISTER 53 +#define R_SPARC_UA64 54 +#define R_SPARC_UA16 55 +#define R_SPARC_TLS_GD_HI22 56 +#define R_SPARC_TLS_GD_LO10 57 +#define R_SPARC_TLS_GD_ADD 58 +#define R_SPARC_TLS_GD_CALL 59 +#define R_SPARC_TLS_LDM_HI22 60 +#define R_SPARC_TLS_LDM_LO10 61 +#define R_SPARC_TLS_LDM_ADD 62 +#define R_SPARC_TLS_LDM_CALL 63 +#define R_SPARC_TLS_LDO_HIX22 64 +#define R_SPARC_TLS_LDO_LOX10 65 +#define R_SPARC_TLS_LDO_ADD 66 +#define R_SPARC_TLS_IE_HI22 67 +#define R_SPARC_TLS_IE_LO10 68 +#define R_SPARC_TLS_IE_LD 69 +#define R_SPARC_TLS_IE_LDX 70 +#define R_SPARC_TLS_IE_ADD 71 +#define R_SPARC_TLS_LE_HIX22 72 +#define R_SPARC_TLS_LE_LOX10 73 +#define R_SPARC_TLS_DTPMOD32 74 +#define R_SPARC_TLS_DTPMOD64 75 +#define R_SPARC_TLS_DTPOFF32 76 +#define R_SPARC_TLS_DTPOFF64 77 +#define R_SPARC_TLS_TPOFF32 78 +#define R_SPARC_TLS_TPOFF64 79 + +#define R_X86_64_NONE 0 /* No relocation. */ +#define R_X86_64_64 1 /* Add 64 bit symbol value. */ +#define R_X86_64_PC32 2 /* PC-relative 32 bit signed sym value. */ +#define R_X86_64_GOT32 3 /* PC-relative 32 bit GOT offset. */ +#define R_X86_64_PLT32 4 /* PC-relative 32 bit PLT offset. */ +#define R_X86_64_COPY 5 /* Copy data from shared object. */ +#define R_X86_64_GLOB_DAT 6 /* Set GOT entry to data address. */ +#define R_X86_64_JMP_SLOT 7 /* Set GOT entry to code address. */ +#define R_X86_64_RELATIVE 8 /* Add load address of shared object. */ +#define R_X86_64_GOTPCREL 9 /* Add 32 bit signed pcrel offset to GOT. */ +#define R_X86_64_32 10 /* Add 32 bit zero extended symbol value */ +#define R_X86_64_32S 11 /* Add 32 bit sign extended symbol value */ +#define R_X86_64_16 12 /* Add 16 bit zero extended symbol value */ +#define R_X86_64_PC16 13 /* Add 16 bit signed extended pc relative symbol value */ +#define R_X86_64_8 14 /* Add 8 bit zero extended symbol value */ +#define R_X86_64_PC8 15 /* Add 8 bit signed extended pc relative symbol value */ +#define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */ +#define R_X86_64_DTPOFF64 17 /* Offset in TLS block */ +#define R_X86_64_TPOFF64 18 /* Offset in static TLS block */ +#define R_X86_64_TLSGD 19 /* PC relative offset to GD GOT entry */ +#define R_X86_64_TLSLD 20 /* PC relative offset to LD GOT entry */ +#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */ +#define R_X86_64_GOTTPOFF 22 /* PC relative offset to IE GOT entry */ +#define R_X86_64_TPOFF32 23 /* Offset in static TLS block */ + + +#endif /* !_SYS_ELF_COMMON_H_ */ diff --git a/src/coreclr/src/pal/src/libunwind_mac/include/ucontext.h b/src/coreclr/src/pal/src/libunwind_mac/include/ucontext.h new file mode 100644 index 000000000000..e759833309e8 --- /dev/null +++ b/src/coreclr/src/pal/src/libunwind_mac/include/ucontext.h @@ -0,0 +1,47 @@ +/* Copyright (C) 2004 Hewlett-Packard Co. + Contributed by David Mosberger-Tang . + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#define UC_MCONTEXT_GREGS_R8 0x28 +#define UC_MCONTEXT_GREGS_R9 0x30 +#define UC_MCONTEXT_GREGS_R10 0x38 +#define UC_MCONTEXT_GREGS_R11 0x40 +#define UC_MCONTEXT_GREGS_R12 0x48 +#define UC_MCONTEXT_GREGS_R13 0x50 +#define UC_MCONTEXT_GREGS_R14 0x58 +#define UC_MCONTEXT_GREGS_R15 0x60 +#define UC_MCONTEXT_GREGS_RDI 0x68 +#define UC_MCONTEXT_GREGS_RSI 0x70 +#define UC_MCONTEXT_GREGS_RBP 0x78 +#define UC_MCONTEXT_GREGS_RBX 0x80 +#define UC_MCONTEXT_GREGS_RDX 0x88 +#define UC_MCONTEXT_GREGS_RAX 0x90 +#define UC_MCONTEXT_GREGS_RCX 0x98 +#define UC_MCONTEXT_GREGS_RSP 0xa0 +#define UC_MCONTEXT_GREGS_RIP 0xa8 +#define UC_MCONTEXT_FPREGS_PTR 0x1a8 +#define UC_MCONTEXT_FPREGS_MEM 0xe0 +#define UC_SIGMASK 0x128 +#define FPREGS_OFFSET_MXCSR 0x18 + +#include diff --git a/src/coreclr/src/pal/src/libunwind_mac/src/missing-functions.c b/src/coreclr/src/pal/src/libunwind_mac/src/missing-functions.c new file mode 100644 index 000000000000..8399214e4952 --- /dev/null +++ b/src/coreclr/src/pal/src/libunwind_mac/src/missing-functions.c @@ -0,0 +1,61 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2003, 2005 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +// This is minimal implementation functions files required to cross compile +// libunwind on MacOS for UNW_REMOTE_ONLY application. + +#include +#include +#include +#include +#include "libunwind_i.h" +#include "compiler.h" + +unw_addr_space_t UNW_OBJ(local_addr_space); + +unw_accessors_t * +unw_get_accessors (unw_addr_space_t as) +{ + if (!atomic_load(&tdep_init_done)) + tdep_init (); + return &as->acc; +} + +unw_accessors_t * +unw_get_accessors_int (unw_addr_space_t as) +{ + return unw_get_accessors(as); +} + +int +unw_is_signal_frame (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + return c->sigcontext_format != X86_64_SCF_NONE; +} + +int +UNW_OBJ(handle_signal_frame) (unw_cursor_t *cursor) +{ + return -UNW_EBADFRAME; +} diff --git a/src/coreclr/src/pal/src/loader/module.cpp b/src/coreclr/src/pal/src/loader/module.cpp index 68675ac848a4..58126e1cc5a0 100644 --- a/src/coreclr/src/pal/src/loader/module.cpp +++ b/src/coreclr/src/pal/src/loader/module.cpp @@ -603,6 +603,13 @@ PAL_LoadLibraryDirect( lpLibFileName ? lpLibFileName : W16_NULLSTRING, lpLibFileName ? lpLibFileName : W16_NULLSTRING); + // Getting nullptr as name indicates redirection to current library + if (lpLibFileName == nullptr) + { + dl_handle = dlopen(NULL, RTLD_LAZY); + goto done; + } + if (!LOADVerifyLibraryPath(lpLibFileName)) { goto done; @@ -1436,18 +1443,6 @@ static LPWSTR LOADGetModuleFileName(MODSTRUCT *module) return module->lib_name; } -static bool ShouldRedirectToCurrentLibrary(LPCSTR libraryNameOrPath) -{ - if (!g_running_in_exe) - return false; - - // Getting nullptr as name indicates redirection to current library - if (libraryNameOrPath == nullptr) - return true; - - return false; -} - /* Function: LOADLoadLibraryDirect [internal] @@ -1464,7 +1459,8 @@ static NATIVE_LIBRARY_HANDLE LOADLoadLibraryDirect(LPCSTR libraryNameOrPath) { NATIVE_LIBRARY_HANDLE dl_handle; - if (ShouldRedirectToCurrentLibrary(libraryNameOrPath)) + // Getting nullptr as name indicates redirection to current library + if (libraryNameOrPath == nullptr) { dl_handle = dlopen(NULL, RTLD_LAZY); } diff --git a/src/coreclr/src/pal/src/map/map.cpp b/src/coreclr/src/pal/src/map/map.cpp index 154329885679..75405c7407c8 100644 --- a/src/coreclr/src/pal/src/map/map.cpp +++ b/src/coreclr/src/pal/src/map/map.cpp @@ -2137,6 +2137,18 @@ MAPRecordMapping( return palError; } +static size_t OffsetWithinPage(off_t addr) +{ + return addr & (GetVirtualPageSize() - 1); +} + +static size_t RoundToPage(size_t size, off_t offset) +{ + size_t result = size + OffsetWithinPage(offset); + _ASSERTE(result >= size); + return result; +} + // Do the actual mmap() call, and record the mapping in the MappedViewList list. // This call assumes the mapping_critsec has already been taken. static PAL_ERROR @@ -2155,9 +2167,13 @@ MAPmmapAndRecord( _ASSERTE(pPEBaseAddress != NULL); PAL_ERROR palError = NO_ERROR; - off_t adjust = offset & (GetVirtualPageSize() - 1); + off_t adjust = OffsetWithinPage(offset); LPVOID pvBaseAddress = static_cast(addr) - adjust; + // Ensure address and offset arguments mmap() are page-aligned. + _ASSERTE(OffsetWithinPage(offset - adjust) == 0); + _ASSERTE(OffsetWithinPage((off_t)pvBaseAddress) == 0); + #ifdef __APPLE__ if ((prot & PROT_EXEC) != 0 && IsRunningOnMojaveHardenedRuntime()) { @@ -2176,7 +2192,7 @@ MAPmmapAndRecord( else #endif { - pvBaseAddress = mmap(static_cast(addr) - adjust, len + adjust, prot, flags, fd, offset - adjust); + pvBaseAddress = mmap(pvBaseAddress, len + adjust, prot, flags, fd, offset - adjust); if (MAP_FAILED == pvBaseAddress) { ERROR_(LOADER)( "mmap failed with code %d: %s.\n", errno, strerror( errno ) ); @@ -2360,7 +2376,7 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset) // We're going to start adding mappings to the mapping list, so take the critical section InternalEnterCriticalSection(pThread, &mapping_critsec); - reserveSize = virtualSize; + reserveSize = RoundToPage(virtualSize, offset); if ((ntHeader.OptionalHeader.SectionAlignment) > GetVirtualPageSize()) { reserveSize += ntHeader.OptionalHeader.SectionAlignment; @@ -2441,11 +2457,19 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset) //we have now reserved memory (potentially we got rebased). Walk the PE sections and map each part //separately. + _ASSERTE(OffsetWithinPage((off_t)loadedBase) == 0); //first, map the PE header to the first page in the image. Get pointers to the section headers + loadedHeader = (IMAGE_DOS_HEADER*)(static_cast(loadedBase) + OffsetWithinPage(offset)); + + LPVOID loadedHeaderBase; + // initialize this on a separate line to prevent a false error about the goto done; jumping over this + loadedHeaderBase = NULL; + + _ASSERTE(OffsetWithinPage(offset) == OffsetWithinPage((off_t)loadedHeader)); palError = MAPmmapAndRecord(pFileObject, loadedBase, - loadedBase, headerSize, PROT_READ, readOnlyFlags, fd, offset, - (void**)&loadedHeader); + (LPVOID)loadedHeader, headerSize, PROT_READ, readOnlyFlags, fd, offset, + &loadedHeaderBase); if (NO_ERROR != palError) { ERROR_(LOADER)( "mmap of PE header failed\n" ); @@ -2453,7 +2477,7 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset) } TRACE_(LOADER)("PE header loaded @ %p\n", loadedHeader); - _ASSERTE(loadedHeader == loadedBase); // we already preallocated the space, and we used MAP_FIXED, so we should have gotten this address + _ASSERTE(loadedHeaderBase == loadedBase); // we already preallocated the space, and we used MAP_FIXED, so we should have gotten this address IMAGE_SECTION_HEADER * firstSection; firstSection = (IMAGE_SECTION_HEADER*)(((char *)loadedHeader) + loadedHeader->e_lfanew @@ -2465,9 +2489,9 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset) // Validation char* sectionHeaderEnd; sectionHeaderEnd = (char*)firstSection + numSections * sizeof(IMAGE_SECTION_HEADER); - if ( ((void*)firstSection < loadedBase) + if ( ((void*)firstSection < loadedHeader) || ((char*)firstSection > sectionHeaderEnd) - || (sectionHeaderEnd > (char*)loadedBase + virtualSize) + || (sectionHeaderEnd > (char*)loadedHeader + virtualSize) ) { ERROR_(LOADER)( "image is corrupt\n" ); @@ -2476,7 +2500,8 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset) } void* prevSectionEnd; - prevSectionEnd = (char*)loadedBase + headerSize; // the first "section" for our purposes is the header + prevSectionEnd = (char*)loadedHeader + headerSize; // the first "section" for our purposes is the header + for (unsigned i = 0; i < numSections; ++i) { //for each section, map the section of the file to the correct virtual offset. Gather the @@ -2485,13 +2510,13 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset) int prot = 0; IMAGE_SECTION_HEADER ¤tHeader = firstSection[i]; - void* sectionBase = (char*)loadedBase + currentHeader.VirtualAddress; + void* sectionBase = (char*)loadedHeader + currentHeader.VirtualAddress; void* sectionBaseAligned = ALIGN_DOWN(sectionBase, GetVirtualPageSize()); // Validate the section header - if ( (sectionBase < loadedBase) // Did computing the section base overflow? + if ( (sectionBase < loadedHeader) // Did computing the section base overflow? || ((char*)sectionBase + currentHeader.SizeOfRawData < (char*)sectionBase) // Does the section overflow? - || ((char*)sectionBase + currentHeader.SizeOfRawData > (char*)loadedBase + virtualSize) // Does the section extend past the end of the image as the header stated? + || ((char*)sectionBase + currentHeader.SizeOfRawData > (char*)loadedHeader + virtualSize) // Does the section extend past the end of the image as the header stated? || (prevSectionEnd > sectionBase) // Does this section overlap the previous one? ) { @@ -2499,6 +2524,7 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset) palError = ERROR_INVALID_PARAMETER; goto doneReleaseMappingCriticalSection; } + if (currentHeader.Misc.VirtualSize > currentHeader.SizeOfRawData) { ERROR_(LOADER)( "no support for zero-padded sections, section %d\n", i ); @@ -2506,6 +2532,13 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset) goto doneReleaseMappingCriticalSection; } + if (OffsetWithinPage((off_t)sectionBase) != OffsetWithinPage(offset + currentHeader.PointerToRawData)) + { + ERROR_(LOADER)("can't map section if data and VA hint have different page alignment %d\n", i); + palError = ERROR_INVALID_PARAMETER; + goto doneReleaseMappingCriticalSection; + } + // Is there space between the previous section and this one? If so, add a PROT_NONE mapping to cover it. if (prevSectionEnd < sectionBaseAligned) { @@ -2600,7 +2633,7 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset) if (palError == ERROR_SUCCESS) { - retval = loadedBase; + retval = loadedHeader; LOGEXIT("MAPMapPEFile returns %p\n", retval); } else diff --git a/src/coreclr/src/pal/src/misc/jitsupport.cpp b/src/coreclr/src/pal/src/misc/jitsupport.cpp index 83ed940567c4..68af6aa1bd6d 100644 --- a/src/coreclr/src/pal/src/misc/jitsupport.cpp +++ b/src/coreclr/src/pal/src/misc/jitsupport.cpp @@ -50,8 +50,8 @@ PAL_GetJitCpuCapabilityFlags(CORJIT_FLAGS *flags) // CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_DCPOP); #endif #ifdef HWCAP_ASIMDDP -// if (hwCap & HWCAP_ASIMDDP) -// CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_DP); + if (hwCap & HWCAP_ASIMDDP) + CPUCompileFlags.Set(InstructionSet_Dp); #endif #ifdef HWCAP_FCMA // if (hwCap & HWCAP_FCMA) @@ -98,8 +98,8 @@ PAL_GetJitCpuCapabilityFlags(CORJIT_FLAGS *flags) CPUCompileFlags.Set(InstructionSet_AdvSimd); #endif #ifdef HWCAP_ASIMDRDM -// if (hwCap & HWCAP_ASIMDRDM) -// CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_ADVSIMD_V81); + if (hwCap & HWCAP_ASIMDRDM) + CPUCompileFlags.Set(InstructionSet_Rdm); #endif #ifdef HWCAP_ASIMDHP // if (hwCap & HWCAP_ASIMDHP) diff --git a/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunConstants.cs b/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunConstants.cs index be037341870d..ce6de5de37ca 100644 --- a/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunConstants.cs +++ b/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunConstants.cs @@ -140,6 +140,7 @@ public enum ReadyToRunHelper // Not a real helper - handle to current module passed to delay load helpers. Module = 0x01, GSCookie = 0x02, + IndirectTrapThreads = 0x03, // // Delay load helpers diff --git a/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSet.cs b/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSet.cs index 0c51d7d79a8a..c4b646cb22d9 100644 --- a/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSet.cs +++ b/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSet.cs @@ -34,6 +34,8 @@ public enum ReadyToRunInstructionSet Sha256=20, Atomics=21, X86Base=22, + Dp=23, + Rdm=24, } } diff --git a/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs b/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs index 76e6e79a6cd6..0a9726239b72 100644 --- a/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs +++ b/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs @@ -31,6 +31,10 @@ public static class ReadyToRunInstructionSetHelper case InstructionSet.ARM64_Aes_Arm64: return ReadyToRunInstructionSet.Aes; case InstructionSet.ARM64_Crc32: return ReadyToRunInstructionSet.Crc32; case InstructionSet.ARM64_Crc32_Arm64: return ReadyToRunInstructionSet.Crc32; + case InstructionSet.ARM64_Dp: return ReadyToRunInstructionSet.Dp; + case InstructionSet.ARM64_Dp_Arm64: return ReadyToRunInstructionSet.Dp; + case InstructionSet.ARM64_Rdm: return ReadyToRunInstructionSet.Rdm; + case InstructionSet.ARM64_Rdm_Arm64: return ReadyToRunInstructionSet.Rdm; case InstructionSet.ARM64_Sha1: return ReadyToRunInstructionSet.Sha1; case InstructionSet.ARM64_Sha1_Arm64: return ReadyToRunInstructionSet.Sha1; case InstructionSet.ARM64_Sha256: return ReadyToRunInstructionSet.Sha256; diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs index 2be99788f34a..da5d691a39cf 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs @@ -135,21 +135,17 @@ public TextWriter Log private CORINFO_MODULE_STRUCT_* _methodScope; // Needed to resolve CORINFO_EH_CLAUSE tokens - private bool _isFallbackBodyCompilation; // True if we're compiling a fallback method body after compiling the real body failed - - private void CompileMethodInternal(IMethodNode methodCodeNodeNeedingCode, MethodIL methodIL = null) + private void CompileMethodInternal(IMethodNode methodCodeNodeNeedingCode, MethodIL methodIL) { - _isFallbackBodyCompilation = methodIL != null; - - CORINFO_METHOD_INFO methodInfo; - methodIL = Get_CORINFO_METHOD_INFO(MethodBeingCompiled, methodIL, &methodInfo); - - // This is e.g. an "extern" method in C# without a DllImport or InternalCall. + // methodIL must not be null if (methodIL == null) { ThrowHelper.ThrowInvalidProgramException(ExceptionStringID.InvalidProgramSpecific, MethodBeingCompiled); } + CORINFO_METHOD_INFO methodInfo; + Get_CORINFO_METHOD_INFO(MethodBeingCompiled, methodIL, &methodInfo); + _methodScope = methodInfo.scope; #if !READYTORUN @@ -428,16 +424,12 @@ private Object HandleToObject(IntPtr handle) private FieldDesc HandleToObject(CORINFO_FIELD_STRUCT_* field) { return (FieldDesc)HandleToObject((IntPtr)field); } private CORINFO_FIELD_STRUCT_* ObjectToHandle(FieldDesc field) { return (CORINFO_FIELD_STRUCT_*)ObjectToHandle((Object)field); } - private MethodIL Get_CORINFO_METHOD_INFO(MethodDesc method, MethodIL methodIL, CORINFO_METHOD_INFO* methodInfo) + private bool Get_CORINFO_METHOD_INFO(MethodDesc method, MethodIL methodIL, CORINFO_METHOD_INFO* methodInfo) { - // MethodIL can be provided externally for the case of a method whose IL was replaced because we couldn't compile it. - if (methodIL == null) - methodIL = _compilation.GetMethodIL(method); - if (methodIL == null) { *methodInfo = default(CORINFO_METHOD_INFO); - return null; + return false; } methodInfo->ftn = ObjectToHandle(method); @@ -465,7 +457,7 @@ private MethodIL Get_CORINFO_METHOD_INFO(MethodDesc method, MethodIL methodIL, C Get_CORINFO_SIG_INFO(method, &methodInfo->args); Get_CORINFO_SIG_INFO(methodIL.GetLocals(), &methodInfo->locals); - return methodIL; + return true; } private void Get_CORINFO_SIG_INFO(MethodDesc method, CORINFO_SIG_INFO* sig, bool suppressHiddenArgument = false) @@ -510,6 +502,49 @@ private void Get_CORINFO_SIG_INFO(MethodDesc method, CORINFO_SIG_INFO* sig, bool } } + private bool TryGetUnmanagedCallingConventionFromModOpt(MethodSignature signature, out CorInfoCallConv callConv) + { + callConv = CorInfoCallConv.CORINFO_CALLCONV_UNMANAGED; + if (!signature.HasEmbeddedSignatureData || signature.GetEmbeddedSignatureData() == null) + return false; + + foreach (EmbeddedSignatureData data in signature.GetEmbeddedSignatureData()) + { + if (data.kind != EmbeddedSignatureDataKind.OptionalCustomModifier) + continue; + + // We only care about the modifiers for the return type. These will be at the start of + // the signature, so will be first in the array of embedded signature data. + if (data.index != MethodSignature.IndexOfCustomModifiersOnReturnType) + break; + + if (!(data.type is DefType defType)) + continue; + + if (defType.Namespace != "System.Runtime.CompilerServices") + continue; + + // Take the first recognized calling convention in metadata. + switch (defType.Name) + { + case "CallConvCdecl": + callConv = CorInfoCallConv.CORINFO_CALLCONV_C; + return true; + case "CallConvStdcall": + callConv = CorInfoCallConv.CORINFO_CALLCONV_STDCALL; + return true; + case "CallConvFastcall": + callConv = CorInfoCallConv.CORINFO_CALLCONV_FASTCALL; + return true; + case "CallConvThiscall": + callConv = CorInfoCallConv.CORINFO_CALLCONV_THISCALL; + return true; + } + } + + return false; + } + private void Get_CORINFO_SIG_INFO(MethodSignature signature, CORINFO_SIG_INFO* sig) { sig->callConv = (CorInfoCallConv)(signature.Flags & MethodSignatureFlags.UnmanagedCallingConventionMask); @@ -520,6 +555,22 @@ private void Get_CORINFO_SIG_INFO(MethodSignature signature, CORINFO_SIG_INFO* s if (!signature.IsStatic) sig->callConv |= CorInfoCallConv.CORINFO_CALLCONV_HASTHIS; + // Unmanaged calling convention indicates modopt should be read + if (sig->callConv == CorInfoCallConv.CORINFO_CALLCONV_UNMANAGED) + { + if (TryGetUnmanagedCallingConventionFromModOpt(signature, out CorInfoCallConv callConvMaybe)) + { + sig->callConv = callConvMaybe; + } + else + { + // Use platform default + sig->callConv = _compilation.TypeSystemContext.Target.IsWindows + ? CorInfoCallConv.CORINFO_CALLCONV_STDCALL + : CorInfoCallConv.CORINFO_CALLCONV_C; + } + } + TypeDesc returnType = signature.ReturnType; CorInfoType corInfoRetType = asCorInfoType(signature.ReturnType, &sig->retTypeClass); @@ -803,8 +854,9 @@ private void getMethodSig(CORINFO_METHOD_STRUCT_* ftn, CORINFO_SIG_INFO* sig, CO private bool getMethodInfo(CORINFO_METHOD_STRUCT_* ftn, CORINFO_METHOD_INFO* info) { - MethodIL methodIL = Get_CORINFO_METHOD_INFO(HandleToObject(ftn), null, info); - return methodIL != null; + MethodDesc method = HandleToObject(ftn); + MethodIL methodIL = _compilation.GetMethodIL(method); + return Get_CORINFO_METHOD_INFO(method, methodIL, info); } private CorInfoInline canInline(CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* calleeHnd, ref uint pRestrictions) @@ -1663,10 +1715,11 @@ private CorInfoInitClassResult initClass(CORINFO_FIELD_STRUCT_* field, CORINFO_M MethodDesc md = method == null ? MethodBeingCompiled : HandleToObject(method); TypeDesc type = fd != null ? fd.OwningType : typeFromContext(context); - if (_isFallbackBodyCompilation || + if ( #if READYTORUN IsClassPreInited(type) #else + _isFallbackBodyCompilation || !_compilation.HasLazyStaticConstructor(type) #endif ) @@ -2443,12 +2496,6 @@ private uint getThreadTLSIndex(ref void* ppIndirection) private void* getInlinedCallFrameVptr(ref void* ppIndirection) { throw new NotImplementedException("getInlinedCallFrameVptr"); } - private int* getAddrOfCaptureThreadGlobal(ref void* ppIndirection) - { - ppIndirection = null; - return null; - } - private Dictionary _helperCache = new Dictionary(); private void* getHelperFtn(CorInfoHelpFunc ftnNum, ref void* ppIndirection) { diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoInstructionSet.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoInstructionSet.cs index 5257d470e377..c04ffa4bd941 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoInstructionSet.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoInstructionSet.cs @@ -21,17 +21,21 @@ public enum InstructionSet ARM64_AdvSimd=2, ARM64_Aes=3, ARM64_Crc32=4, - ARM64_Sha1=5, - ARM64_Sha256=6, - ARM64_Atomics=7, - ARM64_Vector64=8, - ARM64_Vector128=9, - ARM64_ArmBase_Arm64=10, - ARM64_AdvSimd_Arm64=11, - ARM64_Aes_Arm64=12, - ARM64_Crc32_Arm64=13, - ARM64_Sha1_Arm64=14, - ARM64_Sha256_Arm64=15, + ARM64_Dp=5, + ARM64_Rdm=6, + ARM64_Sha1=7, + ARM64_Sha256=8, + ARM64_Atomics=9, + ARM64_Vector64=10, + ARM64_Vector128=11, + ARM64_ArmBase_Arm64=12, + ARM64_AdvSimd_Arm64=13, + ARM64_Aes_Arm64=14, + ARM64_Crc32_Arm64=15, + ARM64_Dp_Arm64=16, + ARM64_Rdm_Arm64=17, + ARM64_Sha1_Arm64=18, + ARM64_Sha256_Arm64=19, X64_X86Base=1, X64_SSE=2, X64_SSE2=3, @@ -196,6 +200,14 @@ public static InstructionSetFlags ExpandInstructionSetByImplicationHelper(Target resultflags.AddInstructionSet(InstructionSet.ARM64_Crc32_Arm64); if (resultflags.HasInstructionSet(InstructionSet.ARM64_Crc32_Arm64)) resultflags.AddInstructionSet(InstructionSet.ARM64_Crc32); + if (resultflags.HasInstructionSet(InstructionSet.ARM64_Dp)) + resultflags.AddInstructionSet(InstructionSet.ARM64_Dp_Arm64); + if (resultflags.HasInstructionSet(InstructionSet.ARM64_Dp_Arm64)) + resultflags.AddInstructionSet(InstructionSet.ARM64_Dp); + if (resultflags.HasInstructionSet(InstructionSet.ARM64_Rdm)) + resultflags.AddInstructionSet(InstructionSet.ARM64_Rdm_Arm64); + if (resultflags.HasInstructionSet(InstructionSet.ARM64_Rdm_Arm64)) + resultflags.AddInstructionSet(InstructionSet.ARM64_Rdm); if (resultflags.HasInstructionSet(InstructionSet.ARM64_Sha1)) resultflags.AddInstructionSet(InstructionSet.ARM64_Sha1_Arm64); if (resultflags.HasInstructionSet(InstructionSet.ARM64_Sha1_Arm64)) @@ -210,6 +222,10 @@ public static InstructionSetFlags ExpandInstructionSetByImplicationHelper(Target resultflags.AddInstructionSet(InstructionSet.ARM64_ArmBase); if (resultflags.HasInstructionSet(InstructionSet.ARM64_Crc32)) resultflags.AddInstructionSet(InstructionSet.ARM64_ArmBase); + if (resultflags.HasInstructionSet(InstructionSet.ARM64_Dp)) + resultflags.AddInstructionSet(InstructionSet.ARM64_AdvSimd); + if (resultflags.HasInstructionSet(InstructionSet.ARM64_Rdm)) + resultflags.AddInstructionSet(InstructionSet.ARM64_AdvSimd); if (resultflags.HasInstructionSet(InstructionSet.ARM64_Sha1)) resultflags.AddInstructionSet(InstructionSet.ARM64_ArmBase); if (resultflags.HasInstructionSet(InstructionSet.ARM64_Sha256)) @@ -375,6 +391,10 @@ private static InstructionSetFlags ExpandInstructionSetByReverseImplicationHelpe resultflags.AddInstructionSet(InstructionSet.ARM64_Aes); if (resultflags.HasInstructionSet(InstructionSet.ARM64_Crc32_Arm64)) resultflags.AddInstructionSet(InstructionSet.ARM64_Crc32); + if (resultflags.HasInstructionSet(InstructionSet.ARM64_Dp_Arm64)) + resultflags.AddInstructionSet(InstructionSet.ARM64_Dp); + if (resultflags.HasInstructionSet(InstructionSet.ARM64_Rdm_Arm64)) + resultflags.AddInstructionSet(InstructionSet.ARM64_Rdm); if (resultflags.HasInstructionSet(InstructionSet.ARM64_Sha1_Arm64)) resultflags.AddInstructionSet(InstructionSet.ARM64_Sha1); if (resultflags.HasInstructionSet(InstructionSet.ARM64_Sha256_Arm64)) @@ -385,6 +405,10 @@ private static InstructionSetFlags ExpandInstructionSetByReverseImplicationHelpe resultflags.AddInstructionSet(InstructionSet.ARM64_Aes); if (resultflags.HasInstructionSet(InstructionSet.ARM64_ArmBase)) resultflags.AddInstructionSet(InstructionSet.ARM64_Crc32); + if (resultflags.HasInstructionSet(InstructionSet.ARM64_AdvSimd)) + resultflags.AddInstructionSet(InstructionSet.ARM64_Dp); + if (resultflags.HasInstructionSet(InstructionSet.ARM64_AdvSimd)) + resultflags.AddInstructionSet(InstructionSet.ARM64_Rdm); if (resultflags.HasInstructionSet(InstructionSet.ARM64_ArmBase)) resultflags.AddInstructionSet(InstructionSet.ARM64_Sha1); if (resultflags.HasInstructionSet(InstructionSet.ARM64_ArmBase)) @@ -520,6 +544,8 @@ public static IEnumerable ArchitectureToValidInstructionSets yield return new InstructionSetInfo("neon", "AdvSimd", InstructionSet.ARM64_AdvSimd, true); yield return new InstructionSetInfo("aes", "Aes", InstructionSet.ARM64_Aes, true); yield return new InstructionSetInfo("crc", "Crc32", InstructionSet.ARM64_Crc32, true); + yield return new InstructionSetInfo("dotprod", "Dp", InstructionSet.ARM64_Dp, true); + yield return new InstructionSetInfo("rdma", "Rdm", InstructionSet.ARM64_Rdm, true); yield return new InstructionSetInfo("sha1", "Sha1", InstructionSet.ARM64_Sha1, true); yield return new InstructionSetInfo("sha2", "Sha256", InstructionSet.ARM64_Sha256, true); yield return new InstructionSetInfo("lse", "", InstructionSet.ARM64_Atomics, true); @@ -586,6 +612,10 @@ public void Set64BitInstructionSetVariants(TargetArchitecture architecture) AddInstructionSet(InstructionSet.ARM64_Aes_Arm64); if (HasInstructionSet(InstructionSet.ARM64_Crc32)) AddInstructionSet(InstructionSet.ARM64_Crc32_Arm64); + if (HasInstructionSet(InstructionSet.ARM64_Dp)) + AddInstructionSet(InstructionSet.ARM64_Dp_Arm64); + if (HasInstructionSet(InstructionSet.ARM64_Rdm)) + AddInstructionSet(InstructionSet.ARM64_Rdm_Arm64); if (HasInstructionSet(InstructionSet.ARM64_Sha1)) AddInstructionSet(InstructionSet.ARM64_Sha1_Arm64); if (HasInstructionSet(InstructionSet.ARM64_Sha256)) diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt index 73f529419bb5..615fc9648ed5 100644 --- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt +++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt @@ -82,6 +82,8 @@ instructionset ,ARM64 ,ArmBase , ,16 ,ArmBase ,base instructionset ,ARM64 ,AdvSimd , ,17 ,AdvSimd ,neon instructionset ,ARM64 ,Aes , ,9 ,Aes ,aes instructionset ,ARM64 ,Crc32 , ,18 ,Crc32 ,crc +instructionset ,ARM64 ,Dp , ,23 ,Dp ,dotprod +instructionset ,ARM64 ,Rdm , ,24 ,Rdm ,rdma instructionset ,ARM64 ,Sha1 , ,19 ,Sha1 ,sha1 instructionset ,ARM64 ,Sha256 , ,20 ,Sha256 ,sha2 instructionset ,ARM64 , ,Atomics ,21 ,Atomics ,lse @@ -92,11 +94,15 @@ instructionset64bit,ARM64 ,ArmBase instructionset64bit,ARM64 ,AdvSimd instructionset64bit,ARM64 ,Aes instructionset64bit,ARM64 ,Crc32 +instructionset64bit,ARM64 ,Dp +instructionset64bit,ARM64 ,Rdm instructionset64bit,ARM64 ,Sha1 instructionset64bit,ARM64 ,Sha256 implication ,ARM64 ,AdvSimd ,ArmBase implication ,ARM64 ,Aes ,ArmBase implication ,ARM64 ,Crc32 ,ArmBase +implication ,ARM64 ,Dp ,AdvSimd +implication ,ARM64 ,Rdm ,AdvSimd implication ,ARM64 ,Sha1 ,ArmBase implication ,ARM64 ,Sha256 ,ArmBase diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs index abbb1db11af6..c0b317e201ee 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs @@ -632,7 +632,8 @@ protected ComputedInstanceFieldLayout ComputeAutoFieldLayout(MetadataType type, } else { - cumulativeInstanceFieldPos = LayoutInt.AlignUp(cumulativeInstanceFieldPos, context.Target.LayoutPointerSize, context.Target); + LayoutInt AlignmentRequired = LayoutInt.Max(fieldSizeAndAlignment.Alignment, context.Target.LayoutPointerSize); + cumulativeInstanceFieldPos = LayoutInt.AlignUp(cumulativeInstanceFieldPos, AlignmentRequired, context.Target); } offsets[fieldOrdinal] = new FieldAndOffset(instanceValueClassFieldsArr[i], cumulativeInstanceFieldPos); diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/MethodDesc.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/MethodDesc.cs index 66143d073a03..0545857397ba 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/MethodDesc.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/MethodDesc.cs @@ -48,6 +48,9 @@ public sealed partial class MethodSignature : TypeSystemEntity internal TypeDesc[] _parameters; internal EmbeddedSignatureData[] _embeddedSignatureData; + // Value of for any custom modifiers on the return type + public const string IndexOfCustomModifiersOnReturnType = "0.1.1.1"; + public MethodSignature(MethodSignatureFlags flags, int genericParameterCount, TypeDesc returnType, TypeDesc[] parameters, EmbeddedSignatureData[] embeddedSignatureData = null) { _flags = flags; diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/Properties/Resources.resx b/src/coreclr/src/tools/Common/TypeSystem/Common/Properties/Resources.resx new file mode 100644 index 000000000000..368145929e05 --- /dev/null +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/Properties/Resources.resx @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Failed to load type '{0}' from assembly '{1}' + + + Failed to load type '{0}' from assembly '{1}' because the format is invalid + + + Failed to load type '{0}' from assembly '{1}' because generic types cannot have explicit layout + + + Failed to load type '{0}' from assembly '{1}' because of field offset '{2}' + + + Array of type '{0}' from assembly '{1}' cannot be created because base value type is too large + + + '{0}' from assembly '{1}' has too many dimensions + + + Missing method '{0}' + + + Missing field '{0}' + + + Failed to load assembly '{0}' + + + Invalid IL or CLR metadata + + + Invalid IL or CLR metadata in '{0}' + + + Vararg call to '{0}' not supported + + + Callvirt of '{0}' not supported + + + UnmanagedCallersOnly method '{0}' cannot be called from managed code + + + Direct call to abstract method '{0}' not allowed + + + Callvirt of static method '{0}' not allowed + + + UnmanagedCallersOnly attribute specified on non-static method '{0}' + + + UnmanagedCallersOnly attribute specified on generic method '{0}' + + + UnmanagedCallersOnly attribute specified on method with non-blittable parameters '{0}' + + + The format of a DLL or executable being loaded is invalid + + \ No newline at end of file diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemException.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemException.cs index 331556a6af13..c9a71236c4da 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemException.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemException.cs @@ -43,10 +43,53 @@ internal TypeSystemException(ExceptionStringID id, params string[] args) _arguments = args; } + private static string GetFormatString(ExceptionStringID id) + { + switch (id) + { + case ExceptionStringID.ClassLoadGeneral: return SR.ClassLoadGeneral; + case ExceptionStringID.ClassLoadBadFormat: return SR.ClassLoadBadFormat; + case ExceptionStringID.ClassLoadExplicitGeneric: return SR.ClassLoadExplicitGeneric; + case ExceptionStringID.ClassLoadExplicitLayout: return SR.ClassLoadExplicitLayout; + case ExceptionStringID.ClassLoadValueClassTooLarge: return SR.ClassLoadValueClassTooLarge; + case ExceptionStringID.ClassLoadRankTooLarge: return SR.ClassLoadRankTooLarge; + case ExceptionStringID.MissingMethod: return SR.MissingMethod; + case ExceptionStringID.MissingField: return SR.MissingField; + case ExceptionStringID.InvalidProgramDefault: return SR.InvalidProgramDefault; + case ExceptionStringID.InvalidProgramSpecific: return SR.InvalidProgramSpecific; + case ExceptionStringID.InvalidProgramVararg: return SR.InvalidProgramVararg; + case ExceptionStringID.InvalidProgramCallVirtFinalize: return SR.InvalidProgramCallVirtFinalize; + case ExceptionStringID.InvalidProgramUnmanagedCallersOnly: return SR.InvalidProgramUnmanagedCallersOnly; + case ExceptionStringID.InvalidProgramCallAbstractMethod: return SR.InvalidProgramCallAbstractMethod; + case ExceptionStringID.InvalidProgramCallVirtStatic: return SR.InvalidProgramCallVirtStatic; + case ExceptionStringID.InvalidProgramNonStaticMethod: return SR.InvalidProgramNonStaticMethod; + case ExceptionStringID.InvalidProgramGenericMethod: return SR.InvalidProgramGenericMethod; + case ExceptionStringID.InvalidProgramNonBlittableTypes: return SR.InvalidProgramNonBlittableTypes; + case ExceptionStringID.BadImageFormatGeneric: return SR.BadImageFormatGeneric; + case ExceptionStringID.FileLoadErrorGeneric: return SR.FileLoadErrorGeneric; + } +#if !DEBUG + throw new Exception($"Unknown Exception string id {id}"); +#else + return null; +#endif + } + private static string GetExceptionString(ExceptionStringID id, string[] args) { - // TODO: Share the strings and lookup logic with System.Private.CoreLib. - return "[TEMPORARY EXCEPTION MESSAGE] " + id.ToString() + ": " + String.Join(", ", args); + string formatString = GetFormatString(id); +#if !DEBUG + try + { +#endif + return String.Format(formatString, (object[])args); +#if !DEBUG + } + catch + { + return "[TEMPORARY EXCEPTION MESSAGE] " + id.ToString() + ": " + String.Join(", ", args); + } +#endif } /// diff --git a/src/coreclr/src/tools/ILVerification/ILVerification.projitems b/src/coreclr/src/tools/ILVerification/ILVerification.projitems index 69ee3651a751..bc5bda42bc03 100644 --- a/src/coreclr/src/tools/ILVerification/ILVerification.projitems +++ b/src/coreclr/src/tools/ILVerification/ILVerification.projitems @@ -17,6 +17,10 @@ ILVerification.Strings.resources + + true + Internal.TypeSystem.SR + $(MSBuildThisFileDirectory)..\Common\ diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs index 18f7ffbb9003..20d6dac16b8a 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs @@ -138,6 +138,9 @@ public void EmitPortableExecutable() _customPESectionAlignment); NativeDebugDirectoryEntryNode nativeDebugDirectoryEntryNode = null; + ISymbolDefinitionNode firstImportThunk = null; + ISymbolDefinitionNode lastImportThunk = null; + ObjectNode lastWrittenObjectNode = null; int nodeIndex = -1; foreach (var depNode in _nodes) @@ -162,6 +165,18 @@ public void EmitPortableExecutable() nativeDebugDirectoryEntryNode = nddeNode; } + if (node is ImportThunk importThunkNode) + { + Debug.Assert(firstImportThunk == null || lastWrittenObjectNode is ImportThunk, + "All the import thunks must be in single contiguous run"); + + if (firstImportThunk == null) + { + firstImportThunk = importThunkNode; + } + lastImportThunk = importThunkNode; + } + string name = null; if (_mapFileBuilder != null) @@ -180,10 +195,16 @@ public void EmitPortableExecutable() } EmitObjectData(r2rPeBuilder, nodeContents, nodeIndex, name, node.Section, _mapFileBuilder); + lastWrittenObjectNode = node; } r2rPeBuilder.SetCorHeader(_nodeFactory.CopiedCorHeaderNode, _nodeFactory.CopiedCorHeaderNode.Size); r2rPeBuilder.SetDebugDirectory(_nodeFactory.DebugDirectoryNode, _nodeFactory.DebugDirectoryNode.Size); + if (firstImportThunk != null) + { + r2rPeBuilder.AddSymbolForRange(_nodeFactory.DelayLoadMethodCallThunks, firstImportThunk, lastImportThunk); + } + if (_nodeFactory.Win32ResourcesNode != null) { diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadMethodCallThunkNodeRange.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadMethodCallThunkNodeRange.cs new file mode 100644 index 000000000000..b0463ee3de8b --- /dev/null +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadMethodCallThunkNodeRange.cs @@ -0,0 +1,36 @@ +// 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 ILCompiler.DependencyAnalysisFramework; + +using Internal.Text; + +namespace ILCompiler.DependencyAnalysis.ReadyToRun +{ + /// + /// Provides an ISymbolNode for the R2R header table to relocate against when looking up the delay load method call thunks. + /// They are emitted in a contiguous run of object nodes. This symbol is used in the object writer to represent the range + /// of bytes containing all the thunks. + /// + public class DelayLoadMethodCallThunkNodeRange : DependencyNodeCore, ISymbolDefinitionNode + { + public override bool InterestingForDynamicDependencyAnalysis => false; + public override bool HasDynamicDependencies => false; + public override bool HasConditionalStaticDependencies => false; + public override bool StaticDependenciesAreComputed => true; + public int Offset => 0; + public bool RepresentsIndirectionCell => false; + public override IEnumerable GetConditionalStaticDependencies(NodeFactory context) => null; + public override IEnumerable GetStaticDependencies(NodeFactory context) => null; + public override IEnumerable SearchDynamicDependencies(List> markedNodes, int firstNode, NodeFactory context) => null; + protected override string GetName(NodeFactory context) => "DelayLoadMethodCallThunkNodeRange"; + + public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) + { + sb.Append(GetName(null)); + } + } +} diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/HeaderNode.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/HeaderNode.cs index fe33cebfbe58..5ff1eeccad72 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/HeaderNode.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/HeaderNode.cs @@ -7,6 +7,7 @@ using Internal.Text; using Internal.TypeSystem; using Internal.ReadyToRunConstants; +using ILCompiler.DependencyAnalysisFramework; namespace ILCompiler.DependencyAnalysis.ReadyToRun { @@ -45,7 +46,7 @@ public abstract class HeaderNode : ObjectNode, ISymbolDefinitionNode { struct HeaderItem { - public HeaderItem(ReadyToRunSectionType id, ObjectNode node, ISymbolNode startSymbol) + public HeaderItem(ReadyToRunSectionType id, DependencyNodeCore node, ISymbolNode startSymbol) { Id = id; Node = node; @@ -53,7 +54,7 @@ public HeaderItem(ReadyToRunSectionType id, ObjectNode node, ISymbolNode startSy } public readonly ReadyToRunSectionType Id; - public readonly ObjectNode Node; + public readonly DependencyNodeCore Node; public readonly ISymbolNode StartSymbol; } @@ -67,7 +68,7 @@ public HeaderNode(TargetDetails target, ReadyToRunFlags flags) _flags = flags; } - public void Add(ReadyToRunSectionType id, ObjectNode node, ISymbolNode startSymbol) + public void Add(ReadyToRunSectionType id, DependencyNodeCore node, ISymbolNode startSymbol) { _items.Add(new HeaderItem(id, node, startSymbol)); } @@ -116,13 +117,17 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) foreach (var item in _items) { // Skip empty entries - if (!relocsOnly && item.Node.ShouldSkipEmittingObjectNode(factory)) + if (!relocsOnly && item.Node is ObjectNode on && on.ShouldSkipEmittingObjectNode(factory)) continue; builder.EmitInt((int)item.Id); builder.EmitReloc(item.StartSymbol, RelocType.IMAGE_REL_BASED_ADDR32NB); - builder.EmitReloc(item.StartSymbol, RelocType.IMAGE_REL_SYMBOL_SIZE); + + // The header entry for the runtime functions table should not include the 4 byte 0xffffffff sentinel + // value in the covered range. + int delta = item.Id == ReadyToRunSectionType.RuntimeFunctions ? RuntimeFunctionsTableNode.SentinelSizeAdjustment : 0; + builder.EmitReloc(item.StartSymbol, RelocType.IMAGE_REL_SYMBOL_SIZE, delta); count++; } diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/RuntimeFunctionsTableNode.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/RuntimeFunctionsTableNode.cs index 24dd8d91c5a1..c2ab705ef5c2 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/RuntimeFunctionsTableNode.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/RuntimeFunctionsTableNode.cs @@ -103,15 +103,22 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) return runtimeFunctionsBuilder.ToObjectData(); } - public int TableSize + /// + /// Returns the runtime functions table size and excludes the 4 byte sentinel entry at the end (used by + /// the runtime in NativeUnwindInfoLookupTable::LookupUnwindInfoForMethod) so that it's not treated as + /// part of the table itself. + /// + public int TableSizeExcludingSentinel { get { Debug.Assert(_tableSize >= 0); - return _tableSize; + return _tableSize + SentinelSizeAdjustment; } } public override int ClassCode => -855231428; + + internal const int SentinelSizeAdjustment = -4; } } diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs index 0a29f3ff689b..9f9ebf936628 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs @@ -305,6 +305,7 @@ private void CreateNodeCaches() public RuntimeFunctionsGCInfoNode RuntimeFunctionsGCInfo; public ProfileDataSectionNode ProfileDataSection; + public DelayLoadMethodCallThunkNodeRange DelayLoadMethodCallThunks; public InstanceEntryPointTableNode InstanceEntryPointTable; @@ -502,6 +503,9 @@ public void AttachToDependencyGraph(DependencyAnalyzerBase graph) ProfileDataSection = new ProfileDataSectionNode(); Header.Add(Internal.Runtime.ReadyToRunSectionType.ProfileDataInfo, ProfileDataSection, ProfileDataSection.StartSymbol); + DelayLoadMethodCallThunks = new DelayLoadMethodCallThunkNodeRange(); + Header.Add(Internal.Runtime.ReadyToRunSectionType.DelayLoadMethodCallThunks, DelayLoadMethodCallThunks, DelayLoadMethodCallThunks); + ExceptionInfoLookupTableNode exceptionInfoLookupTableNode = new ExceptionInfoLookupTableNode(this); Header.Add(Internal.Runtime.ReadyToRunSectionType.ExceptionInfo, exceptionInfoLookupTableNode, exceptionInfoLookupTableNode); graph.AddRoot(exceptionInfoLookupTableNode, "ExceptionInfoLookupTable is always generated"); diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs index 7062b6782452..d7d134ac77bd 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs @@ -310,9 +310,9 @@ public override void Compile(string outputFile) foreach (string inputFile in _inputFiles) { string relativeMsilPath = Path.GetRelativePath(_compositeRootPath, inputFile); - if (relativeMsilPath.StartsWith(s_folderUpPrefix)) + if (relativeMsilPath == inputFile || relativeMsilPath.StartsWith(s_folderUpPrefix, StringComparison.Ordinal)) { - // Input file not in the composite root, emit to root output folder + // Input file not under the composite root, emit to root output folder relativeMsilPath = Path.GetFileName(inputFile); } string standaloneMsilOutputFile = Path.Combine(outputDirectory, relativeMsilPath); @@ -484,15 +484,18 @@ protected override void ComputeDependencyNodeDependencies(List + diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs index 3c42b86ccb57..2c2085635f34 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs @@ -226,8 +226,12 @@ public void CompileMethod(MethodWithGCInfo methodCodeNodeNeedingCode) { if (!ShouldSkipCompilation(MethodBeingCompiled)) { - CompileMethodInternal(methodCodeNodeNeedingCode); - codeGotPublished = true; + MethodIL methodIL = _compilation.GetMethodIL(MethodBeingCompiled); + if (methodIL != null) + { + CompileMethodInternal(methodCodeNodeNeedingCode, methodIL); + codeGotPublished = true; + } } } finally @@ -2025,6 +2029,12 @@ private void getGSCookie(IntPtr* pCookieVal, IntPtr** ppCookieVal) *ppCookieVal = (IntPtr *)ObjectToHandle(_compilation.NodeFactory.GetReadyToRunHelperCell(ReadyToRunHelper.GSCookie)); } + private int* getAddrOfCaptureThreadGlobal(ref void* ppIndirection) + { + ppIndirection = (void*)ObjectToHandle(_compilation.NodeFactory.GetReadyToRunHelperCell(ReadyToRunHelper.IndirectTrapThreads)); + return null; + } + private void getMethodVTableOffset(CORINFO_METHOD_STRUCT_* method, ref uint offsetOfIndirection, ref uint offsetAfterIndirection, ref bool isRelative) { throw new NotImplementedException("getMethodVTableOffset"); } private void expandRawHandleIntrinsic(ref CORINFO_RESOLVED_TOKEN pResolvedToken, ref CORINFO_GENERICHANDLE_RESULT pResult) diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/R2RPEBuilder.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/R2RPEBuilder.cs index 95b4035178d3..839b1f21d110 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/R2RPEBuilder.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/R2RPEBuilder.cs @@ -268,6 +268,16 @@ public void AddObjectData(ObjectNode.ObjectData objectData, ObjectNodeSection se _sectionBuilder.AddObjectData(objectData, targetSectionIndex, name, mapFileBuilder); } + /// + /// Add a symbol to the symbol map which defines the area of the binary between the two emitted symbols. + /// This allows relocations (both position and size) to regions of the image. Both nodes must be in the + /// same section and firstNode must be emitted before secondNode. + /// + public void AddSymbolForRange(ISymbolNode symbol, ISymbolNode firstNode, ISymbolNode secondNode) + { + _sectionBuilder.AddSymbolForRange(symbol, firstNode, secondNode); + } + public int GetSymbolFilePosition(ISymbolNode symbol) { return _sectionBuilder.GetSymbolFilePosition(symbol); @@ -497,7 +507,7 @@ protected override PEDirectoriesBuilder GetDirectories() RuntimeFunctionsTableNode runtimeFunctionsTable = _getRuntimeFunctionsTable(); builder.ExceptionTable = new DirectoryEntry( relativeVirtualAddress: _sectionBuilder.GetSymbolRVA(runtimeFunctionsTable), - size: runtimeFunctionsTable.TableSize); + size: runtimeFunctionsTable.TableSizeExcludingSentinel); } return builder; diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs index 3d31687cccf7..dd82ab79c76e 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs @@ -518,6 +518,20 @@ public void AddObjectData(ObjectNode.ObjectData objectData, int sectionIndex, st } } + public void AddSymbolForRange(ISymbolNode symbol, ISymbolNode firstNode, ISymbolNode secondNode) + { + SymbolTarget firstSymbolTarget = _symbolMap[firstNode]; + SymbolTarget secondSymbolTarget = _symbolMap[secondNode]; + Debug.Assert(firstSymbolTarget.SectionIndex == secondSymbolTarget.SectionIndex); + Debug.Assert(firstSymbolTarget.Offset <= secondSymbolTarget.Offset); + + _symbolMap.Add(symbol, new SymbolTarget( + sectionIndex: firstSymbolTarget.SectionIndex, + offset: firstSymbolTarget.Offset, + size: secondSymbolTarget.Offset - firstSymbolTarget.Offset + secondSymbolTarget.Size + )); + } + /// /// Get the list of sections that need to be emitted to the output PE file. /// We filter out name duplicates as we'll end up merging builder sections with the same name diff --git a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/DebugInfo.cs b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/DebugInfo.cs index ff07f31d0b86..706e98780acb 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/DebugInfo.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/DebugInfo.cs @@ -68,6 +68,7 @@ public static string GetPlatformSpecificRegister(Machine machine, int regnum) case Machine.Amd64: return ((Amd64.Registers)regnum).ToString(); case Machine.Arm: + case Machine.ArmThumb2: return ((Arm.Registers)regnum).ToString(); case Machine.Arm64: return ((Arm64.Registers)regnum).ToString(); diff --git a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs index 5f7175ef4e2d..c8fca51fa4be 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs @@ -1472,6 +1472,9 @@ private void ParseHelper(StringBuilder builder) builder.Append("GC_COOKIE"); break; + case ReadyToRunHelper.IndirectTrapThreads: + builder.Append("INDIRECT_TRAP_THREADS"); + break; // // Delay load helpers diff --git a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj index c6266c64df3b..733bd833c140 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj +++ b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj @@ -16,6 +16,14 @@ false Debug;Release;Checked + + + + true + Internal.TypeSystem.SR + + + 4.3.0 diff --git a/src/coreclr/src/utilcode/pedecoder.cpp b/src/coreclr/src/utilcode/pedecoder.cpp index 32e228cd8039..d0854bbc043f 100644 --- a/src/coreclr/src/utilcode/pedecoder.cpp +++ b/src/coreclr/src/utilcode/pedecoder.cpp @@ -288,9 +288,9 @@ CHECK PEDecoder::CheckNTHeaders() const if (IsMapped()) { // Ideally we would require the layout address to honor the section alignment constraints. - // However, we do have 8K aligned IL only images which we load on 32 bit platforms. In this - // case, we can only guarantee OS page alignment (which after all, is good enough.) - CHECK(CheckAligned(m_base, GetOsPageSize())); + // However, we do have 8K aligned IL only images which we load on 32 bit platforms. + // Also in the case of files embedded within a single-file app, the default alignment for assemblies is 16 bytes. + CHECK(CheckAligned(m_base, 16)); } // @todo: check NumberOfSections for overflow of SizeOfHeaders diff --git a/src/coreclr/src/vm/CMakeLists.txt b/src/coreclr/src/vm/CMakeLists.txt index 3af09016309a..81d0e8c21b10 100644 --- a/src/coreclr/src/vm/CMakeLists.txt +++ b/src/coreclr/src/vm/CMakeLists.txt @@ -544,6 +544,20 @@ set(GC_SOURCES_WKS ../gc/softwarewritewatch.cpp ../gc/handletablecache.cpp) +if (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32) + set ( GC_SOURCES_WKS + ${GC_SOURCES_WKS} + ../gc/vxsort/isa_detection.cpp + ../gc/vxsort/do_vxsort_avx2.cpp + ../gc/vxsort/do_vxsort_avx512.cpp + ../gc/vxsort/machine_traits.avx2.cpp + ../gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp + ../gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp + ../gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp + ../gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp +) +endif (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32) + set(GC_HEADERS_WKS ${GC_HEADERS_DAC_AND_WKS_COMMON} ../gc/gceventstatus.h diff --git a/src/coreclr/src/vm/array.h b/src/coreclr/src/vm/array.h index 17cb3dff4c6b..51a7c988c4af 100644 --- a/src/coreclr/src/vm/array.h +++ b/src/coreclr/src/vm/array.h @@ -5,12 +5,11 @@ #ifndef _ARRAY_H_ #define _ARRAY_H_ -#define MAX_RANK 32 // If you make this bigger, you need to make MAX_CLASSNAME_LENGTH bigger too. - // if you have an 32 dim array with at least 2 elements in each dim that - // takes up 4Gig!!! Thus this is a reasonable maximum. -// (Note: at the time of the above comment, the rank was 32, and -// MAX_CLASSNAME_LENGTH was 256. I'm now changing MAX_CLASSNAME_LENGTH -// to 1024, but not changing MAX_RANK.) +// A 32 dimension array with at least 2 elements in each dimension requires +// 4gb of memory. Limit the maximum number of dimensions to a value that +// requires 4gb of memory. +// If you make this bigger, you need to make MAX_CLASSNAME_LENGTH bigger too. +#define MAX_RANK 32 class MethodTable; diff --git a/src/coreclr/src/vm/ceemain.cpp b/src/coreclr/src/vm/ceemain.cpp index 0401160ab17b..5c763f86039d 100644 --- a/src/coreclr/src/vm/ceemain.cpp +++ b/src/coreclr/src/vm/ceemain.cpp @@ -484,13 +484,6 @@ void InitGSCookie() } CONTRACTL_END; -#if defined(TARGET_OSX) && defined(CORECLR_EMBEDDED) - // OSX does not like the way we change section protection when running in a superhost bundle - // disabling this for now - // https://github.com/dotnet/runtime/issues/38184 - return; -#endif - volatile GSCookie * pGSCookiePtr = GetProcessGSCookiePtr(); #ifdef TARGET_UNIX diff --git a/src/coreclr/src/vm/clsload.cpp b/src/coreclr/src/vm/clsload.cpp index de2530b87b76..851266f47576 100644 --- a/src/coreclr/src/vm/clsload.cpp +++ b/src/coreclr/src/vm/clsload.cpp @@ -3260,7 +3260,6 @@ TypeHandle ClassLoader::CreateTypeHandleForTypeKey(TypeKey* pKey, AllocMemTracke } } - // We really don't need this check anymore. if (rank > MAX_RANK) { ThrowTypeLoadException(pKey, IDS_CLASSLOAD_RANK_TOOLARGE); diff --git a/src/coreclr/src/vm/codeman.cpp b/src/coreclr/src/vm/codeman.cpp index 7af2850b83d4..a04894fa77ed 100644 --- a/src/coreclr/src/vm/codeman.cpp +++ b/src/coreclr/src/vm/codeman.cpp @@ -6610,14 +6610,15 @@ StubCodeBlockKind ReadyToRunJitManager::GetStubCodeBlockKind(RangeSection * pRan NOTHROW; GC_NOTRIGGER; MODE_ANY; + SUPPORTS_DAC; } CONTRACTL_END; DWORD rva = (DWORD)(currentPC - pRangeSection->LowAddress); - ReadyToRunInfo * pReadyToRunInfo = dac_cast(pRangeSection->pHeapListOrZapModule)->GetReadyToRunInfo(); + PTR_ReadyToRunInfo pReadyToRunInfo = dac_cast(pRangeSection->pHeapListOrZapModule)->GetReadyToRunInfo(); - IMAGE_DATA_DIRECTORY * pDelayLoadMethodCallThunksDir = pReadyToRunInfo->FindSection(ReadyToRunSectionType::DelayLoadMethodCallThunks); + PTR_IMAGE_DATA_DIRECTORY pDelayLoadMethodCallThunksDir = pReadyToRunInfo->GetDelayMethodCallThunksSection(); if (pDelayLoadMethodCallThunksDir != NULL) { if (pDelayLoadMethodCallThunksDir->VirtualAddress <= rva @@ -6778,6 +6779,12 @@ BOOL ReadyToRunJitManager::JitCodeToMethodInfo(RangeSection * pRangeSection, // READYTORUN: FUTURE: Hot-cold spliting + // If the address is in a thunk, return NULL. + if (GetStubCodeBlockKind(pRangeSection, currentPC) != STUB_CODE_BLOCK_UNKNOWN) + { + return FALSE; + } + TADDR currentInstr = PCODEToPINSTR(currentPC); TADDR ImageBase = pRangeSection->LowAddress; diff --git a/src/coreclr/src/vm/codeman.h b/src/coreclr/src/vm/codeman.h index ae76b6939da0..cba802dc03b6 100644 --- a/src/coreclr/src/vm/codeman.h +++ b/src/coreclr/src/vm/codeman.h @@ -876,6 +876,7 @@ class EEJitManager : public IJitManager { #ifdef DACCESS_COMPILE friend class ClrDataAccess; + friend class DacDbiInterfaceImpl; #endif friend class CheckDuplicatedStructLayouts; friend class CodeHeapIterator; @@ -1619,7 +1620,7 @@ class NativeUnwindInfoLookupTable #ifdef FEATURE_READYTORUN -class ReadyToRunJitManager : public IJitManager +class ReadyToRunJitManager final: public IJitManager { VPTR_VTABLE_CLASS(ReadyToRunJitManager, IJitManager) diff --git a/src/coreclr/src/vm/dllimport.cpp b/src/coreclr/src/vm/dllimport.cpp index 1debfb2b4aae..2fd2fefd1bc8 100644 --- a/src/coreclr/src/vm/dllimport.cpp +++ b/src/coreclr/src/vm/dllimport.cpp @@ -51,6 +51,9 @@ #include "clr/fs/path.h" using namespace clr::fs; +// Specifies whether coreclr is embedded or standalone +extern bool g_coreclr_embedded; + // remove when we get an updated SDK #define LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR 0x00000100 #define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0x00001000 @@ -2923,6 +2926,57 @@ inline CorPinvokeMap GetDefaultCallConv(BOOL bIsVarArg) #endif // !TARGET_UNIX } +namespace +{ + bool TryConvertCallConvValueToPInvokeCallConv(_In_ BYTE callConv, _Out_ CorPinvokeMap *pPinvokeMapOut) + { + LIMITED_METHOD_CONTRACT; + + switch (callConv) + { + case IMAGE_CEE_CS_CALLCONV_C: + *pPinvokeMapOut = pmCallConvCdecl; + return true; + case IMAGE_CEE_CS_CALLCONV_STDCALL: + *pPinvokeMapOut = pmCallConvStdcall; + return true; + case IMAGE_CEE_CS_CALLCONV_THISCALL: + *pPinvokeMapOut = pmCallConvThiscall; + return true; + case IMAGE_CEE_CS_CALLCONV_FASTCALL: + *pPinvokeMapOut = pmCallConvFastcall; + return true; + } + + return false; + } + + HRESULT GetUnmanagedPInvokeCallingConvention( + _In_ Module *pModule, + _In_ PCCOR_SIGNATURE pSig, + _In_ ULONG cSig, + _Out_ CorPinvokeMap *pPinvokeMapOut) + { + CONTRACTL + { + NOTHROW; + GC_NOTRIGGER; + MODE_ANY; + } + CONTRACTL_END + + CorUnmanagedCallingConvention callConvMaybe; + HRESULT hr = MetaSig::TryGetUnmanagedCallingConventionFromModOpt(pModule, pSig, cSig, &callConvMaybe); + if (hr != S_OK) + return hr; + + if (!TryConvertCallConvValueToPInvokeCallConv(callConvMaybe, pPinvokeMapOut)) + return S_FALSE; + + return hr; + } +} + void PInvokeStaticSigInfo::InitCallConv(CorPinvokeMap callConv, BOOL bIsVarArg) { CONTRACTL @@ -2938,9 +2992,8 @@ void PInvokeStaticSigInfo::InitCallConv(CorPinvokeMap callConv, BOOL bIsVarArg) callConv = GetDefaultCallConv(bIsVarArg); CorPinvokeMap sigCallConv = (CorPinvokeMap)0; - BOOL fSuccess = MetaSig::GetUnmanagedCallingConvention(m_pModule, m_sig.GetRawSig(), m_sig.GetRawSigLen(), &sigCallConv); - - if (!fSuccess) + HRESULT hr = GetUnmanagedPInvokeCallingConvention(m_pModule, m_sig.GetRawSig(), m_sig.GetRawSigLen(), &sigCallConv); + if (FAILED(hr)) { SetError(IDS_EE_NDIRECT_BADNATL); //Bad metadata format } @@ -6253,6 +6306,28 @@ namespace } #endif // FEATURE_CORESYSTEM && !TARGET_UNIX +#if defined(TARGET_LINUX) + if (g_coreclr_embedded) + { + // this matches exactly the names in Interop.Libraries.cs + static const LPCWSTR toRedirect[] = { + W("libSystem.Native"), + W("libSystem.IO.Compression.Native"), + W("libSystem.Net.Security.Native"), + W("libSystem.Security.Cryptography.Native.OpenSsl") + }; + + int count = lengthof(toRedirect); + for (int i = 0; i < count; ++i) + { + if (wcscmp(wszLibName, toRedirect[i]) == 0) + { + return PAL_LoadLibraryDirect(NULL); + } + } + } +#endif + AppDomain* pDomain = GetAppDomain(); DWORD loadWithAlteredPathFlags = GetLoadWithAlteredSearchPathFlag(); bool libNameIsRelativePath = Path::IsRelative(wszLibName); @@ -6778,26 +6853,25 @@ PCODE GetILStubForCalli(VASigCookie *pVASigCookie, MethodDesc *pMD) dwStubFlags |= NDIRECTSTUB_FL_UNMANAGED_CALLI; // need to convert the CALLI signature to stub signature with managed calling convention - switch (MetaSig::GetCallingConvention(pVASigCookie->pModule, pVASigCookie->signature)) + BYTE callConv = MetaSig::GetCallingConvention(pVASigCookie->pModule, signature); + + // Unmanaged calling convention indicates modopt should be read + if (callConv == IMAGE_CEE_CS_CALLCONV_UNMANAGED) { - case IMAGE_CEE_CS_CALLCONV_C: - unmgdCallConv = pmCallConvCdecl; - break; - case IMAGE_CEE_CS_CALLCONV_STDCALL: - unmgdCallConv = pmCallConvStdcall; - break; - case IMAGE_CEE_CS_CALLCONV_THISCALL: - unmgdCallConv = pmCallConvThiscall; - break; - case IMAGE_CEE_CS_CALLCONV_FASTCALL: - unmgdCallConv = pmCallConvFastcall; - break; - case IMAGE_CEE_CS_CALLCONV_UNMANAGED: - COMPlusThrow(kNotImplementedException); - default: - COMPlusThrow(kTypeLoadException, IDS_INVALID_PINVOKE_CALLCONV); + CorUnmanagedCallingConvention callConvMaybe; + if (S_OK == MetaSig::TryGetUnmanagedCallingConventionFromModOpt(pVASigCookie->pModule, signature.GetRawSig(), signature.GetRawSigLen(), &callConvMaybe)) + { + callConv = callConvMaybe; + } + else + { + callConv = MetaSig::GetDefaultUnmanagedCallingConvention(); + } } + if (!TryConvertCallConvValueToPInvokeCallConv(callConv, &unmgdCallConv)) + COMPlusThrow(kTypeLoadException, IDS_INVALID_PINVOKE_CALLCONV); + LoaderHeap *pHeap = pVASigCookie->pModule->GetLoaderAllocator()->GetHighFrequencyHeap(); PCOR_SIGNATURE new_sig = (PCOR_SIGNATURE)(void *)pHeap->AllocMem(S_SIZE_T(signature.GetRawSigLen())); CopyMemory(new_sig, signature.GetRawSig(), signature.GetRawSigLen()); diff --git a/src/coreclr/src/vm/ilmarshalers.cpp b/src/coreclr/src/vm/ilmarshalers.cpp index 4905061335ca..8f57b1cf1569 100644 --- a/src/coreclr/src/vm/ilmarshalers.cpp +++ b/src/coreclr/src/vm/ilmarshalers.cpp @@ -2374,21 +2374,15 @@ void ILBlittablePtrMarshaler::EmitConvertContentsNativeToCLR(ILCodeStream* pslIL pslILEmit->EmitLabel(pNullRefLabel); } -bool ILBlittablePtrMarshaler::CanUsePinnedLayoutClass() +bool ILBlittablePtrMarshaler::CanMarshalViaPinning() { return IsCLRToNative(m_dwMarshalFlags) && !IsByref(m_dwMarshalFlags) && !IsFieldMarshal(m_dwMarshalFlags); } -void ILBlittablePtrMarshaler::EmitConvertSpaceAndContentsCLRToNativeTemp(ILCodeStream* pslILEmit) +void ILBlittablePtrMarshaler::EmitMarshalViaPinning(ILCodeStream* pslILEmit) { STANDARD_VM_CONTRACT; - if (!CanUsePinnedLayoutClass()) - { - ILLayoutClassPtrMarshalerBase::EmitConvertSpaceAndContentsCLRToNativeTemp(pslILEmit); - return; - } - ILCodeLabel* pSkipAddLabel = pslILEmit->NewCodeLabel(); LocalDesc managedTypePinned = GetManagedType(); managedTypePinned.MakePinned(); diff --git a/src/coreclr/src/vm/ilmarshalers.h b/src/coreclr/src/vm/ilmarshalers.h index be1e23e37ccf..2b4e6078518e 100644 --- a/src/coreclr/src/vm/ilmarshalers.h +++ b/src/coreclr/src/vm/ilmarshalers.h @@ -2942,9 +2942,8 @@ class ILBlittablePtrMarshaler : public ILLayoutClassPtrMarshalerBase protected: void EmitConvertContentsCLRToNative(ILCodeStream* pslILEmit) override; void EmitConvertContentsNativeToCLR(ILCodeStream* pslILEmit) override; - void EmitConvertSpaceAndContentsCLRToNativeTemp(ILCodeStream* pslILEmit) override; -private: - bool CanUsePinnedLayoutClass(); + bool CanMarshalViaPinning() override; + void EmitMarshalViaPinning(ILCodeStream* pslILEmit) override; }; class ILLayoutClassMarshaler : public ILMarshaler diff --git a/src/coreclr/src/vm/jitinterface.cpp b/src/coreclr/src/vm/jitinterface.cpp index 99073bec81fa..09c077665fe6 100644 --- a/src/coreclr/src/vm/jitinterface.cpp +++ b/src/coreclr/src/vm/jitinterface.cpp @@ -465,10 +465,10 @@ CEEInfo::ConvToJitSig( SigTypeContext::InitTypeContext(contextType, &typeContext); } - _ASSERTE(CORINFO_CALLCONV_DEFAULT == (CorInfoCallConv) IMAGE_CEE_CS_CALLCONV_DEFAULT); - _ASSERTE(CORINFO_CALLCONV_VARARG == (CorInfoCallConv) IMAGE_CEE_CS_CALLCONV_VARARG); - _ASSERTE(CORINFO_CALLCONV_MASK == (CorInfoCallConv) IMAGE_CEE_CS_CALLCONV_MASK); - _ASSERTE(CORINFO_CALLCONV_HASTHIS == (CorInfoCallConv) IMAGE_CEE_CS_CALLCONV_HASTHIS); + static_assert_no_msg(CORINFO_CALLCONV_DEFAULT == (CorInfoCallConv) IMAGE_CEE_CS_CALLCONV_DEFAULT); + static_assert_no_msg(CORINFO_CALLCONV_VARARG == (CorInfoCallConv) IMAGE_CEE_CS_CALLCONV_VARARG); + static_assert_no_msg(CORINFO_CALLCONV_MASK == (CorInfoCallConv) IMAGE_CEE_CS_CALLCONV_MASK); + static_assert_no_msg(CORINFO_CALLCONV_HASTHIS == (CorInfoCallConv) IMAGE_CEE_CS_CALLCONV_HASTHIS); TypeHandle typeHnd = TypeHandle(); @@ -506,6 +506,25 @@ CEEInfo::ConvToJitSig( } #endif // defined(TARGET_UNIX) || defined(TARGET_ARM) + // Unmanaged calling convention indicates modopt should be read + if (sigRet->callConv == CORINFO_CALLCONV_UNMANAGED) + { + static_assert_no_msg(CORINFO_CALLCONV_C == (CorInfoCallConv)IMAGE_CEE_UNMANAGED_CALLCONV_C); + static_assert_no_msg(CORINFO_CALLCONV_STDCALL == (CorInfoCallConv)IMAGE_CEE_UNMANAGED_CALLCONV_STDCALL); + static_assert_no_msg(CORINFO_CALLCONV_THISCALL == (CorInfoCallConv)IMAGE_CEE_UNMANAGED_CALLCONV_THISCALL); + static_assert_no_msg(CORINFO_CALLCONV_FASTCALL == (CorInfoCallConv)IMAGE_CEE_UNMANAGED_CALLCONV_FASTCALL); + + CorUnmanagedCallingConvention callConvMaybe; + if (S_OK == MetaSig::TryGetUnmanagedCallingConventionFromModOpt(module, pSig, cbSig, &callConvMaybe)) + { + sigRet->callConv = (CorInfoCallConv)callConvMaybe; + } + else + { + sigRet->callConv = (CorInfoCallConv)MetaSig::GetDefaultUnmanagedCallingConvention(); + } + } + // Skip number of type arguments if (sigRet->callConv & IMAGE_CEE_CS_CALLCONV_GENERIC) IfFailThrow(sig.GetData(NULL)); @@ -566,10 +585,7 @@ CEEInfo::ConvToJitSig( sigRet->args = (CORINFO_ARG_LIST_HANDLE)sig.GetPtr(); } - if (sigRet->callConv == CORINFO_CALLCONV_UNMANAGED) - { - COMPlusThrowHR(E_NOTIMPL); - } + _ASSERTE(sigRet->callConv != CORINFO_CALLCONV_UNMANAGED); // Set computed flags sigRet->flags = sigRetFlags; @@ -13709,6 +13725,10 @@ BOOL LoadDynamicInfoEntry(Module *currentModule, result = (size_t)GetProcessGSCookie(); break; + case READYTORUN_HELPER_IndirectTrapThreads: + result = (size_t)&g_TrapReturningThreads; + break; + case READYTORUN_HELPER_DelayLoad_MethodCall: result = (size_t)GetEEFuncEntryPoint(DelayLoad_MethodCall); break; diff --git a/src/coreclr/src/vm/method.cpp b/src/coreclr/src/vm/method.cpp index c8d3f6cb7aa9..9c247d6284a0 100644 --- a/src/coreclr/src/vm/method.cpp +++ b/src/coreclr/src/vm/method.cpp @@ -5594,7 +5594,15 @@ MethodDesc::EnumMemoryRegions(CLRDataEnumMemoryFlags flags) #ifdef FEATURE_CODE_VERSIONING // Make sure the active IL and native code version are in triage dumps. - GetCodeVersionManager()->GetActiveILCodeVersion(dac_cast(this)).GetActiveNativeCodeVersion(dac_cast(this)); + CodeVersionManager* pCodeVersionManager = GetCodeVersionManager(); + ILCodeVersion ilVersion = pCodeVersionManager->GetActiveILCodeVersion(dac_cast(this)); + if (!ilVersion.IsNull()) + { + ilVersion.GetActiveNativeCodeVersion(dac_cast(this)); + ilVersion.GetVersionId(); + ilVersion.GetRejitState(); + ilVersion.GetIL(); + } #endif // Also, call DacValidateMD to dump the memory it needs. !clrstack calls diff --git a/src/coreclr/src/vm/pefile.inl b/src/coreclr/src/vm/pefile.inl index 349b755b5fc1..981c2cb8e5a3 100644 --- a/src/coreclr/src/vm/pefile.inl +++ b/src/coreclr/src/vm/pefile.inl @@ -180,7 +180,7 @@ inline const SString &PEFile::GetPath() } CONTRACTL_END; - if (IsDynamic()) + if (IsDynamic() || m_identity->IsInBundle ()) { return SString::Empty(); } diff --git a/src/coreclr/src/vm/peimage.h b/src/coreclr/src/vm/peimage.h index 47d518319899..96b3ea0882cb 100644 --- a/src/coreclr/src/vm/peimage.h +++ b/src/coreclr/src/vm/peimage.h @@ -237,9 +237,7 @@ class PEImage // Private routines // ------------------------------------------------------------ - void Init(LPCWSTR pPath, BundleFileLocation bundleFileLocation); - void Init(IStream* pStream, UINT64 uStreamAsmId, - DWORD dwModuleId, BOOL resourceFile); + void Init(LPCWSTR pPath, BundleFileLocation bundleFileLocation); void VerifyIsILOrNIAssembly(BOOL fIL); diff --git a/src/coreclr/src/vm/readytoruninfo.cpp b/src/coreclr/src/vm/readytoruninfo.cpp index b5b69edaac27..06d238b44b6c 100644 --- a/src/coreclr/src/vm/readytoruninfo.cpp +++ b/src/coreclr/src/vm/readytoruninfo.cpp @@ -683,6 +683,8 @@ ReadyToRunInfo::ReadyToRunInfo(Module * pModule, PEImageLayout * pLayout, READYT m_methodDefEntryPoints = NativeArray(&m_nativeReader, pEntryPointsDir->VirtualAddress); } + m_pSectionDelayLoadMethodCallThunks = m_component.FindSection(ReadyToRunSectionType::DelayLoadMethodCallThunks); + IMAGE_DATA_DIRECTORY * pinstMethodsDir = m_pComposite->FindSection(ReadyToRunSectionType::InstanceMethodEntryPoints); if (pinstMethodsDir != NULL) { diff --git a/src/coreclr/src/vm/readytoruninfo.h b/src/coreclr/src/vm/readytoruninfo.h index b7ec74769bd9..7a1919aa04b9 100644 --- a/src/coreclr/src/vm/readytoruninfo.h +++ b/src/coreclr/src/vm/readytoruninfo.h @@ -61,6 +61,8 @@ class ReadyToRunInfo PTR_RUNTIME_FUNCTION m_pRuntimeFunctions; DWORD m_nRuntimeFunctions; + PTR_IMAGE_DATA_DIRECTORY m_pSectionDelayLoadMethodCallThunks; + PTR_CORCOMPILE_IMPORT_SECTION m_pImportSections; DWORD m_nImportSections; @@ -92,6 +94,8 @@ class ReadyToRunInfo PTR_READYTORUN_HEADER GetReadyToRunHeader() const { return m_pHeader; } + PTR_IMAGE_DATA_DIRECTORY GetDelayMethodCallThunksSection() const { return m_pSectionDelayLoadMethodCallThunks; } + PTR_NativeImage GetNativeImage() const { return m_pNativeImage; } PTR_PEImageLayout GetImage() const { return m_pComposite->GetImage(); } diff --git a/src/coreclr/src/vm/siginfo.cpp b/src/coreclr/src/vm/siginfo.cpp index 1148d53196f5..ba2906f385ea 100644 --- a/src/coreclr/src/vm/siginfo.cpp +++ b/src/coreclr/src/vm/siginfo.cpp @@ -5219,16 +5219,55 @@ BOOL MetaSig::IsReturnTypeVoid() const #ifndef DACCESS_COMPILE +namespace +{ + HRESULT GetNameOfTypeRefOrDef( + _In_ const Module *pModule, + _In_ mdToken token, + _Out_ LPCSTR *namespaceOut, + _Out_ LPCSTR *nameOut) + { + CONTRACTL + { + NOTHROW; + GC_NOTRIGGER; + FORBID_FAULT; + MODE_ANY; + } + CONTRACTL_END + + IMDInternalImport *pInternalImport = pModule->GetMDImport(); + if (TypeFromToken(token) == mdtTypeDef) + { + HRESULT hr = pInternalImport->GetNameOfTypeDef(token, nameOut, namespaceOut); + if (FAILED(hr)) + return hr; + } + else if (TypeFromToken(token) == mdtTypeRef) + { + HRESULT hr = pInternalImport->GetNameOfTypeRef(token, namespaceOut, nameOut); + if (FAILED(hr)) + return hr; + } + else + { + return E_INVALIDARG; + } + + return S_OK; + } +} + //---------------------------------------------------------- // Returns the unmanaged calling convention. //---------------------------------------------------------- /*static*/ -BOOL -MetaSig::GetUnmanagedCallingConvention( - Module * pModule, - PCCOR_SIGNATURE pSig, - ULONG cSig, - CorPinvokeMap * pPinvokeMapOut) +HRESULT +MetaSig::TryGetUnmanagedCallingConventionFromModOpt( + _In_ Module *pModule, + _In_ PCCOR_SIGNATURE pSig, + _In_ ULONG cSig, + _Out_ CorUnmanagedCallingConvention *callConvOut) { CONTRACTL { @@ -5236,53 +5275,61 @@ MetaSig::GetUnmanagedCallingConvention( GC_NOTRIGGER; FORBID_FAULT; MODE_ANY; + PRECONDITION(callConvOut != NULL); } CONTRACTL_END - // Instantiations aren't relevant here MetaSig msig(pSig, cSig, pModule, NULL); PCCOR_SIGNATURE pWalk = msig.m_pRetType.GetPtr(); _ASSERTE(pWalk <= pSig + cSig); + + *callConvOut = (CorUnmanagedCallingConvention)0; while ((pWalk < (pSig + cSig)) && ((*pWalk == ELEMENT_TYPE_CMOD_OPT) || (*pWalk == ELEMENT_TYPE_CMOD_REQD))) { BOOL fIsOptional = (*pWalk == ELEMENT_TYPE_CMOD_OPT); pWalk++; if (pWalk + CorSigUncompressedDataSize(pWalk) > pSig + cSig) - { - return FALSE; // Bad formatting - } + return E_FAIL; // Bad formatting + mdToken tk; pWalk += CorSigUncompressToken(pWalk, &tk); - if (fIsOptional) + if (!fIsOptional) + continue; + + LPCSTR typeNamespace; + LPCSTR typeName; + + // Check for CallConv types specified in modopt + if (FAILED(GetNameOfTypeRefOrDef(pModule, tk, &typeNamespace, &typeName))) + continue; + + if (::strcmp(typeNamespace, CMOD_CALLCONV_NAMESPACE) != 0) + continue; + + const struct { + LPCSTR name; + CorUnmanagedCallingConvention value; + } knownCallConvs[] = { + { CMOD_CALLCONV_NAME_CDECL, IMAGE_CEE_UNMANAGED_CALLCONV_C }, + { CMOD_CALLCONV_NAME_STDCALL, IMAGE_CEE_UNMANAGED_CALLCONV_STDCALL }, + { CMOD_CALLCONV_NAME_THISCALL, IMAGE_CEE_UNMANAGED_CALLCONV_THISCALL }, + { CMOD_CALLCONV_NAME_FASTCALL, IMAGE_CEE_UNMANAGED_CALLCONV_FASTCALL } }; + + for (const auto &callConv : knownCallConvs) { - if (IsTypeRefOrDef("System.Runtime.CompilerServices.CallConvCdecl", pModule, tk)) + // Take the first recognized calling convention in metadata. + if (::strcmp(typeName, callConv.name) == 0) { - *pPinvokeMapOut = pmCallConvCdecl; - return TRUE; - } - else if (IsTypeRefOrDef("System.Runtime.CompilerServices.CallConvStdcall", pModule, tk)) - { - *pPinvokeMapOut = pmCallConvStdcall; - return TRUE; - } - else if (IsTypeRefOrDef("System.Runtime.CompilerServices.CallConvThiscall", pModule, tk)) - { - *pPinvokeMapOut = pmCallConvThiscall; - return TRUE; - } - else if (IsTypeRefOrDef("System.Runtime.CompilerServices.CallConvFastcall", pModule, tk)) - { - *pPinvokeMapOut = pmCallConvFastcall; - return TRUE; + *callConvOut = callConv.value; + return S_OK; } } } - *pPinvokeMapOut = (CorPinvokeMap)0; - return TRUE; + return S_FALSE; } //--------------------------------------------------------------------------------------- diff --git a/src/coreclr/src/vm/siginfo.hpp b/src/coreclr/src/vm/siginfo.hpp index 91e51fc68c5e..64c9341e693e 100644 --- a/src/coreclr/src/vm/siginfo.hpp +++ b/src/coreclr/src/vm/siginfo.hpp @@ -780,9 +780,30 @@ class MetaSig } //---------------------------------------------------------- - // Returns the unmanaged calling convention. + // Gets the unmanaged calling convention by reading any modopts. + // If there are multiple modopts specifying recognized calling + // conventions, the first one that is found in the metadata wins. + // Note: the order in the metadata is the reverse of that in IL. + // + // Returns: + // E_FAIL - Signature had an invalid format + // S_OK - Calling convention was read from modopt + // S_FALSE - Calling convention was not read from modopt //---------------------------------------------------------- - static BOOL GetUnmanagedCallingConvention(Module *pModule, PCCOR_SIGNATURE pSig, ULONG cSig, CorPinvokeMap *pPinvokeMapOut); + static HRESULT TryGetUnmanagedCallingConventionFromModOpt( + _In_ Module *pModule, + _In_ PCCOR_SIGNATURE pSig, + _In_ ULONG cSig, + _Out_ CorUnmanagedCallingConvention *callConvOut); + + static CorUnmanagedCallingConvention GetDefaultUnmanagedCallingConvention() + { +#ifdef TARGET_UNIX + return IMAGE_CEE_UNMANAGED_CALLCONV_C; +#else // TARGET_UNIX + return IMAGE_CEE_UNMANAGED_CALLCONV_STDCALL; +#endif // !TARGET_UNIX + } //------------------------------------------------------------------ // Like NextArg, but return only normalized type (enums flattned to diff --git a/src/coreclr/src/vm/typestring.cpp b/src/coreclr/src/vm/typestring.cpp index 2b414736defe..76e31bbbf175 100644 --- a/src/coreclr/src/vm/typestring.cpp +++ b/src/coreclr/src/vm/typestring.cpp @@ -368,7 +368,7 @@ HRESULT TypeNameBuilder::AddArray(DWORD rank) Append(W("[*]")); else if (rank > 64) { - // Only taken in an error path, runtime will not load arrays of more than 32 dimentions + // Only taken in an error path, runtime will not load arrays of more than 32 dimensions WCHAR wzDim[128]; _snwprintf_s(wzDim, 128, _TRUNCATE, W("[%d]"), rank); Append(wzDim); diff --git a/src/coreclr/src/vm/vars.hpp b/src/coreclr/src/vm/vars.hpp index 57ac31a285ca..ccf9289abab0 100644 --- a/src/coreclr/src/vm/vars.hpp +++ b/src/coreclr/src/vm/vars.hpp @@ -694,7 +694,7 @@ typedef DPTR(GSCookie) PTR_GSCookie; #define READONLY_ATTR #else #ifdef __APPLE__ -#define READONLY_ATTR_ARGS section("__TEXT,__const") +#define READONLY_ATTR_ARGS section("__DATA,__const") #else #define READONLY_ATTR_ARGS section(".rodata") #endif diff --git a/src/coreclr/src/vm/virtualcallstub.h b/src/coreclr/src/vm/virtualcallstub.h index 19e2cc3c1e21..48f81cc13eb1 100644 --- a/src/coreclr/src/vm/virtualcallstub.h +++ b/src/coreclr/src/vm/virtualcallstub.h @@ -220,10 +220,14 @@ typedef VPTR(class VirtualCallStubManager) PTR_VirtualCallStubManager; // see code:#StubDispatchNotes for more class VirtualCallStubManager : public StubManager { - friend class ClrDataAccess; friend class VirtualCallStubManagerManager; friend class VirtualCallStubManagerIterator; +#if defined(DACCESS_COMPILE) + friend class ClrDataAccess; + friend class DacDbiInterfaceImpl; +#endif // DACCESS_COMPILE + VPTR_VTABLE_CLASS(VirtualCallStubManager, StubManager) public: diff --git a/src/coreclr/src/zap/zapinfo.cpp b/src/coreclr/src/zap/zapinfo.cpp index 310c0b93cb05..203196851cc1 100644 --- a/src/coreclr/src/zap/zapinfo.cpp +++ b/src/coreclr/src/zap/zapinfo.cpp @@ -1430,9 +1430,13 @@ LONG * ZapInfo::getAddrOfCaptureThreadGlobal(void **ppIndirection) _ASSERTE(ppIndirection != NULL); *ppIndirection = NULL; - if (!IsReadyToRunCompilation()) + if (IsReadyToRunCompilation()) + { + *ppIndirection = m_pImage->GetImportTable()->GetHelperImport(READYTORUN_HELPER_IndirectTrapThreads); + } + else { - *ppIndirection = (LONG*)m_pImage->GetInnerPtr(m_pImage->m_pEEInfoTable, + *ppIndirection = m_pImage->GetInnerPtr(m_pImage->m_pEEInfoTable, offsetof(CORCOMPILE_EE_INFO_TABLE, addrOfCaptureThreadGlobal)); } diff --git a/src/coreclr/tests/issues.targets b/src/coreclr/tests/issues.targets index 4e8fd381e42c..e19d521e42a4 100644 --- a/src/coreclr/tests/issues.targets +++ b/src/coreclr/tests/issues.targets @@ -5,6 +5,9 @@ https://github.com/dotnet/runtime/issues/11204 + + https://github.com/dotnet/runtime/issues/39361 + timeout @@ -984,6 +987,95 @@ + + Crashes during LLVM AOT compilation. + + + Crashes during LLVM AOT compilation. + + + Crashes during LLVM AOT compilation. + + + + Crashes during LLVM AOT compilation. + + + Crashes during LLVM AOT compilation. + + + + Crashes during LLVM AOT compilation. + + + Crashes during LLVM AOT compilation. + + + Crashes during LLVM AOT compilation. + + + Crashes during LLVM AOT compilation. + + + Crashes during LLVM AOT compilation. + + + Crashes during LLVM AOT compilation. + + + + Crashes during LLVM AOT compilation. + + + Crashes during LLVM AOT compilation. + + + Crashes during LLVM AOT compilation. + + + + Doesn't pass after LLVM AOT compilation. + + + Doesn't pass after LLVM AOT compilation. + + + Doesn't pass after LLVM AOT compilation. + + + Doesn't pass after LLVM AOT compilation. + + + Doesn't pass after LLVM AOT compilation. + + + Doesn't pass after LLVM AOT compilation. + + + Doesn't pass after LLVM AOT compilation. + + + Doesn't pass after LLVM AOT compilation. + + + Doesn't pass after LLVM AOT compilation. + + + Doesn't pass after LLVM AOT compilation. + + + Doesn't pass after LLVM AOT compilation. + + + Doesn't pass after LLVM AOT compilation. + + + Doesn't pass after LLVM AOT compilation. + + + Doesn't pass after LLVM AOT compilation. + + PlatformDetection.IsPreciseGcSupported false on mono @@ -2625,6 +2717,24 @@ needs triage + + needs triage + + + needs triage + + + needs triage + + + needs triage + + + needs triage + + + needs triage + needs triage diff --git a/src/coreclr/tests/src/runtest.proj b/src/coreclr/tests/src/runtest.proj index adc7433ebd98..f4d3e4b88571 100644 --- a/src/coreclr/tests/src/runtest.proj +++ b/src/coreclr/tests/src/runtest.proj @@ -348,6 +348,37 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). + + + + + + + + + + $(CORE_ROOT)\corerun + $(CORE_ROOT)\corerun.exe + + + + + + @(AotEnvVar) + + + + _CorerunExecutable=$(CorerunExecutable);_TestDll=%(TestDlls.Identity);AotEnvVars=@(AotEnvVar) + + + + + @@ -374,6 +405,11 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). + + $(BuildArgs) $(Compiler) $(BuildArgs) $(CMakeArgs) $(BuildArgs) -coreclrartifacts $(CoreCLRArtifactsPath) + $(BuildArgs) -nativelibsartifacts $(LibrariesArtifactsPath)/bin/native/$(NetCoreAppCurrent)-$(TargetOS)-$(LibrariesConfiguration)-$(TargetArchitecture) - - - - + @@ -25,7 +21,9 @@ - + + + diff --git a/src/installer/publish/prepare-artifacts.proj b/src/installer/publish/prepare-artifacts.proj index 1bf2b52c6a52..bd2abccb57a8 100644 --- a/src/installer/publish/prepare-artifacts.proj +++ b/src/installer/publish/prepare-artifacts.proj @@ -7,6 +7,33 @@ true + + + $(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI) + + + $(CollectionUri.Split('/')[3]) + + + $(CollectionUri.Split('.')[0].Split('/')[2]) + + + + + + + + + + + + + + ) + Command.Create(singleFile) + .CaptureStdErr() + .CaptureStdOut() + .EnvironmentVariable(BundleHelper.DotnetBundleExtractBaseEnvVariable, relativePath) + .Execute() + .Should() + .Pass() + .And + .HaveStdOutContaining("Hello World"); + } + [Fact] private void Bundle_extraction_is_reused() { diff --git a/src/libraries/Common/src/Interop/Interop.Calendar.cs b/src/libraries/Common/src/Interop/Interop.Calendar.cs index 494648f1b1ce..9be426d367a6 100644 --- a/src/libraries/Common/src/Interop/Interop.Calendar.cs +++ b/src/libraries/Common/src/Interop/Interop.Calendar.cs @@ -9,8 +9,8 @@ internal static partial class Interop { internal static partial class Globalization { - internal delegate void EnumCalendarInfoCallback( - [MarshalAs(UnmanagedType.LPWStr)] string calendarString, + internal unsafe delegate void EnumCalendarInfoCallback( + char* calendarString, IntPtr context); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetCalendars")] @@ -19,8 +19,15 @@ internal delegate void EnumCalendarInfoCallback( [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetCalendarInfo")] internal static extern unsafe ResultCode GetCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType calendarDataType, char* result, int resultCapacity); +#if TARGET_BROWSER + // Temp workaround for pinvoke callbacks for Mono-Wasm-Interpreter + // https://github.com/dotnet/runtime/issues/39100 + [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_EnumCalendarInfo")] + internal static extern bool EnumCalendarInfo(IntPtr callback, string localeName, CalendarId calendarId, CalendarDataType calendarDataType, IntPtr context); +#else [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_EnumCalendarInfo")] internal static extern bool EnumCalendarInfo(EnumCalendarInfoCallback callback, string localeName, CalendarId calendarId, CalendarDataType calendarDataType, IntPtr context); +#endif [DllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLatestJapaneseEra")] internal static extern int GetLatestJapaneseEra(); diff --git a/src/libraries/Common/src/Interop/Interop.TimeZoneDisplayNameType.cs b/src/libraries/Common/src/Interop/Interop.TimeZoneDisplayNameType.cs new file mode 100644 index 000000000000..f46072196eb9 --- /dev/null +++ b/src/libraries/Common/src/Interop/Interop.TimeZoneDisplayNameType.cs @@ -0,0 +1,16 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +internal static partial class Interop +{ + internal static partial class Globalization + { + // needs to be kept in sync with TimeZoneDisplayNameType in System.Globalization.Native + internal enum TimeZoneDisplayNameType + { + Generic = 0, + Standard = 1, + DaylightSavings = 2, + } + } +} diff --git a/src/libraries/Common/src/Interop/Interop.TimeZoneInfo.cs b/src/libraries/Common/src/Interop/Interop.TimeZoneInfo.cs index 5d848e11ed46..d1ab917229f2 100644 --- a/src/libraries/Common/src/Interop/Interop.TimeZoneInfo.cs +++ b/src/libraries/Common/src/Interop/Interop.TimeZoneInfo.cs @@ -7,14 +7,6 @@ internal static partial class Interop { internal static partial class Globalization { - // needs to be kept in sync with TimeZoneDisplayNameType in System.Globalization.Native - internal enum TimeZoneDisplayNameType - { - Generic = 0, - Standard = 1, - DaylightSavings = 2, - } - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetTimeZoneDisplayName")] internal static extern unsafe ResultCode GetTimeZoneDisplayName( string localeName, diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Digest.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Digest.cs index 799a5d629635..a4f6e52ee9be 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Digest.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Digest.cs @@ -32,6 +32,9 @@ internal static int DigestCurrent(SafeDigestCtxHandle ctx, Span output) => [DllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestCurrent")] private static extern int DigestCurrent(SafeDigestCtxHandle ctx, ref byte pbOutput, int cbOutput); + + [DllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestOneShot")] + internal static unsafe extern int DigestOneShot(PAL_HashAlgorithm algorithm, byte* pbData, int cbData, byte* pbOutput, int cbOutput, out int cbDigest); } } diff --git a/src/libraries/Common/src/Interop/Unix/Interop.Errors.cs b/src/libraries/Common/src/Interop/Unix/Interop.Errors.cs index 6b855f2de21b..4e9b16098dca 100644 --- a/src/libraries/Common/src/Interop/Unix/Interop.Errors.cs +++ b/src/libraries/Common/src/Interop/Unix/Interop.Errors.cs @@ -193,9 +193,11 @@ internal static unsafe string StrError(int platformErrno) private static extern unsafe byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize); #else [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPlatformToPal")] + [SuppressGCTransition] internal static extern Error ConvertErrorPlatformToPal(int platformErrno); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPalToPlatform")] + [SuppressGCTransition] internal static extern int ConvertErrorPalToPlatform(Error error); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_StrErrorR")] diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.Pipe.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.Pipe.cs index 47827f9e1673..9e86930ec284 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.Pipe.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.Pipe.cs @@ -20,6 +20,7 @@ internal static partial class Fcntl internal static extern int SetPipeSz(SafePipeHandle fd, int size); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlCanGetSetPipeSz")] + [SuppressGCTransition] private static extern int FcntlCanGetSetPipeSz(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainSocketSizes.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainSocketSizes.cs index 55020265184e..3748ebfe148f 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainSocketSizes.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainSocketSizes.cs @@ -9,6 +9,7 @@ internal static partial class Interop internal static partial class Sys { [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetDomainSocketSizes")] + [SuppressGCTransition] internal static extern void GetDomainSocketSizes(out int pathOffset, out int pathSize, out int addressSize); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetMaximumAddressSize.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetMaximumAddressSize.cs index f6ae1a0c3049..44617551080a 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetMaximumAddressSize.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetMaximumAddressSize.cs @@ -9,6 +9,7 @@ internal static partial class Interop internal static partial class Sys { [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetMaximumAddressSize")] + [SuppressGCTransition] internal static extern int GetMaximumAddressSize(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetOSArchitecture.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetOSArchitecture.cs index e98e6fe3d3b6..de7b9cd37ad2 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetOSArchitecture.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetOSArchitecture.cs @@ -8,6 +8,7 @@ internal static partial class Interop { internal static partial class Sys { + [SuppressGCTransition] [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetOSArchitecture")] internal static extern int GetOSArchitecture(); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessArchitecture.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessArchitecture.cs index c5b23b691d1c..2dbb0b1eed13 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessArchitecture.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessArchitecture.cs @@ -8,6 +8,7 @@ internal static partial class Interop { internal static partial class Sys { + [SuppressGCTransition] [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetProcessArchitecture")] internal static extern int GetProcessArchitecture(); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IPPacketInformation.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IPPacketInformation.cs index 6156c3e96521..76c992748b62 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IPPacketInformation.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IPPacketInformation.cs @@ -17,7 +17,8 @@ internal struct IPPacketInformation } [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetControlMessageBufferSize")] - internal static extern int GetControlMessageBufferSize(bool isIPv4, bool isIPv6); + [SuppressGCTransition] + internal static extern int GetControlMessageBufferSize(int isIPv4, int isIPv6); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryGetIPPacketInformation")] internal static extern unsafe bool TryGetIPPacketInformation(MessageHeader* messageHeader, bool isIPv4, IPPacketInformation* packetInfo); diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs index a19526c8b925..03afef646f08 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs @@ -20,6 +20,7 @@ internal enum UserFlags : uint internal static readonly bool CanSetHiddenFlag = (LChflagsCanSetHiddenFlag() != 0); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LChflagsCanSetHiddenFlag")] + [SuppressGCTransition] private static extern int LChflagsCanSetHiddenFlag(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MapTcpState.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MapTcpState.cs index 05926e86f699..d16be7edf49a 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MapTcpState.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MapTcpState.cs @@ -9,6 +9,7 @@ internal static partial class Interop internal static partial class Sys { [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MapTcpState")] + [SuppressGCTransition] internal static extern TcpState MapTcpState(int nativeState); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PlatformSocketSupport.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PlatformSocketSupport.cs index 1e67ff7ee9d3..0e406162f9ac 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PlatformSocketSupport.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PlatformSocketSupport.cs @@ -8,6 +8,7 @@ internal static partial class Interop internal static partial class Sys { [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PlatformSupportsDualModeIPv4PacketInfo")] - internal static extern bool PlatformSupportsDualModeIPv4PacketInfo(); + [SuppressGCTransition] + internal static extern int PlatformSupportsDualModeIPv4PacketInfo(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs index 01de4fc1bcb3..67a8a6bfc9bd 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs @@ -57,6 +57,7 @@ internal ReadOnlySpan GetName(Span buffer) internal static extern IntPtr OpenDir(string path); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetReadDirRBufferSize", SetLastError = false)] + [SuppressGCTransition] internal static extern int GetReadDirRBufferSize(); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadDirR", SetLastError = false)] diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RegisterForCtrlC.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RegisterForCtrlC.cs index f3c5b60e40c9..058ea46e22e0 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RegisterForCtrlC.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RegisterForCtrlC.cs @@ -16,9 +16,11 @@ internal enum CtrlCode internal delegate void CtrlCallback(CtrlCode ctrlCode); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_RegisterForCtrl")] + [SuppressGCTransition] internal static extern void RegisterForCtrl(CtrlCallback handler); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_UnregisterForCtrl")] + [SuppressGCTransition] internal static extern void UnregisterForCtrl(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSignalForBreak.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSignalForBreak.cs index 37c892bb370a..51603d6d1e4a 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSignalForBreak.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSignalForBreak.cs @@ -8,9 +8,10 @@ internal static partial class Interop internal static partial class Sys { [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSignalForBreak")] - internal static extern bool GetSignalForBreak(); + [SuppressGCTransition] + internal static extern int GetSignalForBreak(); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSignalForBreak")] - internal static extern bool SetSignalForBreak(bool signalForBreak); + internal static extern int SetSignalForBreak(int signalForBreak); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetTerminalInvalidationHandler.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetTerminalInvalidationHandler.cs index a4ccb94186b7..85b3a8587183 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetTerminalInvalidationHandler.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetTerminalInvalidationHandler.cs @@ -10,6 +10,7 @@ internal partial class Sys internal delegate void TerminalInvalidationCallback(); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetTerminalInvalidationHandler")] + [SuppressGCTransition] internal static extern void SetTerminalInvalidationHandler(TerminalInvalidationCallback handler); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketAddress.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketAddress.cs index 7c1dffc241ff..5770afbf197b 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketAddress.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketAddress.cs @@ -10,24 +10,31 @@ internal static partial class Interop internal static partial class Sys { [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPSocketAddressSizes")] + [SuppressGCTransition] internal static extern unsafe Error GetIPSocketAddressSizes(int* ipv4SocketAddressSize, int* ipv6SocketAddressSize); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAddressFamily")] + [SuppressGCTransition] internal static extern unsafe Error GetAddressFamily(byte* socketAddress, int socketAddressLen, int* addressFamily); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetAddressFamily")] + [SuppressGCTransition] internal static extern unsafe Error SetAddressFamily(byte* socketAddress, int socketAddressLen, int addressFamily); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPort")] + [SuppressGCTransition] internal static extern unsafe Error GetPort(byte* socketAddress, int socketAddressLen, ushort* port); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPort")] + [SuppressGCTransition] internal static extern unsafe Error SetPort(byte* socketAddress, int socketAddressLen, ushort port); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4Address")] + [SuppressGCTransition] internal static extern unsafe Error GetIPv4Address(byte* socketAddress, int socketAddressLen, uint* address); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv4Address")] + [SuppressGCTransition] internal static extern unsafe Error SetIPv4Address(byte* socketAddress, int socketAddressLen, uint address); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv6Address")] diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.cs index e1dc2e0cd58c..ab184581dbcb 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.cs @@ -30,6 +30,9 @@ internal static int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ReadOnlySpan d [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestCurrent")] internal static extern int EvpDigestCurrent(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s); + [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")] + internal static unsafe extern int EvpDigestOneShot(IntPtr type, byte* source, int sourceSize, byte* md, ref uint mdSize); + [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdSize")] internal static extern int EvpMdSize(IntPtr md); diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs new file mode 100644 index 000000000000..f7384436f694 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs @@ -0,0 +1,16 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +using Microsoft.Win32.SafeHandles; + +internal partial class Interop +{ + internal partial class BCrypt + { + [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] + internal static unsafe extern NTSTATUS BCryptHash(SafeBCryptAlgorithmHandle hAlgorithm, byte* pbSecret, int cbSecret, byte* pbInput, int cbInput, byte* pbOutput, int cbOutput); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs index f081fec91943..f71ac5b154ae 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs @@ -21,5 +21,7 @@ internal static bool IsGetConsoleModeCallSuccessful(IntPtr handle) internal static extern bool SetConsoleMode(IntPtr handle, int mode); internal const int ENABLE_PROCESSED_INPUT = 0x0001; + internal const uint ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004; + internal const int STD_OUTPUT_HANDLE = -11; } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.cs index 1bd75631ba1e..b317b13e5499 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.cs @@ -9,7 +9,9 @@ internal static partial class Interop internal static partial class Kernel32 { [DllImport(Libraries.Kernel32)] +#if !NO_SUPPRESS_GC_TRANSITION [SuppressGCTransition] +#endif internal static extern IntPtr GetStdHandle(int nStdHandle); // param is NOT a handle, but it returns one! } } diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/ISSPIInterface.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/ISSPIInterface.cs index b1d82a736d58..62daefd267e7 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/ISSPIInterface.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/ISSPIInterface.cs @@ -14,6 +14,7 @@ internal interface ISSPIInterface int EnumerateSecurityPackages(out int pkgnum, out SafeFreeContextBuffer pkgArray); int AcquireCredentialsHandle(string moduleName, Interop.SspiCli.CredentialUse usage, ref SafeSspiAuthDataHandle authdata, out SafeFreeCredentials outCredential); int AcquireCredentialsHandle(string moduleName, Interop.SspiCli.CredentialUse usage, ref Interop.SspiCli.SCHANNEL_CRED authdata, out SafeFreeCredentials outCredential); + unsafe int AcquireCredentialsHandle(string moduleName, Interop.SspiCli.CredentialUse usage, Interop.SspiCli.SCH_CREDENTIALS* authdata, out SafeFreeCredentials outCredential); int AcquireDefaultCredential(string moduleName, Interop.SspiCli.CredentialUse usage, out SafeFreeCredentials outCredential); int AcceptSecurityContext(SafeFreeCredentials? credential, ref SafeDeleteSslContext? context, InputSecurityBuffers inputBuffers, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags); int InitializeSecurityContext(ref SafeFreeCredentials? credential, ref SafeDeleteSslContext? context, string? targetName, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, InputSecurityBuffers inputBuffers, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags); diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.cs index 9db80f3ae965..9556c5054533 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.cs @@ -214,6 +214,92 @@ public enum Flags } } + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct SCH_CREDENTIALS + { + public const int CurrentVersion = 0x5; + + public int dwVersion; + public int dwCredformat; + public int cCreds; + + // This is pointer to arry of CERT_CONTEXT* + // We do not use it directly in .NET. Instead, we wrap returned OS pointer in safe handle. + public void* paCred; + + public IntPtr hRootStore; // == always null, OTHERWISE NOT RELIABLE + public int cMappers; + public IntPtr aphMappers; // == always null, OTHERWISE NOT RELIABLE + + public int dwSessionLifespan; + public SCH_CREDENTIALS.Flags dwFlags; + public int cTlsParameters; + public TLS_PARAMETERS* pTlsParameters; + + [Flags] + public enum Flags + { + Zero = 0, + SCH_CRED_NO_SYSTEM_MAPPER = 0x02, + SCH_CRED_NO_SERVERNAME_CHECK = 0x04, + SCH_CRED_MANUAL_CRED_VALIDATION = 0x08, + SCH_CRED_NO_DEFAULT_CREDS = 0x10, + SCH_CRED_AUTO_CRED_VALIDATION = 0x20, + SCH_CRED_USE_DEFAULT_CREDS = 0x40, + SCH_DISABLE_RECONNECTS = 0x80, + SCH_CRED_REVOCATION_CHECK_END_CERT = 0x100, + SCH_CRED_REVOCATION_CHECK_CHAIN = 0x200, + SCH_CRED_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT = 0x400, + SCH_CRED_IGNORE_NO_REVOCATION_CHECK = 0x800, + SCH_CRED_IGNORE_REVOCATION_OFFLINE = 0x1000, + SCH_CRED_CACHE_ONLY_URL_RETRIEVAL_ON_CREATE = 0x2000, + SCH_SEND_ROOT_CERT = 0x40000, + SCH_SEND_AUX_RECORD = 0x00200000, + SCH_USE_STRONG_CRYPTO = 0x00400000, + SCH_USE_PRESHAREDKEY_ONLY = 0x800000, + SCH_ALLOW_NULL_ENCRYPTION = 0x02000000, + } + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct TLS_PARAMETERS + { + public int cAlpnIds; // Valid for server applications only. Must be zero otherwise. Number of ALPN IDs in rgstrAlpnIds; set to 0 if applies to all. + public IntPtr rgstrAlpnIds; // Valid for server applications only. Must be NULL otherwise. Array of ALPN IDs that the following settings apply to; set to NULL if applies to all. + public uint grbitDisabledProtocols; // List protocols you DO NOT want negotiated. + public int cDisabledCrypto; // Number of CRYPTO_SETTINGS structures; set to 0 if there are none. + public CRYPTO_SETTINGS* pDisabledCrypto; // Array of CRYPTO_SETTINGS structures; set to NULL if there are none; + public TLS_PARAMETERS.Flags dwFlags; // Optional flags to pass; set to 0 if there are none. + + [Flags] + public enum Flags + { + Zero = 0, + TLS_PARAMS_OPTIONAL = 0x01, // Valid for server applications only. Must be zero otherwise. + // TLS_PARAMETERS that will only be honored if they do not cause this server to terminate the handshake. + } + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct CRYPTO_SETTINGS + { + public TlsAlgorithmUsage eAlgorithmUsage; // How this algorithm is being used. + public UNICODE_STRING* strCngAlgId; // CNG algorithm identifier. + public int cChainingModes; // Set to 0 if CNG algorithm does not have a chaining mode. + public UNICODE_STRING* rgstrChainingModes; // Set to NULL if CNG algorithm does not have a chaining mode. + public int dwMinBitLength; // Blacklist key sizes less than this. Set to 0 if not defined or CNG algorithm implies bit length. + public int dwMaxBitLength; // Blacklist key sizes greater than this. Set to 0 if not defined or CNG algorithm implies bit length. + + public enum TlsAlgorithmUsage + { + TlsParametersCngAlgUsageKeyExchange, // Key exchange algorithm. RSA, ECHDE, DHE, etc. + TlsParametersCngAlgUsageSignature, // Signature algorithm. RSA, DSA, ECDSA, etc. + TlsParametersCngAlgUsageCipher, // Encryption algorithm. AES, DES, RC4, etc. + TlsParametersCngAlgUsageDigest, // Digest of cipher suite. SHA1, SHA256, SHA384, etc. + TlsParametersCngAlgUsageCertSig // Signature and/or hash used to sign certificate. RSA, DSA, ECDSA, SHA1, SHA256, etc. + } + } + [StructLayout(LayoutKind.Sequential)] internal unsafe struct SecBuffer { @@ -344,6 +430,20 @@ internal static extern unsafe int AcquireCredentialsHandleW( [Out] out long timeStamp ); + [DllImport(Interop.Libraries.SspiCli, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)] + internal static extern unsafe int AcquireCredentialsHandleW( + [In] string? principal, + [In] string moduleName, + [In] int usage, + [In] void* logonID, + [In] SCH_CREDENTIALS* authData, + [In] void* keyCallback, + [In] void* keyArgument, + ref CredHandle handlePtr, + [Out] out long timeStamp + ); + + [DllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)] internal static extern unsafe int InitializeSecurityContextW( ref CredHandle credentialHandle, diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIAuthType.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIAuthType.cs index a29658dd67c4..7d359791a0fe 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIAuthType.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIAuthType.cs @@ -45,6 +45,11 @@ public int AcquireCredentialsHandle(string moduleName, Interop.SspiCli.Credentia return SafeFreeCredentials.AcquireCredentialsHandle(moduleName, usage, ref authdata, out outCredential); } + public unsafe int AcquireCredentialsHandle(string moduleName, Interop.SspiCli.CredentialUse usage, Interop.SspiCli.SCH_CREDENTIALS* authdata, out SafeFreeCredentials outCredential) + { + return SafeFreeCredentials.AcquireCredentialsHandle(moduleName, usage, authdata, out outCredential); + } + public int AcceptSecurityContext(SafeFreeCredentials? credential, ref SafeDeleteSslContext? context, InputSecurityBuffers inputBuffers, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags) { return SafeDeleteContext.AcceptSecurityContext(ref credential, ref context, inFlags, endianness, inputBuffers, ref outputBuffer, ref outFlags); diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPISecureChannelType.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPISecureChannelType.cs index 0e9bc6275aa9..e30e53d27262 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPISecureChannelType.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPISecureChannelType.cs @@ -45,6 +45,11 @@ public int AcquireCredentialsHandle(string moduleName, Interop.SspiCli.Credentia return SafeFreeCredentials.AcquireCredentialsHandle(moduleName, usage, ref authdata, out outCredential); } + public unsafe int AcquireCredentialsHandle(string moduleName, Interop.SspiCli.CredentialUse usage, Interop.SspiCli.SCH_CREDENTIALS* authdata, out SafeFreeCredentials outCredential) + { + return SafeFreeCredentials.AcquireCredentialsHandle(moduleName, usage, authdata, out outCredential); + } + public int AcceptSecurityContext(SafeFreeCredentials? credential, ref SafeDeleteSslContext? context, InputSecurityBuffers inputBuffers, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags) { return SafeDeleteContext.AcceptSecurityContext(ref credential, ref context, inFlags, endianness, inputBuffers, ref outputBuffer, ref outFlags); diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs index 74772416a15c..eaf912697a91 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs @@ -110,14 +110,28 @@ public static SafeFreeCredentials AcquireCredentialsHandle(ISSPIInterface secMod public static SafeFreeCredentials AcquireCredentialsHandle(ISSPIInterface secModule, string package, Interop.SspiCli.CredentialUse intent, Interop.SspiCli.SCHANNEL_CRED scc) { - if (NetEventSource.Log.IsEnabled()) NetEventSource.Log.AcquireCredentialsHandle(package, intent, scc); - - SafeFreeCredentials? outCredential = null; int errorCode = secModule.AcquireCredentialsHandle( package, intent, ref scc, - out outCredential); + out SafeFreeCredentials outCredential); + + if (errorCode != 0) + { + if (NetEventSource.IsEnabled) NetEventSource.Error(null, SR.Format(SR.net_log_operation_failed_with_error, nameof(AcquireCredentialsHandle), $"0x{errorCode:X}")); + throw new Win32Exception(errorCode); + } + + return outCredential; + } + + public static unsafe SafeFreeCredentials AcquireCredentialsHandle(ISSPIInterface secModule, string package, Interop.SspiCli.CredentialUse intent, Interop.SspiCli.SCH_CREDENTIALS* scc) + { + int errorCode = secModule.AcquireCredentialsHandle( + package, + intent, + scc, + out SafeFreeCredentials outCredential); if (errorCode != 0) { diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs index b4f3eb526723..bef2693adb88 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs @@ -301,6 +301,38 @@ public static unsafe int AcquireCredentialsHandle( return errorCode; } + + public static unsafe int AcquireCredentialsHandle( + string package, + Interop.SspiCli.CredentialUse intent, + Interop.SspiCli.SCH_CREDENTIALS* authdata, + out SafeFreeCredentials outCredential) + { + long timeStamp; + + outCredential = new SafeFreeCredential_SECURITY(); + + int errorCode = Interop.SspiCli.AcquireCredentialsHandleW( + null, + package, + (int)intent, + null, + authdata, + null, + null, + ref outCredential._handle, + out timeStamp); + + if (NetEventSource.IsEnabled) NetEventSource.Verbose(null, $"{nameof(Interop.SspiCli.AcquireCredentialsHandleW)} returns 0x{errorCode:x}, handle = {outCredential}"); + + if (errorCode != 0) + { + outCredential.SetHandleAsInvalid(); + } + + return errorCode; + } + } // diff --git a/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp_types.cs b/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp_types.cs index 720afa5aab05..9dd0d81b56cf 100644 --- a/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp_types.cs +++ b/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp_types.cs @@ -153,6 +153,7 @@ internal partial class WinHttp public const uint WINHTTP_OPTION_HTTP_PROTOCOL_USED = 134; public const uint WINHTTP_PROTOCOL_FLAG_HTTP2 = 0x1; public const uint WINHTTP_HTTP2_PLUS_CLIENT_CERT_FLAG = 0x1; + public const uint WINHTTP_OPTION_DISABLE_STREAM_QUEUE = 139; public const uint WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET = 114; public const uint WINHTTP_OPTION_WEB_SOCKET_CLOSE_TIMEOUT = 115; diff --git a/src/libraries/Common/src/System/LocalAppContextSwitches.Common.cs b/src/libraries/Common/src/System/LocalAppContextSwitches.Common.cs index 4457c0820d01..bcbc8d56093a 100644 --- a/src/libraries/Common/src/System/LocalAppContextSwitches.Common.cs +++ b/src/libraries/Common/src/System/LocalAppContextSwitches.Common.cs @@ -51,6 +51,11 @@ private static bool GetSwitchDefaultValue(string switchName) return true; } + if (switchName == "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization") + { + return true; + } + return false; } } diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockConnection.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockConnection.cs index 361474bcb1c8..cba2f936ef8d 100644 --- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockConnection.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockConnection.cs @@ -93,7 +93,7 @@ internal override async ValueTask ConnectAsync(CancellationToken cancellationTok int bytesRead = 0; do { - bytesRead += await socket.ReceiveAsync(buffer.AsMemory().Slice(bytesRead), SocketFlags.None).ConfigureAwait(false); + bytesRead += await socket.ReceiveAsync(buffer.AsMemory().Slice(bytesRead), SocketFlags.None, cancellationToken).ConfigureAwait(false); } while (bytesRead != buffer.Length); int peerListenPort = BinaryPrimitives.ReadInt32LittleEndian(buffer); @@ -163,7 +163,7 @@ internal override async ValueTask AcceptStreamAsync(Cancella int bytesRead = 0; do { - bytesRead += await socket.ReceiveAsync(buffer.AsMemory().Slice(bytesRead), SocketFlags.None).ConfigureAwait(false); + bytesRead += await socket.ReceiveAsync(buffer.AsMemory().Slice(bytesRead), SocketFlags.None, cancellationToken).ConfigureAwait(false); } while (bytesRead != buffer.Length); long streamId = BinaryPrimitives.ReadInt64LittleEndian(buffer); diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockListener.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockListener.cs index f4c0cfdf2c2f..e7b24548d2cf 100644 --- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockListener.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockListener.cs @@ -45,7 +45,7 @@ internal override async ValueTask AcceptConnectionAsync( int bytesRead = 0; do { - bytesRead += await socket.ReceiveAsync(buffer.AsMemory().Slice(bytesRead), SocketFlags.None).ConfigureAwait(false); + bytesRead += await socket.ReceiveAsync(buffer.AsMemory().Slice(bytesRead), SocketFlags.None, cancellationToken).ConfigureAwait(false); } while (bytesRead != buffer.Length); int peerListenPort = BinaryPrimitives.ReadInt32LittleEndian(buffer); diff --git a/src/libraries/Common/src/System/Net/WebSockets/ManagedWebSocket.cs b/src/libraries/Common/src/System/Net/WebSockets/ManagedWebSocket.cs index 219439ba721c..77e89ea60a97 100644 --- a/src/libraries/Common/src/System/Net/WebSockets/ManagedWebSocket.cs +++ b/src/libraries/Common/src/System/Net/WebSockets/ManagedWebSocket.cs @@ -368,7 +368,7 @@ private ValueTask SendFrameAsync(MessageOpcode opcode, bool endOfMessage, ReadOn // pass around (the CancellationTokenRegistration), so if it is cancelable, just immediately go to the fallback path. // Similarly, it should be rare that there are multiple outstanding calls to SendFrameAsync, but if there are, again // fall back to the fallback path. - return cancellationToken.CanBeCanceled || !_sendFrameAsyncLock.Wait(0) ? + return cancellationToken.CanBeCanceled || !_sendFrameAsyncLock.Wait(0, default) ? SendFrameFallbackAsync(opcode, endOfMessage, payloadBuffer, cancellationToken) : SendFrameLockAcquiredNonCancelableAsync(opcode, endOfMessage, payloadBuffer); } @@ -384,7 +384,7 @@ private ValueTask SendFrameLockAcquiredNonCancelableAsync(MessageOpcode opcode, // If we get here, the cancellation token is not cancelable so we don't have to worry about it, // and we own the semaphore, so we don't need to asynchronously wait for it. ValueTask writeTask = default; - bool releaseSemaphoreAndSendBuffer = true; + bool releaseSendBufferAndSemaphore = true; try { // Write the payload synchronously to the buffer, then write that buffer out to the network. @@ -402,7 +402,7 @@ private ValueTask SendFrameLockAcquiredNonCancelableAsync(MessageOpcode opcode, // Up until this point, if an exception occurred (such as when accessing _stream or when // calling GetResult), we want to release the semaphore and the send buffer. After this point, // both need to be held until writeTask completes. - releaseSemaphoreAndSendBuffer = false; + releaseSendBufferAndSemaphore = false; } catch (Exception exc) { @@ -413,10 +413,10 @@ private ValueTask SendFrameLockAcquiredNonCancelableAsync(MessageOpcode opcode, } finally { - if (releaseSemaphoreAndSendBuffer) + if (releaseSendBufferAndSemaphore) { - _sendFrameAsyncLock.Release(); ReleaseSendBuffer(); + _sendFrameAsyncLock.Release(); } } @@ -437,8 +437,8 @@ private async ValueTask WaitForWriteTaskAsync(ValueTask writeTask) } finally { - _sendFrameAsyncLock.Release(); ReleaseSendBuffer(); + _sendFrameAsyncLock.Release(); } } @@ -461,8 +461,8 @@ private async ValueTask SendFrameFallbackAsync(MessageOpcode opcode, bool endOfM } finally { - _sendFrameAsyncLock.Release(); ReleaseSendBuffer(); + _sendFrameAsyncLock.Release(); } } @@ -1277,6 +1277,8 @@ private void AllocateSendBuffer(int minLength) /// Releases the send buffer to the pool. private void ReleaseSendBuffer() { + Debug.Assert(_sendFrameAsyncLock.CurrentCount == 0, "Caller should hold the _sendFrameAsyncLock"); + byte[]? old = _sendBuffer; if (old != null) { diff --git a/src/libraries/Common/src/System/Runtime/InteropServices/SuppressGCTransitionAttribute.internal.cs b/src/libraries/Common/src/System/Runtime/InteropServices/SuppressGCTransitionAttribute.internal.cs deleted file mode 100644 index e9fbb73111d2..000000000000 --- a/src/libraries/Common/src/System/Runtime/InteropServices/SuppressGCTransitionAttribute.internal.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// Internal copy of SuppressGCTransitionAttribute used only to enable files -// that use this to compile. On any platforms that support this attribute, -// the real one exposed from CoreLib should be used. - -namespace System.Runtime.InteropServices -{ - [AttributeUsage(AttributeTargets.Method)] - internal sealed class SuppressGCTransitionAttribute : Attribute { } -} diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/PooledByteBufferWriter.cs b/src/libraries/Common/src/System/Text/Json/PooledByteBufferWriter.cs similarity index 91% rename from src/libraries/System.Text.Json/src/System/Text/Json/Serialization/PooledByteBufferWriter.cs rename to src/libraries/Common/src/System/Text/Json/PooledByteBufferWriter.cs index 3c3b5e169bd7..6d6feee2aec4 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/PooledByteBufferWriter.cs +++ b/src/libraries/Common/src/System/Text/Json/PooledByteBufferWriter.cs @@ -3,7 +3,9 @@ using System.Buffers; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.IO; +using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; @@ -166,4 +168,14 @@ private void CheckAndResizeBuffer(int sizeHint) Debug.Assert(_rentedBuffer.Length - _index >= sizeHint); } } + + internal static partial class ThrowHelper + { + [DoesNotReturn] + [MethodImpl(MethodImplOptions.NoInlining)] + public static void ThrowOutOfMemoryException_BufferMaximumSizeExceeded(uint capacity) + { + throw new OutOfMemoryException(SR.Format(SR.BufferMaximumSizeExceeded, capacity)); + } + } } diff --git a/src/libraries/Common/tests/System/Collections/IEnumerable.Generic.Serialization.Tests.cs b/src/libraries/Common/tests/System/Collections/IEnumerable.Generic.Serialization.Tests.cs index aa20a9a68547..ce3bca0f9fb3 100644 --- a/src/libraries/Common/tests/System/Collections/IEnumerable.Generic.Serialization.Tests.cs +++ b/src/libraries/Common/tests/System/Collections/IEnumerable.Generic.Serialization.Tests.cs @@ -9,7 +9,7 @@ namespace System.Collections.Tests { public abstract partial class IEnumerable_Generic_Tests : TestBase { - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] [MemberData(nameof(ValidCollectionSizes))] public void IGenericSharedAPI_SerializeDeserialize(int count) { diff --git a/src/libraries/Common/tests/System/Collections/IEnumerable.NonGeneric.Serialization.Tests.cs b/src/libraries/Common/tests/System/Collections/IEnumerable.NonGeneric.Serialization.Tests.cs index 8fbdfd9cbe1b..8ad921ce7264 100644 --- a/src/libraries/Common/tests/System/Collections/IEnumerable.NonGeneric.Serialization.Tests.cs +++ b/src/libraries/Common/tests/System/Collections/IEnumerable.NonGeneric.Serialization.Tests.cs @@ -11,7 +11,7 @@ namespace System.Collections.Tests { public abstract partial class IEnumerable_NonGeneric_Tests : TestBase { - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] [MemberData(nameof(ValidCollectionSizes))] public void IGenericSharedAPI_SerializeDeserialize(int count) { diff --git a/src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs b/src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs index e8aeadb85765..90a6c35c0f2a 100644 --- a/src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs +++ b/src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs @@ -14,7 +14,7 @@ public abstract class CompressionStreamUnitTestBase : CompressionStreamTestBase { private const int TaskTimeout = 30 * 1000; // Generous timeout for official test runs - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] public virtual void FlushAsync_DuringWriteAsync() { if (FlushNoOps) @@ -49,7 +49,7 @@ public virtual void FlushAsync_DuringWriteAsync() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] public async Task FlushAsync_DuringReadAsync() { if (FlushNoOps) @@ -78,7 +78,7 @@ public async Task FlushAsync_DuringReadAsync() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] public async Task FlushAsync_DuringFlushAsync() { if (FlushNoOps) @@ -121,7 +121,7 @@ public async Task FlushAsync_DuringFlushAsync() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] public virtual void WriteAsync_DuringWriteAsync() { byte[] buffer = new byte[100000]; @@ -154,7 +154,7 @@ public virtual void WriteAsync_DuringWriteAsync() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] public async Task ReadAsync_DuringReadAsync() { byte[] buffer = new byte[32]; @@ -179,7 +179,7 @@ public async Task ReadAsync_DuringReadAsync() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] public virtual async Task Dispose_WithUnfinishedReadAsync() { string compressedPath = CompressedTestFile(UncompressedTestFile()); diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs index a4a74cdc9ee4..a04299384915 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs @@ -47,9 +47,9 @@ public static partial class PlatformDetection public static bool IsNotFedoraOrRedHatFamily => !IsFedora && !IsRedHatFamily; public static bool IsNotDebian10 => !IsDebian10; - public static bool IsSuperUser => !IsWindows ? + public static bool IsSuperUser => IsBrowser ? false : (!IsWindows ? libc.geteuid() == 0 : - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException()); public static Version OpenSslVersion => !IsOSXLike && !IsWindows ? GetOpenSslVersion() : diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index 48a2f5ccfe32..68d07741e57a 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -74,9 +74,9 @@ public static bool IsDrawingSupported public static bool SupportsSsl2 => IsWindows && !PlatformDetection.IsWindows10Version1607OrGreater; #if NETCOREAPP - public static bool IsReflectionEmitSupported = RuntimeFeature.IsDynamicCodeSupported; + public static bool IsReflectionEmitSupported => RuntimeFeature.IsDynamicCodeSupported; #else - public static bool IsReflectionEmitSupported = true; + public static bool IsReflectionEmitSupported => true; #endif public static bool IsInvokingStaticConstructorsSupported => true; diff --git a/src/libraries/Common/tests/Tests/System/StringTests.cs b/src/libraries/Common/tests/Tests/System/StringTests.cs index 547e4fd249c0..74ceefc4cc6a 100644 --- a/src/libraries/Common/tests/Tests/System/StringTests.cs +++ b/src/libraries/Common/tests/Tests/System/StringTests.cs @@ -482,144 +482,149 @@ public static void CopyTo_Invalid() AssertExtensions.Throws("sourceIndex", () => s.CopyTo(0, dst, 0, 6)); } + public static IEnumerable Compare_TestData() + { + // CurrentCulture + yield return new object[] { "", 0, "", 0, 0, StringComparison.CurrentCulture, 0 }; + yield return new object[] { "Hello", 0, "Hello", 0, 5, StringComparison.CurrentCulture, 0 }; + yield return new object[] { "Hello", 2, "Hello", 3, 1, StringComparison.CurrentCulture, 0 }; + yield return new object[] { "Hello", 0, "Goodbye", 0, 5, StringComparison.CurrentCulture, 1 }; + yield return new object[] { "Goodbye", 0, "Hello", 0, 5, StringComparison.CurrentCulture, -1 }; + yield return new object[] { "HELLO", 2, "hello", 2, 3, StringComparison.CurrentCulture, PlatformDetection.IsInvariantGlobalization ? -1 : 1 }; + yield return new object[] { "hello", 2, "HELLO", 2, 3, StringComparison.CurrentCulture, PlatformDetection.IsInvariantGlobalization ? 1 : -1 }; + yield return new object[] { "Hello", 2, "Hello", 2, 3, StringComparison.CurrentCulture, 0 }; + yield return new object[] { "Hello", 2, "Goodbye", 2, 3, StringComparison.CurrentCulture, -1 }; + yield return new object[] { "A", 0, "B", 0, 1, StringComparison.CurrentCulture, -1 }; + yield return new object[] { "B", 0, "A", 0, 1, StringComparison.CurrentCulture, 1 }; + yield return new object[] { null, 0, null, 0, 0, StringComparison.CurrentCulture, 0 }; + yield return new object[] { "Hello", 0, null, 0, 0, StringComparison.CurrentCulture, 1 }; + yield return new object[] { null, 0, "Hello", 0, 0, StringComparison.CurrentCulture, -1 }; + yield return new object[] { null, -1, null, -1, -1, StringComparison.CurrentCulture, 0 }; + yield return new object[] { "foo", -1, null, -1, -1, StringComparison.CurrentCulture, 1 }; + yield return new object[] { null, -1, "foo", -1, -1, StringComparison.CurrentCulture, -1 }; + // CurrentCultureIgnoreCase + yield return new object[] { "", 0, "", 0, 0, StringComparison.CurrentCultureIgnoreCase, 0 }; + yield return new object[] { "HELLO", 0, "hello", 0, 5, StringComparison.CurrentCultureIgnoreCase, 0 }; + yield return new object[] { "Hello", 2, "Hello", 3, 1, StringComparison.CurrentCultureIgnoreCase, 0 }; + yield return new object[] { "Hello", 0, "Hello", 0, 5, StringComparison.CurrentCultureIgnoreCase, 0 }; + yield return new object[] { "Hello", 2, "Hello", 2, 3, StringComparison.CurrentCultureIgnoreCase, 0 }; + yield return new object[] { "Hello", 2, "Yellow", 2, 3, StringComparison.CurrentCultureIgnoreCase, 0 }; + yield return new object[] { "Hello", 0, "Goodbye", 0, 5, StringComparison.CurrentCultureIgnoreCase, 1 }; + yield return new object[] { "Goodbye", 0, "Hello", 0, 5, StringComparison.CurrentCultureIgnoreCase, -1 }; + yield return new object[] { "HELLO", 2, "hello", 2, 3, StringComparison.CurrentCultureIgnoreCase, 0 }; + yield return new object[] { "Hello", 2, "Goodbye", 2, 3, StringComparison.CurrentCultureIgnoreCase, -1 }; + yield return new object[] { null, 0, null, 0, 0, StringComparison.CurrentCultureIgnoreCase, 0 }; + yield return new object[] { "Hello", 0, null, 0, 0, StringComparison.CurrentCultureIgnoreCase, 1 }; + yield return new object[] { null, 0, "Hello", 0, 0, StringComparison.CurrentCultureIgnoreCase, -1 }; + yield return new object[] { null, -1, null, -1, -1, StringComparison.CurrentCultureIgnoreCase, 0 }; + yield return new object[] { "foo", -1, null, -1, -1, StringComparison.CurrentCultureIgnoreCase, 1 }; + yield return new object[] { null, -1, "foo", -1, -1, StringComparison.CurrentCultureIgnoreCase, -1 }; + // InvariantCulture + yield return new object[] { "", 0, "", 0, 0, StringComparison.InvariantCulture, 0 }; + yield return new object[] { "Hello", 0, "Hello", 0, 5, StringComparison.InvariantCulture, 0 }; + yield return new object[] { "Hello", 2, "Hello", 3, 1, StringComparison.InvariantCulture, 0 }; + yield return new object[] { "Hello", 0, "Goodbye", 0, 5, StringComparison.InvariantCulture, 1 }; + yield return new object[] { "Goodbye", 0, "Hello", 0, 5, StringComparison.InvariantCulture, -1 }; + yield return new object[] { "HELLO", 2, "hello", 2, 3, StringComparison.InvariantCulture, PlatformDetection.IsInvariantGlobalization ? -1 : 1 }; + yield return new object[] { "hello", 2, "HELLO", 2, 3, StringComparison.InvariantCulture, PlatformDetection.IsInvariantGlobalization ? 1 : -1 }; + yield return new object[] { null, 0, null, 0, 0, StringComparison.InvariantCulture, 0 }; + yield return new object[] { "Hello", 0, null, 0, 5, StringComparison.InvariantCulture, 1 }; + yield return new object[] { null, 0, "Hello", 0, 5, StringComparison.InvariantCulture, -1 }; + // InvariantCultureIgnoreCase + yield return new object[] { "", 0, "", 0, 0, StringComparison.InvariantCultureIgnoreCase, 0 }; + yield return new object[] { "HELLO", 0, "hello", 0, 5, StringComparison.InvariantCultureIgnoreCase, 0 }; + yield return new object[] { "Hello", 0, "Hello", 0, 5, StringComparison.InvariantCultureIgnoreCase, 0 }; + yield return new object[] { "Hello", 2, "Hello", 3, 1, StringComparison.InvariantCultureIgnoreCase, 0 }; + yield return new object[] { "Hello", 2, "Hello", 2, 3, StringComparison.InvariantCultureIgnoreCase, 0 }; + yield return new object[] { "Hello", 2, "Yellow", 2, 3, StringComparison.InvariantCultureIgnoreCase, 0 }; + yield return new object[] { "Hello", 0, "Goodbye", 0, 5, StringComparison.InvariantCultureIgnoreCase, 1 }; + yield return new object[] { "Goodbye", 0, "Hello", 0, 5, StringComparison.InvariantCultureIgnoreCase, -1 }; + yield return new object[] { "HELLO", 2, "hello", 2, 3, StringComparison.InvariantCultureIgnoreCase, 0 }; + yield return new object[] { "Hello", 2, "Goodbye", 2, 3, StringComparison.InvariantCultureIgnoreCase, -1 }; + yield return new object[] { null, 0, null, 0, 0, StringComparison.InvariantCultureIgnoreCase, 0 }; + yield return new object[] { "Hello", 0, null, 0, 5, StringComparison.InvariantCultureIgnoreCase, 1 }; + yield return new object[] { null, 0, "Hello", 0, 5, StringComparison.InvariantCultureIgnoreCase, -1 }; + // Ordinal + yield return new object[] { "", 0, "", 0, 0, StringComparison.Ordinal, 0 }; + yield return new object[] { "Hello", 0, "Hello", 0, 5, StringComparison.Ordinal, 0 }; + yield return new object[] { "Hello", 2, "Hello", 3, 1, StringComparison.Ordinal, 0 }; + yield return new object[] { "Hello", 0, "Goodbye", 0, 5, StringComparison.Ordinal, 1 }; + yield return new object[] { "Goodbye", 0, "Hello", 0, 5, StringComparison.Ordinal, -1 }; + yield return new object[] { "Hello", 2, "Hello", 2, 3, StringComparison.Ordinal, 0 }; + yield return new object[] { "HELLO", 2, "hello", 2, 3, StringComparison.Ordinal, -1 }; + yield return new object[] { "Hello", 2, "Goodbye", 2, 3, StringComparison.Ordinal, -1 }; + yield return new object[] { "Hello", 0, "Hello", 0, 0, StringComparison.Ordinal, 0 }; + yield return new object[] { "Hello", 0, "Hello", 0, 3, StringComparison.Ordinal, 0 }; + yield return new object[] { "Hello", 0, "He" + SoftHyphen + "llo", 0, 5, StringComparison.Ordinal, -1 }; + yield return new object[] { "Hello", 0, "-==-", 3, 5, StringComparison.Ordinal, 0 }; + yield return new object[] { "\uD83D\uDD53Hello\uD83D\uDD50", 1, "\uD83D\uDD53Hello\uD83D\uDD54", 1, 7, StringComparison.Ordinal, 0 }; // Surrogate split + yield return new object[] { "Hello", 0, "Hello123", 0, int.MaxValue, StringComparison.Ordinal, -1 }; // Recalculated length, second string longer + yield return new object[] { "Hello123", 0, "Hello", 0, int.MaxValue, StringComparison.Ordinal, 1 }; // Recalculated length, first string longer + yield return new object[] { "---aaaaaaaaaaa", 3, "+++aaaaaaaaaaa", 3, 100, StringComparison.Ordinal, 0 }; // Equal long alignment 2, equal compare + yield return new object[] { "aaaaaaaaaaaaaa", 3, "aaaxaaaaaaaaaa", 3, 100, StringComparison.Ordinal, -1 }; // Equal long alignment 2, different compare at n=1 + yield return new object[] { "-aaaaaaaaaaaaa", 1, "+aaaaaaaaaaaaa", 1, 100, StringComparison.Ordinal, 0 }; // Equal long alignment 6, equal compare + yield return new object[] { "aaaaaaaaaaaaaa", 1, "axaaaaaaaaaaaa", 1, 100, StringComparison.Ordinal, -1 }; // Equal long alignment 6, different compare at n=1 + yield return new object[] { "aaaaaaaaaaaaaa", 0, "aaaaaaaaaaaaaa", 0, 100, StringComparison.Ordinal, 0 }; // Equal long alignment 4, equal compare + yield return new object[] { "aaaaaaaaaaaaaa", 0, "xaaaaaaaaaaaaa", 0, 100, StringComparison.Ordinal, -1 }; // Equal long alignment 4, different compare at n=1 + yield return new object[] { "aaaaaaaaaaaaaa", 0, "axaaaaaaaaaaaa", 0, 100, StringComparison.Ordinal, -1 }; // Equal long alignment 4, different compare at n=2 + yield return new object[] { "--aaaaaaaaaaaa", 2, "++aaaaaaaaaaaa", 2, 100, StringComparison.Ordinal, 0 }; // Equal long alignment 0, equal compare + yield return new object[] { "aaaaaaaaaaaaaa", 2, "aaxaaaaaaaaaaa", 2, 100, StringComparison.Ordinal, -1 }; // Equal long alignment 0, different compare at n=1 + yield return new object[] { "aaaaaaaaaaaaaa", 2, "aaaxaaaaaaaaaa", 2, 100, StringComparison.Ordinal, -1 }; // Equal long alignment 0, different compare at n=2 + yield return new object[] { "aaaaaaaaaaaaaa", 2, "aaaaxaaaaaaaaa", 2, 100, StringComparison.Ordinal, -1 }; // Equal long alignment 0, different compare at n=3 + yield return new object[] { "aaaaaaaaaaaaaa", 2, "aaaaaxaaaaaaaa", 2, 100, StringComparison.Ordinal, -1 }; // Equal long alignment 0, different compare at n=4 + yield return new object[] { "aaaaaaaaaaaaaa", 2, "aaaaaaxaaaaaaa", 2, 100, StringComparison.Ordinal, -1 }; // Equal long alignment 0, different compare at n=5 + yield return new object[] { "aaaaaaaaaaaaaa", 0, "+aaaaaaaaaaaaa", 1, 13, StringComparison.Ordinal, 0 }; // Different int alignment, equal compare + yield return new object[] { "aaaaaaaaaaaaaa", 0, "aaaaaaaaaaaaax", 1, 100, StringComparison.Ordinal, -1 }; // Different int alignment + yield return new object[] { "aaaaaaaaaaaaaa", 1, "aaaxaaaaaaaaaa", 3, 100, StringComparison.Ordinal, -1 }; // Different long alignment, abs of 4, one of them is 2, different at n=1 + yield return new object[] { "-aaaaaaaaaaaaa", 1, "++++aaaaaaaaaa", 4, 10, StringComparison.Ordinal, 0 }; // Different long alignment, equal compare + yield return new object[] { "aaaaaaaaaaaaaa", 1, "aaaaaaaaaaaaax", 4, 100, StringComparison.Ordinal, -1 }; // Different long alignment + yield return new object[] { "\0", 0, "", 0, 1, StringComparison.Ordinal, 1 }; // Same memory layout, except for m_stringLength (m_firstChars are both 0) + yield return new object[] { "\0\0", 0, "", 0, 2, StringComparison.Ordinal, 1 }; // Same as above, except m_stringLength for one is 2 + yield return new object[] { "", 0, "\0b", 0, 2, StringComparison.Ordinal, -1 }; // strA's second char != strB's second char codepath + yield return new object[] { "", 0, "b", 0, 1, StringComparison.Ordinal, -1 }; // Should hit strA.m_firstChar != strB.m_firstChar codepath + yield return new object[] { "abcxxxxxxxxxxxxxxxxxxxxxx", 0, "abdxxxxxxxxxxxxxxx", 0, int.MaxValue, StringComparison.Ordinal, -1 }; // 64-bit: first long compare is different + yield return new object[] { "abcdefgxxxxxxxxxxxxxxxxxx", 0, "abcdefhxxxxxxxxxxx", 0, int.MaxValue, StringComparison.Ordinal, -1 }; // 64-bit: second long compare is different + yield return new object[] { "abcdefghijkxxxxxxxxxxxxxx", 0, "abcdefghijlxxxxxxx", 0, int.MaxValue, StringComparison.Ordinal, -1 }; // 64-bit: third long compare is different + yield return new object[] { "abcdexxxxxxxxxxxxxxxxxxxx", 0, "abcdfxxxxxxxxxxxxx", 0, int.MaxValue, StringComparison.Ordinal, -1 }; // 32-bit: second int compare is different + yield return new object[] { "abcdefghixxxxxxxxxxxxxxxx", 0, "abcdefghjxxxxxxxxx", 0, int.MaxValue, StringComparison.Ordinal, -1 }; // 32-bit: fourth int compare is different + yield return new object[] { null, 0, null, 0, 0, StringComparison.Ordinal, 0 }; + yield return new object[] { "Hello", 0, null, 0, 5, StringComparison.Ordinal, 1 }; + yield return new object[] { null, 0, "Hello", 0, 5, StringComparison.Ordinal, -1 }; + yield return new object[] { null, -1, null, -1, -1, StringComparison.Ordinal, 0 }; + yield return new object[] { "foo", -1, null, -1, -1, StringComparison.Ordinal, 1 }; + yield return new object[] { null, -1, "foo", -1, -1, StringComparison.Ordinal, -1 }; + // OrdinalIgnoreCase + yield return new object[] { "", 0, "", 0, 0, StringComparison.OrdinalIgnoreCase, 0 }; + yield return new object[] { "HELLO", 0, "hello", 0, 5, StringComparison.OrdinalIgnoreCase, 0 }; + yield return new object[] { "Hello", 0, "Hello", 0, 5, StringComparison.OrdinalIgnoreCase, 0 }; + yield return new object[] { "Hello", 2, "Hello", 3, 1, StringComparison.OrdinalIgnoreCase, 0 }; + yield return new object[] { "Hello", 2, "Hello", 2, 3, StringComparison.OrdinalIgnoreCase, 0 }; + yield return new object[] { "Hello", 2, "Yellow", 2, 3, StringComparison.OrdinalIgnoreCase, 0 }; + yield return new object[] { "Hello", 0, "Goodbye", 0, 5, StringComparison.OrdinalIgnoreCase, 1 }; + yield return new object[] { "Goodbye", 0, "Hello", 0, 5, StringComparison.OrdinalIgnoreCase, -1 }; + yield return new object[] { "HELLO", 2, "hello", 2, 3, StringComparison.OrdinalIgnoreCase, 0 }; + yield return new object[] { "Hello", 2, "Goodbye", 2, 3, StringComparison.OrdinalIgnoreCase, -1 }; + yield return new object[] { "A", 0, "x", 0, 1, StringComparison.OrdinalIgnoreCase, -1 }; + yield return new object[] { "a", 0, "X", 0, 1, StringComparison.OrdinalIgnoreCase, -1 }; + yield return new object[] { "[", 0, "A", 0, 1, StringComparison.OrdinalIgnoreCase, 1 }; + yield return new object[] { "[", 0, "a", 0, 1, StringComparison.OrdinalIgnoreCase, 1 }; + yield return new object[] { "\\", 0, "A", 0, 1, StringComparison.OrdinalIgnoreCase, 1 }; + yield return new object[] { "\\", 0, "a", 0, 1, StringComparison.OrdinalIgnoreCase, 1 }; + yield return new object[] { "]", 0, "A", 0, 1, StringComparison.OrdinalIgnoreCase, 1 }; + yield return new object[] { "]", 0, "a", 0, 1, StringComparison.OrdinalIgnoreCase, 1 }; + yield return new object[] { "^", 0, "A", 0, 1, StringComparison.OrdinalIgnoreCase, 1 }; + yield return new object[] { "^", 0, "a", 0, 1, StringComparison.OrdinalIgnoreCase, 1 }; + yield return new object[] { "_", 0, "A", 0, 1, StringComparison.OrdinalIgnoreCase, 1 }; + yield return new object[] { "_", 0, "a", 0, 1, StringComparison.OrdinalIgnoreCase, 1 }; + yield return new object[] { "`", 0, "A", 0, 1, StringComparison.OrdinalIgnoreCase, 1 }; + yield return new object[] { "`", 0, "a", 0, 1, StringComparison.OrdinalIgnoreCase, 1 }; + yield return new object[] { null, 0, null, 0, 0, StringComparison.OrdinalIgnoreCase, 0 }; + yield return new object[] { "Hello", 0, null, 0, 5, StringComparison.OrdinalIgnoreCase, 1 }; + yield return new object[] { null, 0, "Hello", 0, 5, StringComparison.OrdinalIgnoreCase, -1 }; + } + [Theory] - // CurrentCulture - [InlineData("", 0, "", 0, 0, StringComparison.CurrentCulture, 0)] - [InlineData("Hello", 0, "Hello", 0, 5, StringComparison.CurrentCulture, 0)] - [InlineData("Hello", 2, "Hello", 3, 1, StringComparison.CurrentCulture, 0)] - [InlineData("Hello", 0, "Goodbye", 0, 5, StringComparison.CurrentCulture, 1)] - [InlineData("Goodbye", 0, "Hello", 0, 5, StringComparison.CurrentCulture, -1)] - [InlineData("HELLO", 2, "hello", 2, 3, StringComparison.CurrentCulture, 1)] - [InlineData("hello", 2, "HELLO", 2, 3, StringComparison.CurrentCulture, -1)] - [InlineData("Hello", 2, "Hello", 2, 3, StringComparison.CurrentCulture, 0)] - [InlineData("Hello", 2, "Goodbye", 2, 3, StringComparison.CurrentCulture, -1)] - [InlineData("A", 0, "B", 0, 1, StringComparison.CurrentCulture, -1)] - [InlineData("B", 0, "A", 0, 1, StringComparison.CurrentCulture, 1)] - [InlineData(null, 0, null, 0, 0, StringComparison.CurrentCulture, 0)] - [InlineData("Hello", 0, null, 0, 0, StringComparison.CurrentCulture, 1)] - [InlineData(null, 0, "Hello", 0, 0, StringComparison.CurrentCulture, -1)] - [InlineData(null, -1, null, -1, -1, StringComparison.CurrentCulture, 0)] - [InlineData("foo", -1, null, -1, -1, StringComparison.CurrentCulture, 1)] - [InlineData(null, -1, "foo", -1, -1, StringComparison.CurrentCulture, -1)] - // CurrentCultureIgnoreCase - [InlineData("", 0, "", 0, 0, StringComparison.CurrentCultureIgnoreCase, 0)] - [InlineData("HELLO", 0, "hello", 0, 5, StringComparison.CurrentCultureIgnoreCase, 0)] - [InlineData("Hello", 2, "Hello", 3, 1, StringComparison.CurrentCultureIgnoreCase, 0)] - [InlineData("Hello", 0, "Hello", 0, 5, StringComparison.CurrentCultureIgnoreCase, 0)] - [InlineData("Hello", 2, "Hello", 2, 3, StringComparison.CurrentCultureIgnoreCase, 0)] - [InlineData("Hello", 2, "Yellow", 2, 3, StringComparison.CurrentCultureIgnoreCase, 0)] - [InlineData("Hello", 0, "Goodbye", 0, 5, StringComparison.CurrentCultureIgnoreCase, 1)] - [InlineData("Goodbye", 0, "Hello", 0, 5, StringComparison.CurrentCultureIgnoreCase, -1)] - [InlineData("HELLO", 2, "hello", 2, 3, StringComparison.CurrentCultureIgnoreCase, 0)] - [InlineData("Hello", 2, "Goodbye", 2, 3, StringComparison.CurrentCultureIgnoreCase, -1)] - [InlineData(null, 0, null, 0, 0, StringComparison.CurrentCultureIgnoreCase, 0)] - [InlineData("Hello", 0, null, 0, 0, StringComparison.CurrentCultureIgnoreCase, 1)] - [InlineData(null, 0, "Hello", 0, 0, StringComparison.CurrentCultureIgnoreCase, -1)] - [InlineData(null, -1, null, -1, -1, StringComparison.CurrentCultureIgnoreCase, 0)] - [InlineData("foo", -1, null, -1, -1, StringComparison.CurrentCultureIgnoreCase, 1)] - [InlineData(null, -1, "foo", -1, -1, StringComparison.CurrentCultureIgnoreCase, -1)] - // InvariantCulture - [InlineData("", 0, "", 0, 0, StringComparison.InvariantCulture, 0)] - [InlineData("Hello", 0, "Hello", 0, 5, StringComparison.InvariantCulture, 0)] - [InlineData("Hello", 2, "Hello", 3, 1, StringComparison.InvariantCulture, 0)] - [InlineData("Hello", 0, "Goodbye", 0, 5, StringComparison.InvariantCulture, 1)] - [InlineData("Goodbye", 0, "Hello", 0, 5, StringComparison.InvariantCulture, -1)] - [InlineData("HELLO", 2, "hello", 2, 3, StringComparison.InvariantCulture, 1)] - [InlineData("hello", 2, "HELLO", 2, 3, StringComparison.InvariantCulture, -1)] - [InlineData(null, 0, null, 0, 0, StringComparison.InvariantCulture, 0)] - [InlineData("Hello", 0, null, 0, 5, StringComparison.InvariantCulture, 1)] - [InlineData(null, 0, "Hello", 0, 5, StringComparison.InvariantCulture, -1)] - // InvariantCultureIgnoreCase - [InlineData("", 0, "", 0, 0, StringComparison.InvariantCultureIgnoreCase, 0)] - [InlineData("HELLO", 0, "hello", 0, 5, StringComparison.InvariantCultureIgnoreCase, 0)] - [InlineData("Hello", 0, "Hello", 0, 5, StringComparison.InvariantCultureIgnoreCase, 0)] - [InlineData("Hello", 2, "Hello", 3, 1, StringComparison.InvariantCultureIgnoreCase, 0)] - [InlineData("Hello", 2, "Hello", 2, 3, StringComparison.InvariantCultureIgnoreCase, 0)] - [InlineData("Hello", 2, "Yellow", 2, 3, StringComparison.InvariantCultureIgnoreCase, 0)] - [InlineData("Hello", 0, "Goodbye", 0, 5, StringComparison.InvariantCultureIgnoreCase, 1)] - [InlineData("Goodbye", 0, "Hello", 0, 5, StringComparison.InvariantCultureIgnoreCase, -1)] - [InlineData("HELLO", 2, "hello", 2, 3, StringComparison.InvariantCultureIgnoreCase, 0)] - [InlineData("Hello", 2, "Goodbye", 2, 3, StringComparison.InvariantCultureIgnoreCase, -1)] - [InlineData(null, 0, null, 0, 0, StringComparison.InvariantCultureIgnoreCase, 0)] - [InlineData("Hello", 0, null, 0, 5, StringComparison.InvariantCultureIgnoreCase, 1)] - [InlineData(null, 0, "Hello", 0, 5, StringComparison.InvariantCultureIgnoreCase, -1)] - // Ordinal - [InlineData("", 0, "", 0, 0, StringComparison.Ordinal, 0)] - [InlineData("Hello", 0, "Hello", 0, 5, StringComparison.Ordinal, 0)] - [InlineData("Hello", 2, "Hello", 3, 1, StringComparison.Ordinal, 0)] - [InlineData("Hello", 0, "Goodbye", 0, 5, StringComparison.Ordinal, 1)] - [InlineData("Goodbye", 0, "Hello", 0, 5, StringComparison.Ordinal, -1)] - [InlineData("Hello", 2, "Hello", 2, 3, StringComparison.Ordinal, 0)] - [InlineData("HELLO", 2, "hello", 2, 3, StringComparison.Ordinal, -1)] - [InlineData("Hello", 2, "Goodbye", 2, 3, StringComparison.Ordinal, -1)] - [InlineData("Hello", 0, "Hello", 0, 0, StringComparison.Ordinal, 0)] - [InlineData("Hello", 0, "Hello", 0, 3, StringComparison.Ordinal, 0)] - [InlineData("Hello", 0, "He" + SoftHyphen + "llo", 0, 5, StringComparison.Ordinal, -1)] - [InlineData("Hello", 0, "-==-", 3, 5, StringComparison.Ordinal, 0)] - [InlineData("\uD83D\uDD53Hello\uD83D\uDD50", 1, "\uD83D\uDD53Hello\uD83D\uDD54", 1, 7, StringComparison.Ordinal, 0)] // Surrogate split - [InlineData("Hello", 0, "Hello123", 0, int.MaxValue, StringComparison.Ordinal, -1)] // Recalculated length, second string longer - [InlineData("Hello123", 0, "Hello", 0, int.MaxValue, StringComparison.Ordinal, 1)] // Recalculated length, first string longer - [InlineData("---aaaaaaaaaaa", 3, "+++aaaaaaaaaaa", 3, 100, StringComparison.Ordinal, 0)] // Equal long alignment 2, equal compare - [InlineData("aaaaaaaaaaaaaa", 3, "aaaxaaaaaaaaaa", 3, 100, StringComparison.Ordinal, -1)] // Equal long alignment 2, different compare at n=1 - [InlineData("-aaaaaaaaaaaaa", 1, "+aaaaaaaaaaaaa", 1, 100, StringComparison.Ordinal, 0)] // Equal long alignment 6, equal compare - [InlineData("aaaaaaaaaaaaaa", 1, "axaaaaaaaaaaaa", 1, 100, StringComparison.Ordinal, -1)] // Equal long alignment 6, different compare at n=1 - [InlineData("aaaaaaaaaaaaaa", 0, "aaaaaaaaaaaaaa", 0, 100, StringComparison.Ordinal, 0)] // Equal long alignment 4, equal compare - [InlineData("aaaaaaaaaaaaaa", 0, "xaaaaaaaaaaaaa", 0, 100, StringComparison.Ordinal, -1)] // Equal long alignment 4, different compare at n=1 - [InlineData("aaaaaaaaaaaaaa", 0, "axaaaaaaaaaaaa", 0, 100, StringComparison.Ordinal, -1)] // Equal long alignment 4, different compare at n=2 - [InlineData("--aaaaaaaaaaaa", 2, "++aaaaaaaaaaaa", 2, 100, StringComparison.Ordinal, 0)] // Equal long alignment 0, equal compare - [InlineData("aaaaaaaaaaaaaa", 2, "aaxaaaaaaaaaaa", 2, 100, StringComparison.Ordinal, -1)] // Equal long alignment 0, different compare at n=1 - [InlineData("aaaaaaaaaaaaaa", 2, "aaaxaaaaaaaaaa", 2, 100, StringComparison.Ordinal, -1)] // Equal long alignment 0, different compare at n=2 - [InlineData("aaaaaaaaaaaaaa", 2, "aaaaxaaaaaaaaa", 2, 100, StringComparison.Ordinal, -1)] // Equal long alignment 0, different compare at n=3 - [InlineData("aaaaaaaaaaaaaa", 2, "aaaaaxaaaaaaaa", 2, 100, StringComparison.Ordinal, -1)] // Equal long alignment 0, different compare at n=4 - [InlineData("aaaaaaaaaaaaaa", 2, "aaaaaaxaaaaaaa", 2, 100, StringComparison.Ordinal, -1)] // Equal long alignment 0, different compare at n=5 - [InlineData("aaaaaaaaaaaaaa", 0, "+aaaaaaaaaaaaa", 1, 13, StringComparison.Ordinal, 0)] // Different int alignment, equal compare - [InlineData("aaaaaaaaaaaaaa", 0, "aaaaaaaaaaaaax", 1, 100, StringComparison.Ordinal, -1)] // Different int alignment - [InlineData("aaaaaaaaaaaaaa", 1, "aaaxaaaaaaaaaa", 3, 100, StringComparison.Ordinal, -1)] // Different long alignment, abs of 4, one of them is 2, different at n=1 - [InlineData("-aaaaaaaaaaaaa", 1, "++++aaaaaaaaaa", 4, 10, StringComparison.Ordinal, 0)] // Different long alignment, equal compare - [InlineData("aaaaaaaaaaaaaa", 1, "aaaaaaaaaaaaax", 4, 100, StringComparison.Ordinal, -1)] // Different long alignment - [InlineData("\0", 0, "", 0, 1, StringComparison.Ordinal, 1)] // Same memory layout, except for m_stringLength (m_firstChars are both 0) - [InlineData("\0\0", 0, "", 0, 2, StringComparison.Ordinal, 1)] // Same as above, except m_stringLength for one is 2 - [InlineData("", 0, "\0b", 0, 2, StringComparison.Ordinal, -1)] // strA's second char != strB's second char codepath - [InlineData("", 0, "b", 0, 1, StringComparison.Ordinal, -1)] // Should hit strA.m_firstChar != strB.m_firstChar codepath - [InlineData("abcxxxxxxxxxxxxxxxxxxxxxx", 0, "abdxxxxxxxxxxxxxxx", 0, int.MaxValue, StringComparison.Ordinal, -1)] // 64-bit: first long compare is different - [InlineData("abcdefgxxxxxxxxxxxxxxxxxx", 0, "abcdefhxxxxxxxxxxx", 0, int.MaxValue, StringComparison.Ordinal, -1)] // 64-bit: second long compare is different - [InlineData("abcdefghijkxxxxxxxxxxxxxx", 0, "abcdefghijlxxxxxxx", 0, int.MaxValue, StringComparison.Ordinal, -1)] // 64-bit: third long compare is different - [InlineData("abcdexxxxxxxxxxxxxxxxxxxx", 0, "abcdfxxxxxxxxxxxxx", 0, int.MaxValue, StringComparison.Ordinal, -1)] // 32-bit: second int compare is different - [InlineData("abcdefghixxxxxxxxxxxxxxxx", 0, "abcdefghjxxxxxxxxx", 0, int.MaxValue, StringComparison.Ordinal, -1)] // 32-bit: fourth int compare is different - [InlineData(null, 0, null, 0, 0, StringComparison.Ordinal, 0)] - [InlineData("Hello", 0, null, 0, 5, StringComparison.Ordinal, 1)] - [InlineData(null, 0, "Hello", 0, 5, StringComparison.Ordinal, -1)] - [InlineData(null, -1, null, -1, -1, StringComparison.Ordinal, 0)] - [InlineData("foo", -1, null, -1, -1, StringComparison.Ordinal, 1)] - [InlineData(null, -1, "foo", -1, -1, StringComparison.Ordinal, -1)] - // OrdinalIgnoreCase - [InlineData("", 0, "", 0, 0, StringComparison.OrdinalIgnoreCase, 0)] - [InlineData("HELLO", 0, "hello", 0, 5, StringComparison.OrdinalIgnoreCase, 0)] - [InlineData("Hello", 0, "Hello", 0, 5, StringComparison.OrdinalIgnoreCase, 0)] - [InlineData("Hello", 2, "Hello", 3, 1, StringComparison.OrdinalIgnoreCase, 0)] - [InlineData("Hello", 2, "Hello", 2, 3, StringComparison.OrdinalIgnoreCase, 0)] - [InlineData("Hello", 2, "Yellow", 2, 3, StringComparison.OrdinalIgnoreCase, 0)] - [InlineData("Hello", 0, "Goodbye", 0, 5, StringComparison.OrdinalIgnoreCase, 1)] - [InlineData("Goodbye", 0, "Hello", 0, 5, StringComparison.OrdinalIgnoreCase, -1)] - [InlineData("HELLO", 2, "hello", 2, 3, StringComparison.OrdinalIgnoreCase, 0)] - [InlineData("Hello", 2, "Goodbye", 2, 3, StringComparison.OrdinalIgnoreCase, -1)] - [InlineData("A", 0, "x", 0, 1, StringComparison.OrdinalIgnoreCase, -1)] - [InlineData("a", 0, "X", 0, 1, StringComparison.OrdinalIgnoreCase, -1)] - [InlineData("[", 0, "A", 0, 1, StringComparison.OrdinalIgnoreCase, 1)] - [InlineData("[", 0, "a", 0, 1, StringComparison.OrdinalIgnoreCase, 1)] - [InlineData("\\", 0, "A", 0, 1, StringComparison.OrdinalIgnoreCase, 1)] - [InlineData("\\", 0, "a", 0, 1, StringComparison.OrdinalIgnoreCase, 1)] - [InlineData("]", 0, "A", 0, 1, StringComparison.OrdinalIgnoreCase, 1)] - [InlineData("]", 0, "a", 0, 1, StringComparison.OrdinalIgnoreCase, 1)] - [InlineData("^", 0, "A", 0, 1, StringComparison.OrdinalIgnoreCase, 1)] - [InlineData("^", 0, "a", 0, 1, StringComparison.OrdinalIgnoreCase, 1)] - [InlineData("_", 0, "A", 0, 1, StringComparison.OrdinalIgnoreCase, 1)] - [InlineData("_", 0, "a", 0, 1, StringComparison.OrdinalIgnoreCase, 1)] - [InlineData("`", 0, "A", 0, 1, StringComparison.OrdinalIgnoreCase, 1)] - [InlineData("`", 0, "a", 0, 1, StringComparison.OrdinalIgnoreCase, 1)] - [InlineData(null, 0, null, 0, 0, StringComparison.OrdinalIgnoreCase, 0)] - [InlineData("Hello", 0, null, 0, 5, StringComparison.OrdinalIgnoreCase, 1)] - [InlineData(null, 0, "Hello", 0, 5, StringComparison.OrdinalIgnoreCase, -1)] + [MemberData(nameof(Compare_TestData))] public static void Compare(string strA, int indexA, string strB, int indexB, int length, StringComparison comparisonType, int expected) { bool hasNullInputs = (strA == null || strB == null); @@ -1606,66 +1611,84 @@ public static void MakeSureNoSequenceEqualChecksGoOutOfRange_Char() } } + public static IEnumerable EndsWith_StringComparison_TestData() + { + // CurrentCulture + yield return new object[] { "", "Foo", StringComparison.CurrentCulture, false }; + yield return new object[] { "Hello", "llo", StringComparison.CurrentCulture, true }; + yield return new object[] { "Hello", "Hello", StringComparison.CurrentCulture, true }; + yield return new object[] { "Hello", "", StringComparison.CurrentCulture, true }; + yield return new object[] { "Hello", "HELLO", StringComparison.CurrentCulture, false }; + yield return new object[] { "Hello", "Abc", StringComparison.CurrentCulture, false }; + yield return new object[] { "", "", StringComparison.CurrentCulture, true }; + yield return new object[] { "", "a", StringComparison.CurrentCulture, false }; + + if (PlatformDetection.IsNotInvariantGlobalization) + yield return new object[] { "Hello", "llo" + SoftHyphen, StringComparison.CurrentCulture, true }; + + // CurrentCultureIgnoreCase + yield return new object[] { "Hello", "llo", StringComparison.CurrentCultureIgnoreCase, true }; + yield return new object[] { "Hello", "Hello", StringComparison.CurrentCultureIgnoreCase, true }; + yield return new object[] { "Hello", "", StringComparison.CurrentCultureIgnoreCase, true }; + yield return new object[] { "Hello", "LLO", StringComparison.CurrentCultureIgnoreCase, true }; + yield return new object[] { "Hello", "Abc", StringComparison.CurrentCultureIgnoreCase, false }; + yield return new object[] { "", "", StringComparison.CurrentCultureIgnoreCase, true }; + yield return new object[] { "", "a", StringComparison.CurrentCultureIgnoreCase, false }; + + if (PlatformDetection.IsNotInvariantGlobalization) + yield return new object[] { "Hello", "llo" + SoftHyphen, StringComparison.CurrentCultureIgnoreCase, true }; + + // InvariantCulture + yield return new object[] { "", "Foo", StringComparison.InvariantCulture, false }; + yield return new object[] { "Hello", "llo", StringComparison.InvariantCulture, true }; + yield return new object[] { "Hello", "Hello", StringComparison.InvariantCulture, true }; + yield return new object[] { "Hello", "", StringComparison.InvariantCulture, true }; + yield return new object[] { "Hello", "HELLO", StringComparison.InvariantCulture, false }; + yield return new object[] { "Hello", "Abc", StringComparison.InvariantCulture, false }; + yield return new object[] { "", "", StringComparison.InvariantCulture, true }; + yield return new object[] { "", "a", StringComparison.InvariantCulture, false }; + + if (PlatformDetection.IsNotInvariantGlobalization) + yield return new object[] { "Hello", "llo" + SoftHyphen, StringComparison.InvariantCulture, true }; + + // InvariantCultureIgnoreCase + yield return new object[] { "Hello", "llo", StringComparison.InvariantCultureIgnoreCase, true }; + yield return new object[] { "Hello", "Hello", StringComparison.InvariantCultureIgnoreCase, true }; + yield return new object[] { "Hello", "", StringComparison.InvariantCultureIgnoreCase, true }; + yield return new object[] { "Hello", "LLO", StringComparison.InvariantCultureIgnoreCase, true }; + yield return new object[] { "Hello", "Abc", StringComparison.InvariantCultureIgnoreCase, false }; + yield return new object[] { "", "", StringComparison.InvariantCultureIgnoreCase, true }; + yield return new object[] { "", "a", StringComparison.InvariantCultureIgnoreCase, false }; + + if (PlatformDetection.IsNotInvariantGlobalization) + yield return new object[] { "Hello", "llo" + SoftHyphen, StringComparison.InvariantCultureIgnoreCase, true }; + + // Ordinal + yield return new object[] { "Hello", "o", StringComparison.Ordinal, true }; + yield return new object[] { "Hello", "llo", StringComparison.Ordinal, true }; + yield return new object[] { "Hello", "Hello", StringComparison.Ordinal, true }; + yield return new object[] { "Hello", "Larger Hello", StringComparison.Ordinal, false }; + yield return new object[] { "Hello", "", StringComparison.Ordinal, true }; + yield return new object[] { "Hello", "LLO", StringComparison.Ordinal, false }; + yield return new object[] { "Hello", "Abc", StringComparison.Ordinal, false }; + yield return new object[] { "Hello", "llo" + SoftHyphen, StringComparison.Ordinal, false }; + yield return new object[] { "", "", StringComparison.Ordinal, true }; + yield return new object[] { "", "a", StringComparison.Ordinal, false }; + + // OrdinalIgnoreCase + yield return new object[] { "Hello", "llo", StringComparison.OrdinalIgnoreCase, true }; + yield return new object[] { "Hello", "Hello", StringComparison.OrdinalIgnoreCase, true }; + yield return new object[] { "Hello", "Larger Hello", StringComparison.OrdinalIgnoreCase, false }; + yield return new object[] { "Hello", "", StringComparison.OrdinalIgnoreCase, true }; + yield return new object[] { "Hello", "LLO", StringComparison.OrdinalIgnoreCase, true }; + yield return new object[] { "Hello", "Abc", StringComparison.OrdinalIgnoreCase, false }; + yield return new object[] { "Hello", "llo" + SoftHyphen, StringComparison.OrdinalIgnoreCase, false }; + yield return new object[] { "", "", StringComparison.OrdinalIgnoreCase, true }; + yield return new object[] { "", "a", StringComparison.OrdinalIgnoreCase, false }; + } + [Theory] - // CurrentCulture - [InlineData("", "Foo", StringComparison.CurrentCulture, false)] - [InlineData("Hello", "llo", StringComparison.CurrentCulture, true)] - [InlineData("Hello", "Hello", StringComparison.CurrentCulture, true)] - [InlineData("Hello", "", StringComparison.CurrentCulture, true)] - [InlineData("Hello", "HELLO", StringComparison.CurrentCulture, false)] - [InlineData("Hello", "Abc", StringComparison.CurrentCulture, false)] - [InlineData("Hello", "llo" + SoftHyphen, StringComparison.CurrentCulture, true)] - [InlineData("", "", StringComparison.CurrentCulture, true)] - [InlineData("", "a", StringComparison.CurrentCulture, false)] - // CurrentCultureIgnoreCase - [InlineData("Hello", "llo", StringComparison.CurrentCultureIgnoreCase, true)] - [InlineData("Hello", "Hello", StringComparison.CurrentCultureIgnoreCase, true)] - [InlineData("Hello", "", StringComparison.CurrentCultureIgnoreCase, true)] - [InlineData("Hello", "LLO", StringComparison.CurrentCultureIgnoreCase, true)] - [InlineData("Hello", "Abc", StringComparison.CurrentCultureIgnoreCase, false)] - [InlineData("Hello", "llo" + SoftHyphen, StringComparison.CurrentCultureIgnoreCase, true)] - [InlineData("", "", StringComparison.CurrentCultureIgnoreCase, true)] - [InlineData("", "a", StringComparison.CurrentCultureIgnoreCase, false)] - // InvariantCulture - [InlineData("", "Foo", StringComparison.InvariantCulture, false)] - [InlineData("Hello", "llo", StringComparison.InvariantCulture, true)] - [InlineData("Hello", "Hello", StringComparison.InvariantCulture, true)] - [InlineData("Hello", "", StringComparison.InvariantCulture, true)] - [InlineData("Hello", "HELLO", StringComparison.InvariantCulture, false)] - [InlineData("Hello", "Abc", StringComparison.InvariantCulture, false)] - [InlineData("Hello", "llo" + SoftHyphen, StringComparison.InvariantCulture, true)] - [InlineData("", "", StringComparison.InvariantCulture, true)] - [InlineData("", "a", StringComparison.InvariantCulture, false)] - // InvariantCultureIgnoreCase - [InlineData("Hello", "llo", StringComparison.InvariantCultureIgnoreCase, true)] - [InlineData("Hello", "Hello", StringComparison.InvariantCultureIgnoreCase, true)] - [InlineData("Hello", "", StringComparison.InvariantCultureIgnoreCase, true)] - [InlineData("Hello", "LLO", StringComparison.InvariantCultureIgnoreCase, true)] - [InlineData("Hello", "Abc", StringComparison.InvariantCultureIgnoreCase, false)] - [InlineData("Hello", "llo" + SoftHyphen, StringComparison.InvariantCultureIgnoreCase, true)] - [InlineData("", "", StringComparison.InvariantCultureIgnoreCase, true)] - [InlineData("", "a", StringComparison.InvariantCultureIgnoreCase, false)] - // Ordinal - [InlineData("Hello", "o", StringComparison.Ordinal, true)] - [InlineData("Hello", "llo", StringComparison.Ordinal, true)] - [InlineData("Hello", "Hello", StringComparison.Ordinal, true)] - [InlineData("Hello", "Larger Hello", StringComparison.Ordinal, false)] - [InlineData("Hello", "", StringComparison.Ordinal, true)] - [InlineData("Hello", "LLO", StringComparison.Ordinal, false)] - [InlineData("Hello", "Abc", StringComparison.Ordinal, false)] - [InlineData("Hello", "llo" + SoftHyphen, StringComparison.Ordinal, false)] - [InlineData("", "", StringComparison.Ordinal, true)] - [InlineData("", "a", StringComparison.Ordinal, false)] - // OrdinalIgnoreCase - [InlineData("Hello", "llo", StringComparison.OrdinalIgnoreCase, true)] - [InlineData("Hello", "Hello", StringComparison.OrdinalIgnoreCase, true)] - [InlineData("Hello", "Larger Hello", StringComparison.OrdinalIgnoreCase, false)] - [InlineData("Hello", "", StringComparison.OrdinalIgnoreCase, true)] - [InlineData("Hello", "LLO", StringComparison.OrdinalIgnoreCase, true)] - [InlineData("Hello", "Abc", StringComparison.OrdinalIgnoreCase, false)] - [InlineData("Hello", "llo" + SoftHyphen, StringComparison.OrdinalIgnoreCase, false)] - [InlineData("", "", StringComparison.OrdinalIgnoreCase, true)] - [InlineData("", "a", StringComparison.OrdinalIgnoreCase, false)] + [MemberData(nameof(EndsWith_StringComparison_TestData))] public static void EndsWith_StringComparison(string s, string value, StringComparison comparisonType, bool expected) { if (comparisonType == StringComparison.CurrentCulture) @@ -2155,7 +2178,7 @@ public static void EndsWithUnknownComparisonType_StringComparison() Assert.Throws(() => value.AsSpan().CompareTo(value.AsSpan(), (StringComparison)6)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public static void EndsWithMatchNonOrdinal_StringComparison() { string s = "dabc"; @@ -2859,7 +2882,7 @@ public static void IndexOf_AllSubstrings(string s, string value, int startIndex, Assert.Equal(ignoringCase ? startIndex : -1, s.AsSpan().IndexOf(value.AsSpan(), comparison)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public static void IndexOf_TurkishI_TurkishCulture() { using (new ThreadCultureChange("tr-TR")) @@ -2942,7 +2965,7 @@ public static void IndexOf_TurkishI_EnglishUSCulture() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public static void IndexOf_HungarianDoubleCompression_HungarianCulture() { using (new ThreadCultureChange("hu-HU")) @@ -2992,7 +3015,7 @@ public static void IndexOf_HungarianDoubleCompression_InvariantCulture() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public static void IndexOf_EquivalentDiacritics_EnglishUSCulture() { using (new ThreadCultureChange("en-US")) @@ -3026,7 +3049,7 @@ public static void IndexOf_EquivalentDiacritics_EnglishUSCulture() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public static void IndexOf_EquivalentDiacritics_InvariantCulture() { using (new ThreadCultureChange(CultureInfo.InvariantCulture)) @@ -4590,72 +4613,89 @@ public void Replace_EmptyOldValue_ThrowsArgumentException() AssertExtensions.Throws("oldValue", () => "Hello".Replace("", "l")); } + public static IEnumerable StartsWith_StringComparison_TestData() + { + // CurrentCulture + yield return new object[] { "Hello", "Hel", StringComparison.CurrentCulture, true }; + yield return new object[] { "Hello", "Hello", StringComparison.CurrentCulture, true }; + yield return new object[] { "Hello", "", StringComparison.CurrentCulture, true }; + yield return new object[] { "Hello", "HELLO", StringComparison.CurrentCulture, false }; + yield return new object[] { "Hello", "Abc", StringComparison.CurrentCulture, false }; + yield return new object[] { "", "", StringComparison.CurrentCulture, true }; + yield return new object[] { "", "hello", StringComparison.CurrentCulture, false }; + + if (PlatformDetection.IsNotInvariantGlobalization) + yield return new object[] { "Hello", SoftHyphen + "Hel", StringComparison.CurrentCulture, true }; + + // CurrentCultureIgnoreCase + yield return new object[] { "Hello", "Hel", StringComparison.CurrentCultureIgnoreCase, true }; + yield return new object[] { "Hello", "Hello", StringComparison.CurrentCultureIgnoreCase, true }; + yield return new object[] { "Hello", "", StringComparison.CurrentCultureIgnoreCase, true }; + yield return new object[] { "Hello", "HEL", StringComparison.CurrentCultureIgnoreCase, true }; + yield return new object[] { "Hello", "Abc", StringComparison.CurrentCultureIgnoreCase, false }; + yield return new object[] { "", "", StringComparison.CurrentCultureIgnoreCase, true }; + yield return new object[] { "", "hello", StringComparison.CurrentCultureIgnoreCase, false }; + + if (PlatformDetection.IsNotInvariantGlobalization) + yield return new object[] { "Hello", SoftHyphen + "Hel", StringComparison.CurrentCultureIgnoreCase, true }; + + // InvariantCulture + yield return new object[] { "Hello", "Hel", StringComparison.InvariantCulture, true }; + yield return new object[] { "Hello", "Hello", StringComparison.InvariantCulture, true }; + yield return new object[] { "Hello", "", StringComparison.InvariantCulture, true }; + yield return new object[] { "Hello", "HELLO", StringComparison.InvariantCulture, false }; + yield return new object[] { "Hello", "Abc", StringComparison.InvariantCulture, false }; + yield return new object[] { "", "", StringComparison.InvariantCulture, true }; + yield return new object[] { "", "hello", StringComparison.InvariantCulture, false }; + + if (PlatformDetection.IsNotInvariantGlobalization) + yield return new object[] { "Hello", SoftHyphen + "Hel", StringComparison.InvariantCulture, true }; + + // InvariantCultureIgnoreCase + yield return new object[] { "Hello", "Hel", StringComparison.InvariantCultureIgnoreCase, true }; + yield return new object[] { "Hello", "Hello", StringComparison.InvariantCultureIgnoreCase, true }; + yield return new object[] { "Hello", "", StringComparison.InvariantCultureIgnoreCase, true }; + yield return new object[] { "Hello", "HEL", StringComparison.InvariantCultureIgnoreCase, true }; + yield return new object[] { "Hello", "Abc", StringComparison.InvariantCultureIgnoreCase, false }; + yield return new object[] { "", "", StringComparison.InvariantCultureIgnoreCase, true }; + yield return new object[] { "", "hello", StringComparison.InvariantCultureIgnoreCase, false }; + + if (PlatformDetection.IsNotInvariantGlobalization) + yield return new object[] { "Hello", SoftHyphen + "Hel", StringComparison.InvariantCultureIgnoreCase, true }; + + // Ordinal + yield return new object[] { "Hello", "H", StringComparison.Ordinal, true }; + yield return new object[] { "Hello", "Hel", StringComparison.Ordinal, true }; + yield return new object[] { "Hello", "Hello", StringComparison.Ordinal, true }; + yield return new object[] { "Hello", "Hello Larger", StringComparison.Ordinal, false }; + yield return new object[] { "Hello", "", StringComparison.Ordinal, true }; + yield return new object[] { "Hello", "HEL", StringComparison.Ordinal, false }; + yield return new object[] { "Hello", "Abc", StringComparison.Ordinal, false }; + yield return new object[] { "", "", StringComparison.Ordinal, true }; + yield return new object[] { "", "hello", StringComparison.Ordinal, false }; + yield return new object[] { "abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyz", StringComparison.Ordinal, true }; + yield return new object[] { "abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwx", StringComparison.Ordinal, true }; + yield return new object[] { "abcdefghijklmnopqrstuvwxyz", "abcdefghijklm", StringComparison.Ordinal, true }; + yield return new object[] { "abcdefghijklmnopqrstuvwxyz", "ab_defghijklmnopqrstu", StringComparison.Ordinal, false }; + yield return new object[] { "abcdefghijklmnopqrstuvwxyz", "abcdef_hijklmn", StringComparison.Ordinal, false }; + yield return new object[] { "abcdefghijklmnopqrstuvwxyz", "abcdefghij_lmn", StringComparison.Ordinal, false }; + yield return new object[] { "abcdefghijklmnopqrstuvwxyz", "a", StringComparison.Ordinal, true }; + yield return new object[] { "abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyza", StringComparison.Ordinal, false }; + + // OrdinalIgnoreCase + yield return new object[] { "Hello", "Hel", StringComparison.OrdinalIgnoreCase, true }; + yield return new object[] { "Hello", "Hello", StringComparison.OrdinalIgnoreCase, true }; + yield return new object[] { "Hello", "Hello Larger", StringComparison.OrdinalIgnoreCase, false }; + yield return new object[] { "Hello", "", StringComparison.OrdinalIgnoreCase, true }; + yield return new object[] { "Hello", "HEL", StringComparison.OrdinalIgnoreCase, true }; + yield return new object[] { "Hello", "Abc", StringComparison.OrdinalIgnoreCase, false }; + yield return new object[] { "Hello", SoftHyphen + "Hel", StringComparison.OrdinalIgnoreCase, false }; + yield return new object[] { "", "", StringComparison.OrdinalIgnoreCase, true }; + yield return new object[] { "", "hello", StringComparison.OrdinalIgnoreCase, false }; + } + [Theory] - // CurrentCulture - [InlineData("Hello", "Hel", StringComparison.CurrentCulture, true)] - [InlineData("Hello", "Hello", StringComparison.CurrentCulture, true)] - [InlineData("Hello", "", StringComparison.CurrentCulture, true)] - [InlineData("Hello", "HELLO", StringComparison.CurrentCulture, false)] - [InlineData("Hello", "Abc", StringComparison.CurrentCulture, false)] - [InlineData("Hello", SoftHyphen + "Hel", StringComparison.CurrentCulture, true)] - [InlineData("", "", StringComparison.CurrentCulture, true)] - [InlineData("", "hello", StringComparison.CurrentCulture, false)] - // CurrentCultureIgnoreCase - [InlineData("Hello", "Hel", StringComparison.CurrentCultureIgnoreCase, true)] - [InlineData("Hello", "Hello", StringComparison.CurrentCultureIgnoreCase, true)] - [InlineData("Hello", "", StringComparison.CurrentCultureIgnoreCase, true)] - [InlineData("Hello", "HEL", StringComparison.CurrentCultureIgnoreCase, true)] - [InlineData("Hello", "Abc", StringComparison.CurrentCultureIgnoreCase, false)] - [InlineData("Hello", SoftHyphen + "Hel", StringComparison.CurrentCultureIgnoreCase, true)] - [InlineData("", "", StringComparison.CurrentCultureIgnoreCase, true)] - [InlineData("", "hello", StringComparison.CurrentCultureIgnoreCase, false)] - // InvariantCulture - [InlineData("Hello", "Hel", StringComparison.InvariantCulture, true)] - [InlineData("Hello", "Hello", StringComparison.InvariantCulture, true)] - [InlineData("Hello", "", StringComparison.InvariantCulture, true)] - [InlineData("Hello", "HELLO", StringComparison.InvariantCulture, false)] - [InlineData("Hello", "Abc", StringComparison.InvariantCulture, false)] - [InlineData("Hello", SoftHyphen + "Hel", StringComparison.InvariantCulture, true)] - [InlineData("", "", StringComparison.InvariantCulture, true)] - [InlineData("", "hello", StringComparison.InvariantCulture, false)] - // InvariantCultureIgnoreCase - [InlineData("Hello", "Hel", StringComparison.InvariantCultureIgnoreCase, true)] - [InlineData("Hello", "Hello", StringComparison.InvariantCultureIgnoreCase, true)] - [InlineData("Hello", "", StringComparison.InvariantCultureIgnoreCase, true)] - [InlineData("Hello", "HEL", StringComparison.InvariantCultureIgnoreCase, true)] - [InlineData("Hello", "Abc", StringComparison.InvariantCultureIgnoreCase, false)] - [InlineData("Hello", SoftHyphen + "Hel", StringComparison.InvariantCultureIgnoreCase, true)] - [InlineData("", "", StringComparison.InvariantCultureIgnoreCase, true)] - [InlineData("", "hello", StringComparison.InvariantCultureIgnoreCase, false)] - // Ordinal - [InlineData("Hello", "H", StringComparison.Ordinal, true)] - [InlineData("Hello", "Hel", StringComparison.Ordinal, true)] - [InlineData("Hello", "Hello", StringComparison.Ordinal, true)] - [InlineData("Hello", "Hello Larger", StringComparison.Ordinal, false)] - [InlineData("Hello", "", StringComparison.Ordinal, true)] - [InlineData("Hello", "HEL", StringComparison.Ordinal, false)] - [InlineData("Hello", "Abc", StringComparison.Ordinal, false)] - [InlineData("Hello", SoftHyphen + "Hel", StringComparison.Ordinal, false)] - [InlineData("", "", StringComparison.Ordinal, true)] - [InlineData("", "hello", StringComparison.Ordinal, false)] - [InlineData("abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyz", StringComparison.Ordinal, true)] - [InlineData("abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwx", StringComparison.Ordinal, true)] - [InlineData("abcdefghijklmnopqrstuvwxyz", "abcdefghijklm", StringComparison.Ordinal, true)] - [InlineData("abcdefghijklmnopqrstuvwxyz", "ab_defghijklmnopqrstu", StringComparison.Ordinal, false)] - [InlineData("abcdefghijklmnopqrstuvwxyz", "abcdef_hijklmn", StringComparison.Ordinal, false)] - [InlineData("abcdefghijklmnopqrstuvwxyz", "abcdefghij_lmn", StringComparison.Ordinal, false)] - [InlineData("abcdefghijklmnopqrstuvwxyz", "a", StringComparison.Ordinal, true)] - [InlineData("abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyza", StringComparison.Ordinal, false)] - // OrdinalIgnoreCase - [InlineData("Hello", "Hel", StringComparison.OrdinalIgnoreCase, true)] - [InlineData("Hello", "Hello", StringComparison.OrdinalIgnoreCase, true)] - [InlineData("Hello", "Hello Larger", StringComparison.OrdinalIgnoreCase, false)] - [InlineData("Hello", "", StringComparison.OrdinalIgnoreCase, true)] - [InlineData("Hello", "HEL", StringComparison.OrdinalIgnoreCase, true)] - [InlineData("Hello", "Abc", StringComparison.OrdinalIgnoreCase, false)] - [InlineData("Hello", SoftHyphen + "Hel", StringComparison.OrdinalIgnoreCase, false)] - [InlineData("", "", StringComparison.OrdinalIgnoreCase, true)] - [InlineData("", "hello", StringComparison.OrdinalIgnoreCase, false)] + [MemberData(nameof(StartsWith_StringComparison_TestData))] public static void StartsWith_StringComparison(string s, string value, StringComparison comparisonType, bool expected) { if (comparisonType == StringComparison.CurrentCulture) @@ -5072,7 +5112,7 @@ private static IEnumerable ToLower_Culture_TestData() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public static void Test_ToLower_Culture() { foreach (object[] testdata in ToLower_Culture_TestData()) @@ -5548,7 +5588,7 @@ public static IEnumerable ToUpper_Culture_TestData() yield return new object[] { "h\u0131 world", "H\u0131 WORLD", CultureInfo.InvariantCulture }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(ToUpper_Culture_TestData))] public static void Test_ToUpper_Culture(string actual, string expected, CultureInfo culture) { @@ -5606,7 +5646,7 @@ public static IEnumerable ToUpper_TurkishI_TurkishCulture_MemberData() new KeyValuePair('\u0130', '\u0130'), new KeyValuePair('\u0131', '\u0049')); - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(ToUpper_TurkishI_TurkishCulture_MemberData))] public static void ToUpper_TurkishI_TurkishCulture(string s, string expected) { @@ -5626,7 +5666,7 @@ public static IEnumerable ToUpper_TurkishI_EnglishUSCulture_MemberData new KeyValuePair('\u0130', '\u0130'), new KeyValuePair('\u0131', '\u0049')); - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(ToUpper_TurkishI_EnglishUSCulture_MemberData))] public static void ToUpper_TurkishI_EnglishUSCulture(string s, string expected) { @@ -5646,7 +5686,7 @@ public static IEnumerable ToUpper_TurkishI_InvariantCulture_MemberData new KeyValuePair('\u0130', '\u0130'), new KeyValuePair('\u0131', '\u0131')); - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(ToUpper_TurkishI_InvariantCulture_MemberData))] public static void ToUpper_TurkishI_InvariantCulture(string s, string expected) { @@ -6683,25 +6723,29 @@ public string Format(string format, object arg, IFormatProvider formatProvider) } } - public static IEnumerable Compare_TestData() + public static IEnumerable CompareTest_TestData() { // str1 str2 culture ignorecase expected - yield return new object[] { "abcd", "ABcd", "en-US", false, -1 }; - yield return new object[] { "abcd", "ABcd", null, false, -1 }; - yield return new object[] { "ABcd", "abcd", "en-US", false, 1 }; - yield return new object[] { "ABcd", "abcd", null, false, 1 }; + yield return new object[] { "abcd", "ABcd", "en-US", false, PlatformDetection.IsInvariantGlobalization ? 1 : -1 }; + yield return new object[] { "abcd", "ABcd", null, false, PlatformDetection.IsInvariantGlobalization ? 1 : -1 }; + yield return new object[] { "ABcd", "abcd", "en-US", false, PlatformDetection.IsInvariantGlobalization ? -1 : 1 }; + yield return new object[] { "ABcd", "abcd", null, false, PlatformDetection.IsInvariantGlobalization ? -1 : 1 }; yield return new object[] { "abcd", "ABcd", "en-US", true, 0 }; yield return new object[] { "abcd", "ABcd", null, true, 0 }; - yield return new object[] { "latin i", "Latin I", "tr-TR", false, 1 }; - yield return new object[] { "latin i", "Latin I", "tr-TR", true, 1 }; - yield return new object[] { "turkish \u0130", "Turkish i", "tr-TR", true, 0 }; - yield return new object[] { "turkish \u0131", "Turkish I", "tr-TR", true, 0 }; yield return new object[] { null, null, "en-us", true, 0 }; yield return new object[] { null, null, null, true, 0 }; yield return new object[] { null, "", "en-us", true, -1 }; yield return new object[] { null, "", null, true, -1 }; yield return new object[] { "", null, "en-us", true, 1 }; yield return new object[] { "", null, null, true, 1 }; + + if (PlatformDetection.IsNotInvariantGlobalization) + { + yield return new object[] { "latin i", "Latin I", "tr-TR", false, 1 }; + yield return new object[] { "latin i", "Latin I", "tr-TR", true, 1 }; + yield return new object[] { "turkish \u0130", "Turkish i", "tr-TR", true, 0 }; + yield return new object[] { "turkish \u0131", "Turkish I", "tr-TR", true, 0 }; + } } public static IEnumerable UpperLowerCasing_TestData() @@ -6712,9 +6756,13 @@ public static IEnumerable UpperLowerCasing_TestData() yield return new object[] { "latin i", "LATIN I", "en-US" }; yield return new object[] { "latin i", "LATIN I", null }; yield return new object[] { "", "", null }; - yield return new object[] { "turky \u0131", "TURKY I", "tr-TR" }; - yield return new object[] { "turky i", "TURKY \u0130", "tr-TR" }; - yield return new object[] { "\ud801\udc29", PlatformDetection.IsWindows7 ? "\ud801\udc29" : "\ud801\udc01", "en-US" }; + + if (PlatformDetection.IsNotInvariantGlobalization) + { + yield return new object[] { "turky \u0131", "TURKY I", "tr-TR" }; + yield return new object[] { "turky i", "TURKY \u0130", "tr-TR" }; + yield return new object[] { "\ud801\udc29", PlatformDetection.IsWindows7 ? "\ud801\udc29" : "\ud801\udc01", "en-US" }; + } } public static IEnumerable StartEndWith_TestData() @@ -6726,28 +6774,32 @@ public static IEnumerable StartEndWith_TestData() yield return new object[] { "abcd", "AB", "CD", null, false, false }; yield return new object[] { "ABcd", "ab", "CD", "en-US", false, false }; yield return new object[] { "abcd", "AB", "CD", "en-US", true, true }; - yield return new object[] { "i latin i", "I Latin", "I", "tr-TR", false, false }; - yield return new object[] { "i latin i", "I Latin", "I", "tr-TR", true, false }; - yield return new object[] { "\u0130 turkish \u0130", "i", "i", "tr-TR", true, true }; - yield return new object[] { "\u0131 turkish \u0131", "I", "I", "tr-TR", true, true }; + + if (PlatformDetection.IsNotInvariantGlobalization) + { + yield return new object[] { "i latin i", "I Latin", "I", "tr-TR", false, false }; + yield return new object[] { "i latin i", "I Latin", "I", "tr-TR", true, false }; + yield return new object[] { "\u0130 turkish \u0130", "i", "i", "tr-TR", true, true }; + yield return new object[] { "\u0131 turkish \u0131", "I", "I", "tr-TR", true, true }; + } } [Theory] - [MemberData(nameof(Compare_TestData))] + [MemberData(nameof(CompareTest_TestData))] public static void CompareTest(string s1, string s2, string cultureName, bool ignoreCase, int expected) { CultureInfo ci = cultureName != null ? CultureInfo.GetCultureInfo(cultureName) : null; CompareOptions ignoreCaseOption = ignoreCase ? CompareOptions.IgnoreCase : CompareOptions.None; - Assert.Equal(expected, String.Compare(s1, s2, ignoreCase, ci)); - Assert.Equal(expected, String.Compare(s1, 0, s2, 0, s1 == null ? 0 : s1.Length, ignoreCase, ci)); - Assert.Equal(expected, String.Compare(s1, 0, s2, 0, s1 == null ? 0 : s1.Length, ci, ignoreCaseOption)); + Assert.Equal(expected, Math.Sign(String.Compare(s1, s2, ignoreCase, ci))); + Assert.Equal(expected, Math.Sign(String.Compare(s1, 0, s2, 0, s1 == null ? 0 : s1.Length, ignoreCase, ci))); + Assert.Equal(expected, Math.Sign(String.Compare(s1, 0, s2, 0, s1 == null ? 0 : s1.Length, ci, ignoreCaseOption))); - Assert.Equal(expected, String.Compare(s1, s2, ci, ignoreCaseOption)); - Assert.Equal(String.Compare(s1, s2, StringComparison.Ordinal), String.Compare(s1, s2, ci, CompareOptions.Ordinal)); - Assert.Equal(String.Compare(s1, s2, StringComparison.OrdinalIgnoreCase), String.Compare(s1, s2, ci, CompareOptions.OrdinalIgnoreCase)); + Assert.Equal(expected, Math.Sign(String.Compare(s1, s2, ci, ignoreCaseOption))); + Assert.Equal(Math.Sign(String.Compare(s1, s2, StringComparison.Ordinal)), Math.Sign(String.Compare(s1, s2, ci, CompareOptions.Ordinal))); + Assert.Equal(Math.Sign(String.Compare(s1, s2, StringComparison.OrdinalIgnoreCase)), Math.Sign(String.Compare(s1, s2, ci, CompareOptions.OrdinalIgnoreCase))); - if (ci != null) + if (ci != null && PlatformDetection.IsNotInvariantGlobalization) { using (new ThreadCultureChange(ci)) { @@ -6786,7 +6838,7 @@ public static void StartEndWithTest(string source, string start, string end, str Assert.Equal(expected, source.EndsWith(end, ignoreCase, ci)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [InlineData("", StringComparison.InvariantCulture, true)] [InlineData("", StringComparison.Ordinal, true)] [InlineData(ZeroWidthJoiner, StringComparison.InvariantCulture, true)] @@ -6970,7 +7022,7 @@ public static void StartsWithUnknownComparisonType_StringComparison() Assert.Throws(() => s1.AsSpan().CompareTo(s1.AsSpan(), (StringComparison)6)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public static void StartsWithMatchNonOrdinal_StringComparison() { string s1 = "abcd"; @@ -7247,7 +7299,7 @@ public static void InternalTestAotSubset() #pragma warning restore 0618 // restore warning when accessing obsolete members } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [ActiveIssue("https://github.com/dotnet/runtime/issues/34577", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] public static unsafe void NormalizationTest() // basic test; more tests in globalization tests { diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props index a8411eeb60d7..c46cdcdb3b19 100644 --- a/src/libraries/Directory.Build.props +++ b/src/libraries/Directory.Build.props @@ -60,6 +60,12 @@ false + + + + $(NoWarn);MSLIB0003 + + diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index 48dc86d6086b..bf87a4ecc83a 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -226,9 +226,6 @@ - - $(DefineConstants),INTERNAL_NULLABLE_ATTRIBUTES - @@ -240,6 +237,15 @@ true + + + + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Microsoft.Extensions.Caching.Abstractions.csproj b/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Microsoft.Extensions.Caching.Abstractions.csproj index 236c28690464..3ba2a9af6d41 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Microsoft.Extensions.Caching.Abstractions.csproj +++ b/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/Microsoft.Extensions.Caching.Abstractions.csproj @@ -1,12 +1,16 @@ - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true true + + + diff --git a/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCache.cs b/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCache.cs index 6b4e81f0dcc3..5bbfb4acf241 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCache.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCache.cs @@ -213,6 +213,14 @@ private void SetEntry(CacheEntry entry) TriggerOvercapacityCompaction(); } + else + { + if (_options.SizeLimit.HasValue) + { + // Entry could not be added due to being expired, reset cache size + Interlocked.Add(ref _cacheSize, -entry.Size.Value); + } + } entry.InvokeEvictionCallbacks(); if (priorEntry != null) diff --git a/src/libraries/Microsoft.Extensions.Caching.Memory/src/Microsoft.Extensions.Caching.Memory.csproj b/src/libraries/Microsoft.Extensions.Caching.Memory/src/Microsoft.Extensions.Caching.Memory.csproj index 6ffc70073433..bb1022311814 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Memory/src/Microsoft.Extensions.Caching.Memory.csproj +++ b/src/libraries/Microsoft.Extensions.Caching.Memory/src/Microsoft.Extensions.Caching.Memory.csproj @@ -1,7 +1,8 @@ - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true true @@ -13,4 +14,9 @@ + + + + + diff --git a/src/libraries/Microsoft.Extensions.Caching.Memory/tests/CapacityTests.cs b/src/libraries/Microsoft.Extensions.Caching.Memory/tests/CapacityTests.cs index 069d4ff12f15..4ea5c20c7113 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Memory/tests/CapacityTests.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Memory/tests/CapacityTests.cs @@ -341,6 +341,41 @@ public async Task ExpiringEntryDecreasesCacheSize() Assert.Equal(0, cache.Size); } + [Fact] + public void TryingToAddExpiredEntryDoesNotIncreaseCacheSize() + { + var testClock = new TestClock(); + var cache = new MemoryCache(new MemoryCacheOptions { Clock = testClock, SizeLimit = 10 }); + + var entryOptions = new MemoryCacheEntryOptions + { + Size = 5, + AbsoluteExpiration = testClock.UtcNow.Add(TimeSpan.FromMinutes(-1)) + }; + + cache.Set("key", "value", entryOptions); + + Assert.Null(cache.Get("key")); + Assert.Equal(0, cache.Size); + } + + [Fact] + public void TryingToAddEntryWithExpiredTokenDoesNotIncreaseCacheSize() + { + var cache = new MemoryCache(new MemoryCacheOptions { SizeLimit = 10 }); + var testExpirationToken = new TestExpirationToken { HasChanged = true }; + var entryOptions = new MemoryCacheEntryOptions + { + Size = 5, + ExpirationTokens = { testExpirationToken } + }; + + cache.Set("key", "value", entryOptions); + + Assert.Null(cache.Get("key")); + Assert.Equal(0, cache.Size); + } + [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/33993")] public async Task CompactsToLessThanLowWatermarkUsingLRUWhenHighWatermarkExceeded() diff --git a/src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/Microsoft.Extensions.Configuration.Abstractions.csproj b/src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/Microsoft.Extensions.Configuration.Abstractions.csproj index 7bbd535f36ab..1bc83e66b5ce 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/Microsoft.Extensions.Configuration.Abstractions.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/Microsoft.Extensions.Configuration.Abstractions.csproj @@ -1,7 +1,8 @@ - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true @@ -12,4 +13,11 @@ + + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/src/Microsoft.Extensions.Configuration.Binder.csproj b/src/libraries/Microsoft.Extensions.Configuration.Binder/src/Microsoft.Extensions.Configuration.Binder.csproj index 0a40aca7a509..2a1759b0d0c6 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Binder/src/Microsoft.Extensions.Configuration.Binder.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/src/Microsoft.Extensions.Configuration.Binder.csproj @@ -1,7 +1,8 @@ - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true true @@ -10,4 +11,10 @@ + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/Microsoft.Extensions.Configuration.CommandLine.csproj b/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/Microsoft.Extensions.Configuration.CommandLine.csproj index 779f84028323..980c31e3b203 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/Microsoft.Extensions.Configuration.CommandLine.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/Microsoft.Extensions.Configuration.CommandLine.csproj @@ -1,7 +1,8 @@ - netstandard2.0;$(DefaultNetCoreTargetFramework) + netstandard2.0;$(DefaultNetCoreTargetFramework);net461;$(NetFrameworkCurrent) + true true @@ -10,4 +11,8 @@ + + + + diff --git a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/Microsoft.Extensions.Configuration.EnvironmentVariables.csproj b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/Microsoft.Extensions.Configuration.EnvironmentVariables.csproj index 0a40aca7a509..7debc9c3c30e 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/Microsoft.Extensions.Configuration.EnvironmentVariables.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/Microsoft.Extensions.Configuration.EnvironmentVariables.csproj @@ -1,7 +1,8 @@ - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true true @@ -10,4 +11,9 @@ + + + + + diff --git a/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/src/Microsoft.Extensions.Configuration.FileExtensions.csproj b/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/src/Microsoft.Extensions.Configuration.FileExtensions.csproj index 798c6584af88..9c7df603e519 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/src/Microsoft.Extensions.Configuration.FileExtensions.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/src/Microsoft.Extensions.Configuration.FileExtensions.csproj @@ -1,7 +1,8 @@ - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true true @@ -13,4 +14,8 @@ + + + + diff --git a/src/libraries/Microsoft.Extensions.Configuration.Ini/src/Microsoft.Extensions.Configuration.Ini.csproj b/src/libraries/Microsoft.Extensions.Configuration.Ini/src/Microsoft.Extensions.Configuration.Ini.csproj index bcf7dc105d4d..88f10cc47d33 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Ini/src/Microsoft.Extensions.Configuration.Ini.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration.Ini/src/Microsoft.Extensions.Configuration.Ini.csproj @@ -1,7 +1,8 @@ - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true true @@ -12,4 +13,8 @@ + + + + diff --git a/src/libraries/Microsoft.Extensions.Configuration.Json/src/Microsoft.Extensions.Configuration.Json.csproj b/src/libraries/Microsoft.Extensions.Configuration.Json/src/Microsoft.Extensions.Configuration.Json.csproj index f26210a6e991..d313804efd7d 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Json/src/Microsoft.Extensions.Configuration.Json.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration.Json/src/Microsoft.Extensions.Configuration.Json.csproj @@ -1,7 +1,8 @@ - $(NetCoreAppCurrent);netstandard2.0 + $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent) + true true true @@ -21,4 +22,10 @@ + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/Microsoft.Extensions.Configuration.UserSecrets.csproj b/src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/Microsoft.Extensions.Configuration.UserSecrets.csproj index 654d0f9f53be..5df32c910337 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/Microsoft.Extensions.Configuration.UserSecrets.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/Microsoft.Extensions.Configuration.UserSecrets.csproj @@ -1,7 +1,8 @@ - $(NetCoreAppCurrent);netstandard2.0 + $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent) + true true @@ -25,5 +26,8 @@ + + + diff --git a/src/libraries/Microsoft.Extensions.Configuration.Xml/src/Microsoft.Extensions.Configuration.Xml.csproj b/src/libraries/Microsoft.Extensions.Configuration.Xml/src/Microsoft.Extensions.Configuration.Xml.csproj index 33d909eeb983..9260eb9ec9d0 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Xml/src/Microsoft.Extensions.Configuration.Xml.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration.Xml/src/Microsoft.Extensions.Configuration.Xml.csproj @@ -1,7 +1,8 @@ - $(NetCoreAppCurrent);netstandard2.0 + $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent) + true true @@ -20,4 +21,12 @@ + + + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Configuration/src/Microsoft.Extensions.Configuration.csproj b/src/libraries/Microsoft.Extensions.Configuration/src/Microsoft.Extensions.Configuration.csproj index 4a83026e0d99..0c4d78a16ea3 100644 --- a/src/libraries/Microsoft.Extensions.Configuration/src/Microsoft.Extensions.Configuration.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration/src/Microsoft.Extensions.Configuration.csproj @@ -1,7 +1,8 @@ - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true true @@ -10,4 +11,9 @@ + + + + + diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/Microsoft.Extensions.DependencyInjection.Abstractions.csproj b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/Microsoft.Extensions.DependencyInjection.Abstractions.csproj index 17654fa1889d..0d3119d83d6b 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/Microsoft.Extensions.DependencyInjection.Abstractions.csproj +++ b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/Microsoft.Extensions.DependencyInjection.Abstractions.csproj @@ -1,7 +1,8 @@ - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true $(DefineConstants);ActivatorUtilities_In_DependencyInjection true enable @@ -18,4 +19,10 @@ Link="Common\src\Extensions\ActivatorUtilities\ObjectFactory.cs" /> + + + + + + diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/ref/Microsoft.Extensions.DependencyModel.cs b/src/libraries/Microsoft.Extensions.DependencyModel/ref/Microsoft.Extensions.DependencyModel.cs index 93477fdf17ec..7ca797e7d0a8 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/ref/Microsoft.Extensions.DependencyModel.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/ref/Microsoft.Extensions.DependencyModel.cs @@ -6,7 +6,7 @@ namespace Microsoft.DotNet.PlatformAbstractions { - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("This type is obsolete and will be removed in a future version. The recommended alternative is System.HashCode.")] public partial struct HashCodeCombiner { diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj b/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj index a164401909d9..b6794fc1c8e8 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj @@ -4,6 +4,10 @@ true true + + + $(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.6.1\1.0.1\lib\net461\;$(AssemblySearchPaths) + - + + diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/src/RuntimeLibrary.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/RuntimeLibrary.cs index 336a57b9ed54..417d68f83490 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/src/RuntimeLibrary.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/RuntimeLibrary.cs @@ -58,6 +58,31 @@ public RuntimeLibrary(string type, { } + + /// + /// Initializes a new . + /// + /// The library's type. + /// The library's name. + /// The library's version. + /// The library package's hash. + /// The library's runtime assemblies. + /// The library's native libraries. + /// The library's resource assemblies. + /// The library's dependencies. + /// Whether the library is serviceable. + /// The library package's path. + /// The library package's hash path. + /// The library's runtime store manifest name. + /// + /// The argument is null. + /// The argument is null. + /// The argument is null. + /// The argument is null. + /// The argument is null. + /// The argument is null. + /// The argument is null. + /// public RuntimeLibrary(string type, string name, string version, diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs index cf3b27e965b7..ecafadcc0a9b 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs @@ -665,6 +665,46 @@ public void IgnoresUnknownPropertiesInRuntimeTargets() .Which.AssetPaths.Should().BeEmpty(); } + [Fact] + public void ReadsRuntimePackLibrary() + { + var context = Read( +@"{ + ""runtimeTarget"": { + ""name"": "".NETCoreApp,Version=v5.0/win-x86"", + ""signature"": """" + }, + ""targets"": { + "".NETCoreApp,Version=v5.0/win-x86"": { + ""runtimepack.Microsoft.NETCore.App.Runtime.win-x86/5.0.0-preview.5.20251.1"": { + ""runtime"": { + ""System.Private.CoreLib.dll"": { + ""assemblyVersion"": ""5.0.0.0"", + ""fileVersion"": ""5.0.20.25101"" + } + }, + ""native"": { + ""coreclr.dll"": { + ""fileVersion"": ""5.0.20.25101"" + } + } + } + } + }, + ""libraries"": { + ""runtimepack.Microsoft.NETCore.App.Runtime.win-x86/5.0.0-preview.5.20251.1"": { + ""type"": ""runtimepack"", + ""serviceable"": false, + ""sha512"": """" + } + } +}"); + + var runtimeLibrary = context.RuntimeLibraries.Should().ContainSingle().Subject; + runtimeLibrary.Type.Should().Be("runtimepack"); + runtimeLibrary.Serviceable.Should().Be(false); + } + [Fact] public void ReadsCompilationOptions() { diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs index 0762b3ef3db2..c6c752c6fbb0 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs @@ -299,6 +299,68 @@ private JObject WritesRuntimeLibrariesToRuntimeTargetCore(RuntimeAssetGroup grou return runtimeAssembly; } + [Fact] + public void WritesRuntimePackLibrariesWithFrameworkName() + { + var result = Save(Create( + "Target", + "win-x86", + false, + runtimeLibraries: new[] + { + new RuntimeLibrary( + "runtimepack", + "RuntimePackName", + "1.2.3", + "HASH", + new [] { + new RuntimeAssetGroup( + string.Empty, + new [] + { + new RuntimeFile("System.Private.CoreLib.dll", "2.3.4", "3.4.5"), + }), + }, + new [] { + new RuntimeAssetGroup( + string.Empty, + new [] + { + new RuntimeFile("coreclr.dll", "4.5.6", "5.6.7"), + }), + }, + new ResourceAssembly[0], + new Dependency[0], + false, + "PackagePath", + "PackageHashPath", + "placeHolderManifest.xml" + ), + })); + + // targets + var targets = result.Should().HavePropertyAsObject("targets").Subject; + var target = targets.Should().HavePropertyAsObject("Target/win-x86").Subject; + var library = target.Should().HavePropertyAsObject("RuntimePackName/1.2.3").Subject; + library.Should().NotHaveProperty("dependencies"); + library.Should().NotHaveProperty("resources"); + + library.Should().HavePropertyAsObject("runtime") + .Subject.Should().HaveProperty("System.Private.CoreLib.dll"); + library.Should().HavePropertyAsObject("native") + .Subject.Should().HaveProperty("coreclr.dll"); + + //libraries + var libraries = result.Should().HavePropertyAsObject("libraries").Subject; + library = libraries.Should().HavePropertyAsObject("RuntimePackName/1.2.3").Subject; + library.Should().HavePropertyValue("sha512", "HASH"); + library.Should().HavePropertyValue("type", "runtimepack"); + library.Should().HavePropertyValue("serviceable", false); + library.Should().HavePropertyValue("path", "PackagePath"); + library.Should().HavePropertyValue("hashPath", "PackageHashPath"); + library.Should().HavePropertyValue("runtimeStoreManifestName", "placeHolderManifest.xml"); + } + [Fact] public void MergesRuntimeAndCompileLibrariesForPortable() { diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/Microsoft.Extensions.FileProviders.Abstractions.csproj b/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/Microsoft.Extensions.FileProviders.Abstractions.csproj index c165dfa6e216..8c16ef3ce824 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/Microsoft.Extensions.FileProviders.Abstractions.csproj +++ b/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/Microsoft.Extensions.FileProviders.Abstractions.csproj @@ -2,7 +2,8 @@ Microsoft.Extensions.FileProviders - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true true @@ -16,4 +17,9 @@ + + + + + diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Composite/src/Microsoft.Extensions.FileProviders.Composite.csproj b/src/libraries/Microsoft.Extensions.FileProviders.Composite/src/Microsoft.Extensions.FileProviders.Composite.csproj index b9d2299128c3..898fe2fbd58c 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Composite/src/Microsoft.Extensions.FileProviders.Composite.csproj +++ b/src/libraries/Microsoft.Extensions.FileProviders.Composite/src/Microsoft.Extensions.FileProviders.Composite.csproj @@ -2,7 +2,8 @@ Microsoft.Extensions.FileProviders - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true true @@ -11,4 +12,9 @@ + + + + + diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Microsoft.Extensions.FileProviders.Physical.csproj b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Microsoft.Extensions.FileProviders.Physical.csproj index 865c7a92183e..ba390655fe15 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Microsoft.Extensions.FileProviders.Physical.csproj +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Microsoft.Extensions.FileProviders.Physical.csproj @@ -2,11 +2,17 @@ Microsoft.Extensions.FileProviders - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true true true + + + $(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.6.1\1.0.1\lib\net461\;$(AssemblySearchPaths) + + @@ -20,4 +26,12 @@ + + + + + + + + diff --git a/src/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Microsoft.Extensions.FileSystemGlobbing.csproj b/src/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Microsoft.Extensions.FileSystemGlobbing.csproj index 4bb4e62e3d33..ab4b23464b4d 100644 --- a/src/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Microsoft.Extensions.FileSystemGlobbing.csproj +++ b/src/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Microsoft.Extensions.FileSystemGlobbing.csproj @@ -1,7 +1,8 @@ - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true true @@ -10,4 +11,10 @@ Link="Common\src\Extensions\HashCodeCombiner\HashCodeCombiner.cs" /> + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/HostingAbstractionsHostExtensions.cs b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/HostingAbstractionsHostExtensions.cs index ac0368b913c0..f97c65284b1d 100644 --- a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/HostingAbstractionsHostExtensions.cs +++ b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/HostingAbstractionsHostExtensions.cs @@ -26,9 +26,10 @@ public static void Start(this IHost host) /// The timeout for stopping gracefully. Once expired the /// server may terminate any remaining active connections. /// The that represents the asynchronous operation. - public static Task StopAsync(this IHost host, TimeSpan timeout) + public static async Task StopAsync(this IHost host, TimeSpan timeout) { - return host.StopAsync(new CancellationTokenSource(timeout).Token); + using CancellationTokenSource cts = new CancellationTokenSource(timeout); + await host.StopAsync(cts.Token).ConfigureAwait(false); } /// @@ -103,7 +104,8 @@ public static async Task WaitForShutdownAsync(this IHost host, CancellationToken await waitForStop.Task.ConfigureAwait(false); // Host will use its default ShutdownTimeout if none is specified. - await host.StopAsync().ConfigureAwait(false); + // The cancellation token may have been triggered to unblock waitForStop. Don't pass it here because that would trigger an abortive shutdown. + await host.StopAsync(CancellationToken.None).ConfigureAwait(false); } } } diff --git a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/Microsoft.Extensions.Hosting.Abstractions.csproj b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/Microsoft.Extensions.Hosting.Abstractions.csproj index 04ca6e349f2e..3de7d53d9c9e 100644 --- a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/Microsoft.Extensions.Hosting.Abstractions.csproj +++ b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/Microsoft.Extensions.Hosting.Abstractions.csproj @@ -1,7 +1,8 @@ - $(NetCoreAppCurrent);netstandard2.0 + $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent) + true Microsoft.Extensions.Hosting true @@ -15,9 +16,13 @@ - + + + + + diff --git a/src/libraries/Microsoft.Extensions.Hosting/src/Microsoft.Extensions.Hosting.csproj b/src/libraries/Microsoft.Extensions.Hosting/src/Microsoft.Extensions.Hosting.csproj index 86257a71d216..d384aae9cc35 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/src/Microsoft.Extensions.Hosting.csproj +++ b/src/libraries/Microsoft.Extensions.Hosting/src/Microsoft.Extensions.Hosting.csproj @@ -1,9 +1,14 @@ - $(NetCoreAppCurrent);netstandard2.0;netstandard2.1 + $(NetCoreAppCurrent);netstandard2.0;netstandard2.1;net461;$(NetFrameworkCurrent) + true true + + + $(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.6.1\1.0.1\lib\net461\;$(AssemblySearchPaths) + @@ -40,9 +45,16 @@ - + + + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Http/src/Microsoft.Extensions.Http.csproj b/src/libraries/Microsoft.Extensions.Http/src/Microsoft.Extensions.Http.csproj index 5fb5c618016b..47eeebc131c9 100644 --- a/src/libraries/Microsoft.Extensions.Http/src/Microsoft.Extensions.Http.csproj +++ b/src/libraries/Microsoft.Extensions.Http/src/Microsoft.Extensions.Http.csproj @@ -1,9 +1,14 @@ - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true true + + + $(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.6.1\1.0.1\lib\net461\;$(AssemblySearchPaths) + + + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/ref/Microsoft.Extensions.Logging.Abstractions.cs b/src/libraries/Microsoft.Extensions.Logging.Abstractions/ref/Microsoft.Extensions.Logging.Abstractions.cs index aa32585b1a76..ce0feb995008 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/ref/Microsoft.Extensions.Logging.Abstractions.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/ref/Microsoft.Extensions.Logging.Abstractions.cs @@ -125,6 +125,19 @@ public enum LogLevel } namespace Microsoft.Extensions.Logging.Abstractions { + public readonly partial struct LogEntry + { + private readonly TState _State_k__BackingField; + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LogEntry(Microsoft.Extensions.Logging.LogLevel logLevel, string category, Microsoft.Extensions.Logging.EventId eventId, TState state, System.Exception exception, System.Func formatter) { throw null; } + public string Category { get { throw null; } } + public Microsoft.Extensions.Logging.EventId EventId { get { throw null; } } + public System.Exception Exception { get { throw null; } } + public System.Func Formatter { get { throw null; } } + public Microsoft.Extensions.Logging.LogLevel LogLevel { get { throw null; } } + public TState State { get { throw null; } } + } public partial class NullLogger : Microsoft.Extensions.Logging.ILogger { internal NullLogger() { } diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/LogEntry.cs b/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/LogEntry.cs new file mode 100644 index 000000000000..e0cab847a156 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/LogEntry.cs @@ -0,0 +1,62 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +namespace Microsoft.Extensions.Logging.Abstractions +{ + /// + /// Holds the information for a single log entry. + /// + public readonly struct LogEntry + { + /// + /// Initializes an instance of the LogEntry struct. + /// + /// The log level. + /// The category name for the log. + /// The log event Id. + /// The state for which log is being written. + /// The log exception. + /// The formatter. + public LogEntry(LogLevel logLevel, string category, EventId eventId, TState state, Exception exception, Func formatter) + { + LogLevel = logLevel; + Category = category; + EventId = eventId; + State = state; + Exception = exception; + Formatter = formatter; + } + + /// + /// Gets the LogLevel + /// + public LogLevel LogLevel { get; } + + /// + /// Gets the log category + /// + public string Category { get; } + + /// + /// Gets the log EventId + /// + public EventId EventId { get; } + + /// + /// Gets the TState + /// + public TState State { get; } + + /// + /// Gets the log exception + /// + public Exception Exception { get; } + + /// + /// Gets the formatter + /// + public Func Formatter { get; } + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/Microsoft.Extensions.Logging.Abstractions.csproj b/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/Microsoft.Extensions.Logging.Abstractions.csproj index 5896926dec8d..1462166794f3 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/Microsoft.Extensions.Logging.Abstractions.csproj +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/Microsoft.Extensions.Logging.Abstractions.csproj @@ -1,7 +1,8 @@ - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true true @@ -14,4 +15,9 @@ Link="Common\src\Extensions\Logging\NullScope.cs" /> + + + + + diff --git a/src/libraries/Microsoft.Extensions.Logging.Configuration/src/Microsoft.Extensions.Logging.Configuration.csproj b/src/libraries/Microsoft.Extensions.Logging.Configuration/src/Microsoft.Extensions.Logging.Configuration.csproj index d45b23a82569..31d6673acd76 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Configuration/src/Microsoft.Extensions.Logging.Configuration.csproj +++ b/src/libraries/Microsoft.Extensions.Logging.Configuration/src/Microsoft.Extensions.Logging.Configuration.csproj @@ -1,7 +1,8 @@ - $(NetCoreAppCurrent);netstandard2.0 + $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent) + true true @@ -26,4 +27,8 @@ + + + + diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/Microsoft.Extensions.Logging.Console.sln b/src/libraries/Microsoft.Extensions.Logging.Console/Microsoft.Extensions.Logging.Console.sln index 67d90a8d3639..a7cab36d8df3 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/Microsoft.Extensions.Logging.Console.sln +++ b/src/libraries/Microsoft.Extensions.Logging.Console/Microsoft.Extensions.Logging.Console.sln @@ -11,6 +11,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Loggin EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Logging.Console", "src\Microsoft.Extensions.Logging.Console.csproj", "{CDEDF61A-4D74-4EAA-B31E-AF5CAAA7B974}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{56A299FB-3733-4AF5-AE10-66AB73D6FC13}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Logging.Console.Tests", "tests\Microsoft.Extensions.Logging.Console.Tests.csproj", "{9B344154-013F-4D6B-99A5-77DFA1CB8CC0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -25,6 +29,10 @@ Global {CDEDF61A-4D74-4EAA-B31E-AF5CAAA7B974}.Debug|Any CPU.Build.0 = Debug|Any CPU {CDEDF61A-4D74-4EAA-B31E-AF5CAAA7B974}.Release|Any CPU.ActiveCfg = Release|Any CPU {CDEDF61A-4D74-4EAA-B31E-AF5CAAA7B974}.Release|Any CPU.Build.0 = Release|Any CPU + {9B344154-013F-4D6B-99A5-77DFA1CB8CC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9B344154-013F-4D6B-99A5-77DFA1CB8CC0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9B344154-013F-4D6B-99A5-77DFA1CB8CC0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9B344154-013F-4D6B-99A5-77DFA1CB8CC0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -32,6 +40,7 @@ Global GlobalSection(NestedProjects) = preSolution {6D191D5A-572C-4BFA-B73B-C24AF80E8016} = {A12B6049-11A7-4E2B-857B-620B917B4A46} {CDEDF61A-4D74-4EAA-B31E-AF5CAAA7B974} = {A1F1D16A-5787-45E5-AF85-617702C216C6} + {9B344154-013F-4D6B-99A5-77DFA1CB8CC0} = {56A299FB-3733-4AF5-AE10-66AB73D6FC13} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E75E4D9D-8919-409F-8FF1-67DD9C346EA7} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.cs b/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.cs index 105b55c70d0d..13f7dfa6c3bd 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.cs @@ -10,10 +10,35 @@ public static partial class ConsoleLoggerExtensions { public static Microsoft.Extensions.Logging.ILoggingBuilder AddConsole(this Microsoft.Extensions.Logging.ILoggingBuilder builder) { throw null; } public static Microsoft.Extensions.Logging.ILoggingBuilder AddConsole(this Microsoft.Extensions.Logging.ILoggingBuilder builder, System.Action configure) { throw null; } + public static Microsoft.Extensions.Logging.ILoggingBuilder AddConsoleFormatter(this Microsoft.Extensions.Logging.ILoggingBuilder builder) where TFormatter : Microsoft.Extensions.Logging.Console.ConsoleFormatter where TOptions : Microsoft.Extensions.Logging.Console.ConsoleFormatterOptions { throw null; } + public static Microsoft.Extensions.Logging.ILoggingBuilder AddConsoleFormatter(this Microsoft.Extensions.Logging.ILoggingBuilder builder, System.Action configure) where TFormatter : Microsoft.Extensions.Logging.Console.ConsoleFormatter where TOptions : Microsoft.Extensions.Logging.Console.ConsoleFormatterOptions { throw null; } + public static Microsoft.Extensions.Logging.ILoggingBuilder AddJsonConsole(this Microsoft.Extensions.Logging.ILoggingBuilder builder, System.Action configure) { throw null; } + public static Microsoft.Extensions.Logging.ILoggingBuilder AddSimpleConsole(this Microsoft.Extensions.Logging.ILoggingBuilder builder, System.Action configure) { throw null; } + public static Microsoft.Extensions.Logging.ILoggingBuilder AddSystemdConsole(this Microsoft.Extensions.Logging.ILoggingBuilder builder, System.Action configure) { throw null; } } } namespace Microsoft.Extensions.Logging.Console { + public abstract partial class ConsoleFormatter + { + protected ConsoleFormatter(string name) { } + public string Name { get { throw null; } } + public abstract void Write(in Microsoft.Extensions.Logging.Abstractions.LogEntry logEntry, Microsoft.Extensions.Logging.IExternalScopeProvider scopeProvider, System.IO.TextWriter textWriter); + } + public static partial class ConsoleFormatterNames + { + public const string Json = "json"; + public const string Simple = "simple"; + public const string Systemd = "systemd"; + } + public partial class ConsoleFormatterOptions + { + public ConsoleFormatterOptions() { } + public bool IncludeScopes { get { throw null; } set { } } + public string TimestampFormat { get { throw null; } set { } } + public bool UseUtcTimestamp { get { throw null; } set { } } + } + [System.ObsoleteAttribute("ConsoleLoggerFormat has been deprecated.", false)] public enum ConsoleLoggerFormat { Default = 0, @@ -22,19 +47,37 @@ public enum ConsoleLoggerFormat public partial class ConsoleLoggerOptions { public ConsoleLoggerOptions() { } + [System.ObsoleteAttribute("ConsoleLoggerOptions.DisableColors has been deprecated. Please use SimpleConsoleFormatterOptions.DisableColors instead.", false)] public bool DisableColors { get { throw null; } set { } } + [System.ObsoleteAttribute("ConsoleLoggerOptions.Format has been deprecated. Please use ConsoleLoggerOptions.FormatterName instead.", false)] public Microsoft.Extensions.Logging.Console.ConsoleLoggerFormat Format { get { throw null; } set { } } + public string FormatterName { get { throw null; } set { } } + [System.ObsoleteAttribute("ConsoleLoggerOptions.IncludeScopes has been deprecated. Please use ConsoleFormatterOptions.IncludeScopes instead.", false)] public bool IncludeScopes { get { throw null; } set { } } public Microsoft.Extensions.Logging.LogLevel LogToStandardErrorThreshold { get { throw null; } set { } } + [System.ObsoleteAttribute("ConsoleLoggerOptions.TimestampFormat has been deprecated. Please use ConsoleFormatterOptions.TimestampFormat instead.", false)] public string TimestampFormat { get { throw null; } set { } } + [System.ObsoleteAttribute("ConsoleLoggerOptions.UseUtcTimestamp has been deprecated. Please use ConsoleFormatterOptions.UseUtcTimestamp instead.", false)] public bool UseUtcTimestamp { get { throw null; } set { } } } [Microsoft.Extensions.Logging.ProviderAliasAttribute("Console")] public partial class ConsoleLoggerProvider : Microsoft.Extensions.Logging.ILoggerProvider, Microsoft.Extensions.Logging.ISupportExternalScope, System.IDisposable { public ConsoleLoggerProvider(Microsoft.Extensions.Options.IOptionsMonitor options) { } + public ConsoleLoggerProvider(Microsoft.Extensions.Options.IOptionsMonitor options, System.Collections.Generic.IEnumerable formatters) { } public Microsoft.Extensions.Logging.ILogger CreateLogger(string name) { throw null; } public void Dispose() { } public void SetScopeProvider(Microsoft.Extensions.Logging.IExternalScopeProvider scopeProvider) { } } + public partial class JsonConsoleFormatterOptions : Microsoft.Extensions.Logging.Console.ConsoleFormatterOptions + { + public JsonConsoleFormatterOptions() { } + public System.Text.Json.JsonWriterOptions JsonWriterOptions { get { throw null; } set { } } + } + public partial class SimpleConsoleFormatterOptions : Microsoft.Extensions.Logging.Console.ConsoleFormatterOptions + { + public SimpleConsoleFormatterOptions() { } + public bool DisableColors { get { throw null; } set { } } + public bool SingleLine { get { throw null; } set { } } + } } diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.csproj b/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.csproj index 17f4ef6d337e..0756d569fde5 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.csproj +++ b/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.csproj @@ -5,6 +5,7 @@ + diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiLogConsole.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiLogConsole.cs index a2413615e551..9943da694c28 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiLogConsole.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiLogConsole.cs @@ -1,125 +1,25 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Text; +using System.IO; namespace Microsoft.Extensions.Logging.Console { /// - /// For non-Windows platform consoles which understand the ANSI escape code sequences to represent color + /// For consoles which understand the ANSI escape code sequences to represent color /// internal class AnsiLogConsole : IConsole { - private readonly StringBuilder _outputBuilder; - private readonly IAnsiSystemConsole _systemConsole; + private readonly TextWriter _textWriter; - public AnsiLogConsole(IAnsiSystemConsole systemConsole) + public AnsiLogConsole(bool stdErr = false) { - _outputBuilder = new StringBuilder(); - _systemConsole = systemConsole; + _textWriter = stdErr ? System.Console.Error : System.Console.Out; } - public void Write(string message, ConsoleColor? background, ConsoleColor? foreground) + public void Write(string message) { - // Order: backgroundcolor, foregroundcolor, Message, reset foregroundcolor, reset backgroundcolor - if (background.HasValue) - { - _outputBuilder.Append(GetBackgroundColorEscapeCode(background.Value)); - } - - if (foreground.HasValue) - { - _outputBuilder.Append(GetForegroundColorEscapeCode(foreground.Value)); - } - - _outputBuilder.Append(message); - - if (foreground.HasValue) - { - _outputBuilder.Append("\x1B[39m\x1B[22m"); // reset to default foreground color - } - - if (background.HasValue) - { - _outputBuilder.Append("\x1B[49m"); // reset to the background color - } - } - - public void WriteLine(string message, ConsoleColor? background, ConsoleColor? foreground) - { - Write(message, background, foreground); - _outputBuilder.AppendLine(); - } - - public void Flush() - { - _systemConsole.Write(_outputBuilder.ToString()); - _outputBuilder.Clear(); - } - - private static string GetForegroundColorEscapeCode(ConsoleColor color) - { - switch (color) - { - case ConsoleColor.Black: - return "\x1B[30m"; - case ConsoleColor.DarkRed: - return "\x1B[31m"; - case ConsoleColor.DarkGreen: - return "\x1B[32m"; - case ConsoleColor.DarkYellow: - return "\x1B[33m"; - case ConsoleColor.DarkBlue: - return "\x1B[34m"; - case ConsoleColor.DarkMagenta: - return "\x1B[35m"; - case ConsoleColor.DarkCyan: - return "\x1B[36m"; - case ConsoleColor.Gray: - return "\x1B[37m"; - case ConsoleColor.Red: - return "\x1B[1m\x1B[31m"; - case ConsoleColor.Green: - return "\x1B[1m\x1B[32m"; - case ConsoleColor.Yellow: - return "\x1B[1m\x1B[33m"; - case ConsoleColor.Blue: - return "\x1B[1m\x1B[34m"; - case ConsoleColor.Magenta: - return "\x1B[1m\x1B[35m"; - case ConsoleColor.Cyan: - return "\x1B[1m\x1B[36m"; - case ConsoleColor.White: - return "\x1B[1m\x1B[37m"; - default: - return "\x1B[39m\x1B[22m"; // default foreground color - } - } - - private static string GetBackgroundColorEscapeCode(ConsoleColor color) - { - switch (color) - { - case ConsoleColor.Black: - return "\x1B[40m"; - case ConsoleColor.Red: - return "\x1B[41m"; - case ConsoleColor.Green: - return "\x1B[42m"; - case ConsoleColor.Yellow: - return "\x1B[43m"; - case ConsoleColor.Blue: - return "\x1B[44m"; - case ConsoleColor.Magenta: - return "\x1B[45m"; - case ConsoleColor.Cyan: - return "\x1B[46m"; - case ConsoleColor.White: - return "\x1B[47m"; - default: - return "\x1B[49m"; // Use default background color - } + _textWriter.Write(message); } } } diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParser.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParser.cs new file mode 100644 index 000000000000..665093b40866 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParser.cs @@ -0,0 +1,207 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.IO; + +namespace Microsoft.Extensions.Logging.Console +{ + internal class AnsiParser + { + private readonly Action _onParseWrite; + public AnsiParser(Action onParseWrite) + { + if (onParseWrite == null) + { + throw new ArgumentNullException(nameof(onParseWrite)); + } + _onParseWrite = onParseWrite; + } + + /// + /// Parses a subset of display attributes + /// Set Display Attributes + /// Set Attribute Mode [{attr1};...;{attrn}m + /// Sets multiple display attribute settings. The following lists standard attributes that are getting parsed: + /// 1 Bright + /// Foreground Colours + /// 30 Black + /// 31 Red + /// 32 Green + /// 33 Yellow + /// 34 Blue + /// 35 Magenta + /// 36 Cyan + /// 37 White + /// Background Colours + /// 40 Black + /// 41 Red + /// 42 Green + /// 43 Yellow + /// 44 Blue + /// 45 Magenta + /// 46 Cyan + /// 47 White + /// + public void Parse(string message) + { + int startIndex = -1; + int length = 0; + ConsoleColor? foreground = null; + ConsoleColor? background = null; + var span = message.AsSpan(); + const char EscapeChar = '\x1B'; + ConsoleColor? color = null; + bool isBright = false; + for (int i = 0; i < span.Length; i++) + { + if (span[i] == EscapeChar && span.Length >= i + 4 && span[i + 1] == '[') + { + if (span[i + 3] == 'm') + { +#if NETCOREAPP + if (ushort.TryParse(span.Slice(i + 2, length: 1), out ushort escapeCode)) +#else + if (ushort.TryParse(span.Slice(i + 2, length: 1).ToString(), out ushort escapeCode)) +#endif + { + if (startIndex != -1) + { + _onParseWrite(message, startIndex, length, background, foreground); + startIndex = -1; + length = 0; + } + if (escapeCode == 1) + isBright = true; + i += 3; + continue; + } + } + else if (span.Length >= i + 5 && span[i + 4] == 'm') + { +#if NETCOREAPP + if (ushort.TryParse(span.Slice(i + 2, length: 2), out ushort escapeCode)) +#else + if (ushort.TryParse(span.Slice(i + 2, length: 2).ToString(), out ushort escapeCode)) +#endif + { + if (startIndex != -1) + { + _onParseWrite(message, startIndex, length, background, foreground); + startIndex = -1; + length = 0; + } + if (TryGetForegroundColor(escapeCode, isBright, out color)) + { + foreground = color; + isBright = false; + } + else if (TryGetBackgroundColor(escapeCode, out color)) + { + background = color; + } + i += 4; + continue; + } + } + } + if (startIndex == -1) + { + startIndex = i; + } + int nextEscapeIndex = -1; + if (i < message.Length - 1) + { + nextEscapeIndex = message.IndexOf(EscapeChar, i + 1); + } + if (nextEscapeIndex < 0) + { + length = message.Length - startIndex; + break; + } + length = nextEscapeIndex - startIndex; + i = nextEscapeIndex - 1; + } + if (startIndex != -1) + { + _onParseWrite(message, startIndex, length, background, foreground); + } + } + + internal const string DefaultForegroundColor = "\x1B[39m\x1B[22m"; // reset to default foreground color + internal const string DefaultBackgroundColor = "\x1B[49m"; // reset to the background color + + internal static string GetForegroundColorEscapeCode(ConsoleColor color) + { + return color switch + { + ConsoleColor.Black => "\x1B[30m", + ConsoleColor.DarkRed => "\x1B[31m", + ConsoleColor.DarkGreen => "\x1B[32m", + ConsoleColor.DarkYellow => "\x1B[33m", + ConsoleColor.DarkBlue => "\x1B[34m", + ConsoleColor.DarkMagenta => "\x1B[35m", + ConsoleColor.DarkCyan => "\x1B[36m", + ConsoleColor.Gray => "\x1B[37m", + ConsoleColor.Red => "\x1B[1m\x1B[31m", + ConsoleColor.Green => "\x1B[1m\x1B[32m", + ConsoleColor.Yellow => "\x1B[1m\x1B[33m", + ConsoleColor.Blue => "\x1B[1m\x1B[34m", + ConsoleColor.Magenta => "\x1B[1m\x1B[35m", + ConsoleColor.Cyan => "\x1B[1m\x1B[36m", + ConsoleColor.White => "\x1B[1m\x1B[37m", + _ => DefaultForegroundColor // default foreground color + }; + } + + internal static string GetBackgroundColorEscapeCode(ConsoleColor color) + { + return color switch + { + ConsoleColor.Black => "\x1B[40m", + ConsoleColor.DarkRed => "\x1B[41m", + ConsoleColor.DarkGreen => "\x1B[42m", + ConsoleColor.DarkYellow => "\x1B[43m", + ConsoleColor.DarkBlue => "\x1B[44m", + ConsoleColor.DarkMagenta => "\x1B[45m", + ConsoleColor.DarkCyan => "\x1B[46m", + ConsoleColor.Gray => "\x1B[47m", + _ => DefaultBackgroundColor // Use default background color + }; + } + + private static bool TryGetForegroundColor(int number, bool isBright, out ConsoleColor? color) + { + color = number switch + { + 30 => ConsoleColor.Black, + 31 => isBright ? ConsoleColor.Red: ConsoleColor.DarkRed, + 32 => isBright ? ConsoleColor.Green: ConsoleColor.DarkGreen, + 33 => isBright ? ConsoleColor.Yellow: ConsoleColor.DarkYellow, + 34 => isBright ? ConsoleColor.Blue: ConsoleColor.DarkBlue, + 35 => isBright ? ConsoleColor.Magenta: ConsoleColor.DarkMagenta, + 36 => isBright ? ConsoleColor.Cyan: ConsoleColor.DarkCyan, + 37 => isBright ? ConsoleColor.White: ConsoleColor.Gray, + _ => null + }; + return color != null || number == 39; + } + + private static bool TryGetBackgroundColor(int number, out ConsoleColor? color) + { + color = number switch + { + 40 => ConsoleColor.Black, + 41 => ConsoleColor.DarkRed, + 42 => ConsoleColor.DarkGreen, + 43 => ConsoleColor.DarkYellow, + 44 => ConsoleColor.DarkBlue, + 45 => ConsoleColor.DarkMagenta, + 46 => ConsoleColor.DarkCyan, + 47 => ConsoleColor.Gray, + _ => null + }; + return color != null || number == 49; + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs new file mode 100644 index 000000000000..9f42ec630293 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs @@ -0,0 +1,71 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.IO; + +namespace Microsoft.Extensions.Logging.Console +{ + internal class AnsiParsingLogConsole : IConsole + { + private readonly TextWriter _textWriter; + private readonly AnsiParser _parser; + + public AnsiParsingLogConsole(bool stdErr = false) + { + _textWriter = stdErr ? System.Console.Error : System.Console.Out; + _parser = new AnsiParser(WriteToConsole); + } + + public void Write(string message) + { + _parser.Parse(message); + } + + private bool SetColor(ConsoleColor? background, ConsoleColor? foreground) + { + var backgroundChanged = SetBackgroundColor(background); + return SetForegroundColor(foreground) || backgroundChanged; + } + + private bool SetBackgroundColor(ConsoleColor? background) + { + if (background.HasValue) + { + System.Console.BackgroundColor = background.Value; + return true; + } + return false; + } + + private bool SetForegroundColor(ConsoleColor? foreground) + { + if (foreground.HasValue) + { + System.Console.ForegroundColor = foreground.Value; + return true; + } + return false; + } + + private void ResetColor() + { + System.Console.ResetColor(); + } + + private void WriteToConsole(string message, int startIndex, int length, ConsoleColor? background, ConsoleColor? foreground) + { + ReadOnlySpan span = message.AsSpan().Slice(startIndex, length); + var colorChanged = SetColor(background, foreground); +#if NETCOREAPP + _textWriter.Write(span); +#else + _textWriter.Write(span.ToString()); +#endif + if (colorChanged) + { + ResetColor(); + } + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiSystemConsole.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiSystemConsole.cs deleted file mode 100644 index a44af3e2bf1e..000000000000 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiSystemConsole.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.IO; - -namespace Microsoft.Extensions.Logging.Console -{ - internal class AnsiSystemConsole : IAnsiSystemConsole - { - private readonly TextWriter _textWriter; - - public AnsiSystemConsole(bool stdErr = false) - { - _textWriter = stdErr ? System.Console.Error : System.Console.Out; - } - - public void Write(string message) - { - _textWriter.Write(message); - } - } -} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatter.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatter.cs new file mode 100644 index 000000000000..716502fb33fa --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatter.cs @@ -0,0 +1,37 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.IO; +using Microsoft.Extensions.Logging.Abstractions; + +namespace Microsoft.Extensions.Logging.Console +{ + /// + /// Allows custom log messages formatting + /// + public abstract class ConsoleFormatter + { + protected ConsoleFormatter(string name) + { + Name = name ?? throw new ArgumentNullException(nameof(name)); + } + + /// + /// Gets the name associated with the console log formatter. + /// + public string Name { get; } + + /// + /// Writes the log message to the specified TextWriter. + /// + /// + /// if the formatter wants to write colors to the console, it can do so by embedding ANSI color codes into the string + /// + /// The log entry. + /// The provider of scope data. + /// The string writer embedding ansi code for colors. + /// The type of the object to be written. + public abstract void Write(in LogEntry logEntry, IExternalScopeProvider scopeProvider, TextWriter textWriter); + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatterNames.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatterNames.cs new file mode 100644 index 000000000000..f2c71c197177 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatterNames.cs @@ -0,0 +1,26 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Microsoft.Extensions.Logging.Console +{ + /// + /// Reserved formatter names for the built-in console formatters. + /// + public static class ConsoleFormatterNames + { + /// + /// Reserved name for simple console formatter + /// + public const string Simple = "simple"; + + /// + /// Reserved name for json console formatter + /// + public const string Json = "json"; + + /// + /// Reserved name for systemd console formatter + /// + public const string Systemd = "systemd"; + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatterOptions.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatterOptions.cs new file mode 100644 index 000000000000..7513ba874231 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatterOptions.cs @@ -0,0 +1,31 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Text; + +namespace Microsoft.Extensions.Logging.Console +{ + /// + /// Options for the built-in console log formatter. + /// + public class ConsoleFormatterOptions + { + public ConsoleFormatterOptions() { } + + /// + /// Includes scopes when . + /// + public bool IncludeScopes { get; set; } + + /// + /// Gets or sets format string used to format timestamp in logging messages. Defaults to null. + /// + public string TimestampFormat { get; set; } + + /// + /// Gets or sets indication whether or not UTC timezone should be used to for timestamps in logging messages. Defaults to false. + /// + public bool UseUtcTimestamp { get; set; } + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLogger.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLogger.cs index e790eeb1c053..1d544f322810 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLogger.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLogger.cs @@ -2,23 +2,16 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using System.Diagnostics; -using System.Text; +using System.IO; +using Microsoft.Extensions.Logging.Abstractions; namespace Microsoft.Extensions.Logging.Console { internal class ConsoleLogger : ILogger { - private const string LoglevelPadding = ": "; - private static readonly string _messagePadding = new string(' ', GetLogLevelString(LogLevel.Information).Length + LoglevelPadding.Length); - private static readonly string _newLineWithMessagePadding = Environment.NewLine + _messagePadding; - private readonly string _name; private readonly ConsoleLoggerProcessor _queueProcessor; - [ThreadStatic] - private static StringBuilder _logBuilder; - internal ConsoleLogger(string name, ConsoleLoggerProcessor loggerProcessor) { if (name == null) @@ -30,186 +23,40 @@ internal ConsoleLogger(string name, ConsoleLoggerProcessor loggerProcessor) _queueProcessor = loggerProcessor; } + internal ConsoleFormatter Formatter { get; set; } internal IExternalScopeProvider ScopeProvider { get; set; } internal ConsoleLoggerOptions Options { get; set; } + [ThreadStatic] + private static StringWriter t_stringWriter; + public void Log(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func formatter) { if (!IsEnabled(logLevel)) { return; } - if (formatter == null) { throw new ArgumentNullException(nameof(formatter)); } + t_stringWriter ??= new StringWriter(); + LogEntry logEntry = new LogEntry(logLevel, _name, eventId, state, exception, formatter); + Formatter.Write(in logEntry, ScopeProvider, t_stringWriter); - string message = formatter(state, exception); - - if (!string.IsNullOrEmpty(message) || exception != null) - { - WriteMessage(logLevel, _name, eventId.Id, message, exception); - } - } - - public virtual void WriteMessage(LogLevel logLevel, string logName, int eventId, string message, Exception exception) - { - ConsoleLoggerFormat format = Options.Format; - Debug.Assert(format >= ConsoleLoggerFormat.Default && format <= ConsoleLoggerFormat.Systemd); - - StringBuilder logBuilder = _logBuilder; - _logBuilder = null; - - if (logBuilder == null) - { - logBuilder = new StringBuilder(); - } - - LogMessageEntry entry; - if (format == ConsoleLoggerFormat.Default) - { - entry = CreateDefaultLogMessage(logBuilder, logLevel, logName, eventId, message, exception); - } - else if (format == ConsoleLoggerFormat.Systemd) - { - entry = CreateSystemdLogMessage(logBuilder, logLevel, logName, eventId, message, exception); - } - else - { - entry = default; - } - _queueProcessor.EnqueueMessage(entry); - - logBuilder.Clear(); - if (logBuilder.Capacity > 1024) - { - logBuilder.Capacity = 1024; - } - _logBuilder = logBuilder; - } - - private LogMessageEntry CreateDefaultLogMessage(StringBuilder logBuilder, LogLevel logLevel, string logName, int eventId, string message, Exception exception) - { - // Example: - // info: ConsoleApp.Program[10] - // Request received - - ConsoleColors logLevelColors = GetLogLevelConsoleColors(logLevel); - string logLevelString = GetLogLevelString(logLevel); - // category and event id - logBuilder.Append(LoglevelPadding); - logBuilder.Append(logName); - logBuilder.Append('['); - logBuilder.Append(eventId); - logBuilder.AppendLine("]"); - - // scope information - GetScopeInformation(logBuilder, multiLine: true); - - if (!string.IsNullOrEmpty(message)) - { - // message - logBuilder.Append(_messagePadding); - - int len = logBuilder.Length; - logBuilder.AppendLine(message); - logBuilder.Replace(Environment.NewLine, _newLineWithMessagePadding, len, message.Length); - } - - // Example: - // System.InvalidOperationException - // at Namespace.Class.Function() in File:line X - if (exception != null) - { - // exception message - logBuilder.AppendLine(exception.ToString()); - } - - string timestamp = null; - string timestampFormat = Options.TimestampFormat; - if (timestampFormat != null) - { - DateTime dateTime = GetCurrentDateTime(); - timestamp = dateTime.ToString(timestampFormat); - } - - return new LogMessageEntry( - message: logBuilder.ToString(), - timeStamp: timestamp, - levelString: logLevelString, - levelBackground: logLevelColors.Background, - levelForeground: logLevelColors.Foreground, - messageColor: null, - logAsError: logLevel >= Options.LogToStandardErrorThreshold - ); - } - - private LogMessageEntry CreateSystemdLogMessage(StringBuilder logBuilder, LogLevel logLevel, string logName, int eventId, string message, Exception exception) - { - // systemd reads messages from standard out line-by-line in a 'message' format. - // newline characters are treated as message delimiters, so we must replace them. - // Messages longer than the journal LineMax setting (default: 48KB) are cropped. - // Example: - // <6>ConsoleApp.Program[10] Request received - - // loglevel - string logLevelString = GetSyslogSeverityString(logLevel); - logBuilder.Append(logLevelString); - - // timestamp - string timestampFormat = Options.TimestampFormat; - if (timestampFormat != null) - { - DateTime dateTime = GetCurrentDateTime(); - logBuilder.Append(dateTime.ToString(timestampFormat)); - } - - // category and event id - logBuilder.Append(logName); - logBuilder.Append('['); - logBuilder.Append(eventId); - logBuilder.Append(']'); - - // scope information - GetScopeInformation(logBuilder, multiLine: false); - - // message - if (!string.IsNullOrEmpty(message)) + var sb = t_stringWriter.GetStringBuilder(); + if (sb.Length == 0) { - logBuilder.Append(' '); - // message - AppendAndReplaceNewLine(logBuilder, message); + return; } - - // exception - // System.InvalidOperationException at Namespace.Class.Function() in File:line X - if (exception != null) + string computedAnsiString = sb.ToString(); + sb.Clear(); + if (sb.Capacity > 1024) { - logBuilder.Append(' '); - AppendAndReplaceNewLine(logBuilder, exception.ToString()); + sb.Capacity = 1024; } - - // newline delimiter - logBuilder.Append(Environment.NewLine); - - return new LogMessageEntry( - message: logBuilder.ToString(), - logAsError: logLevel >= Options.LogToStandardErrorThreshold - ); - - static void AppendAndReplaceNewLine(StringBuilder sb, string message) - { - int len = sb.Length; - sb.Append(message); - sb.Replace(Environment.NewLine, " ", len, message.Length); - } - } - - private DateTime GetCurrentDateTime() - { - return Options.UseUtcTimestamp ? DateTime.UtcNow : DateTime.Now; + _queueProcessor.EnqueueMessage(new LogMessageEntry(computedAnsiString, logAsError: logLevel >= Options.LogToStandardErrorThreshold)); } public bool IsEnabled(LogLevel logLevel) @@ -218,116 +65,5 @@ public bool IsEnabled(LogLevel logLevel) } public IDisposable BeginScope(TState state) => ScopeProvider?.Push(state) ?? NullScope.Instance; - - private static string GetLogLevelString(LogLevel logLevel) - { - switch (logLevel) - { - case LogLevel.Trace: - return "trce"; - case LogLevel.Debug: - return "dbug"; - case LogLevel.Information: - return "info"; - case LogLevel.Warning: - return "warn"; - case LogLevel.Error: - return "fail"; - case LogLevel.Critical: - return "crit"; - default: - throw new ArgumentOutOfRangeException(nameof(logLevel)); - } - } - - private static string GetSyslogSeverityString(LogLevel logLevel) - { - // 'Syslog Message Severities' from https://tools.ietf.org/html/rfc5424. - switch (logLevel) - { - case LogLevel.Trace: - case LogLevel.Debug: - return "<7>"; // debug-level messages - case LogLevel.Information: - return "<6>"; // informational messages - case LogLevel.Warning: - return "<4>"; // warning conditions - case LogLevel.Error: - return "<3>"; // error conditions - case LogLevel.Critical: - return "<2>"; // critical conditions - default: - throw new ArgumentOutOfRangeException(nameof(logLevel)); - } - } - - private ConsoleColors GetLogLevelConsoleColors(LogLevel logLevel) - { - if (!Options.DisableColors) - { - // We must explicitly set the background color if we are setting the foreground color, - // since just setting one can look bad on the users console. - switch (logLevel) - { - case LogLevel.Critical: - return new ConsoleColors(ConsoleColor.White, ConsoleColor.Red); - case LogLevel.Error: - return new ConsoleColors(ConsoleColor.Black, ConsoleColor.Red); - case LogLevel.Warning: - return new ConsoleColors(ConsoleColor.Yellow, ConsoleColor.Black); - case LogLevel.Information: - return new ConsoleColors(ConsoleColor.DarkGreen, ConsoleColor.Black); - case LogLevel.Debug: - return new ConsoleColors(ConsoleColor.Gray, ConsoleColor.Black); - case LogLevel.Trace: - return new ConsoleColors(ConsoleColor.Gray, ConsoleColor.Black); - } - } - - return new ConsoleColors(null, null); - } - - private void GetScopeInformation(StringBuilder stringBuilder, bool multiLine) - { - IExternalScopeProvider scopeProvider = ScopeProvider; - if (Options.IncludeScopes && scopeProvider != null) - { - int initialLength = stringBuilder.Length; - - scopeProvider.ForEachScope((scope, state) => - { - (StringBuilder builder, int paddAt) = state; - bool padd = paddAt == builder.Length; - if (padd) - { - builder.Append(_messagePadding); - builder.Append("=> "); - } - else - { - builder.Append(" => "); - } - builder.Append(scope); - }, (stringBuilder, multiLine ? initialLength : -1)); - - if (stringBuilder.Length > initialLength && multiLine) - { - stringBuilder.AppendLine(); - } - } - } - - private readonly struct ConsoleColors - { - public ConsoleColors(ConsoleColor? foreground, ConsoleColor? background) - { - Foreground = foreground; - Background = background; - } - - public ConsoleColor? Foreground { get; } - - public ConsoleColor? Background { get; } - } } } diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerFactoryExtensions.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerFactoryExtensions.cs index ea764972e329..9dbea88f9b25 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerFactoryExtensions.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerFactoryExtensions.cs @@ -2,10 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Logging.Configuration; using Microsoft.Extensions.Logging.Console; +using Microsoft.Extensions.Options; namespace Microsoft.Extensions.Logging { @@ -19,8 +21,13 @@ public static ILoggingBuilder AddConsole(this ILoggingBuilder builder) { builder.AddConfiguration(); + builder.AddConsoleFormatter(); + builder.AddConsoleFormatter(); + builder.AddConsoleFormatter(); + builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton()); LoggerProviderOptions.RegisterProviderOptions(builder.Services); + return builder; } @@ -41,5 +48,104 @@ public static ILoggingBuilder AddConsole(this ILoggingBuilder builder, Action + /// Add and configure a console log formatter named 'simple' to the factory. + /// + /// The to use. + /// A delegate to configure the options for the built-in default log formatter. + public static ILoggingBuilder AddSimpleConsole(this ILoggingBuilder builder, Action configure) + { + return builder.AddConsoleWithFormatter(ConsoleFormatterNames.Simple, configure); + } + + /// + /// Add and configure a console log formatter named 'json' to the factory. + /// + /// The to use. + /// A delegate to configure the options for the built-in json log formatter. + public static ILoggingBuilder AddJsonConsole(this ILoggingBuilder builder, Action configure) + { + return builder.AddConsoleWithFormatter(ConsoleFormatterNames.Json, configure); + } + + /// + /// Add and configure a console log formatter named 'systemd' to the factory. + /// + /// The to use. + /// A delegate to configure the options for the built-in systemd log formatter. + public static ILoggingBuilder AddSystemdConsole(this ILoggingBuilder builder, Action configure) + { + return builder.AddConsoleWithFormatter(ConsoleFormatterNames.Systemd, configure); + } + + internal static ILoggingBuilder AddConsoleWithFormatter(this ILoggingBuilder builder, string name, Action configure) + where TOptions : ConsoleFormatterOptions + { + if (configure == null) + { + throw new ArgumentNullException(nameof(configure)); + } + builder.AddConsole((ConsoleLoggerOptions options) => options.FormatterName = name); + builder.Services.Configure(configure); + + return builder; + } + + /// + /// Adds a custom console logger formatter 'TFormatter' to be configured with options 'TOptions'. + /// + /// The to use. + public static ILoggingBuilder AddConsoleFormatter(this ILoggingBuilder builder) + where TOptions : ConsoleFormatterOptions + where TFormatter : ConsoleFormatter + { + builder.AddConfiguration(); + + builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton()); + builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton, ConsoleLoggerFormatterConfigureOptions>()); + builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton, ConsoleLoggerFormatterOptionsChangeTokenSource>()); + + return builder; + } + + /// + /// Adds a custom console logger formatter 'TFormatter' to be configured with options 'TOptions'. + /// + /// The to use. + /// A delegate to configure options 'TOptions' for custom formatter 'TFormatter'. + public static ILoggingBuilder AddConsoleFormatter(this ILoggingBuilder builder, Action configure) + where TOptions : ConsoleFormatterOptions + where TFormatter : ConsoleFormatter + { + if (configure == null) + { + throw new ArgumentNullException(nameof(configure)); + } + + builder.AddConsoleFormatter(); + builder.Services.Configure(configure); + return builder; + } + } + + internal class ConsoleLoggerFormatterConfigureOptions : ConfigureFromConfigurationOptions + where TOptions : ConsoleFormatterOptions + where TFormatter : ConsoleFormatter + { + public ConsoleLoggerFormatterConfigureOptions(ILoggerProviderConfiguration providerConfiguration) : + base(providerConfiguration.Configuration.GetSection("FormatterOptions")) + { + } + } + + internal class ConsoleLoggerFormatterOptionsChangeTokenSource : ConfigurationChangeTokenSource + where TOptions : ConsoleFormatterOptions + where TFormatter : ConsoleFormatter + { + public ConsoleLoggerFormatterOptionsChangeTokenSource(ILoggerProviderConfiguration providerConfiguration) + : base(providerConfiguration.Configuration.GetSection("FormatterOptions")) + { + } } } diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerFormat.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerFormat.cs index 818b56c3cdbb..d5baee2d57c6 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerFormat.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerFormat.cs @@ -6,6 +6,7 @@ namespace Microsoft.Extensions.Logging.Console /// /// Format of messages. /// + [System.ObsoleteAttribute("ConsoleLoggerFormat has been deprecated.", false)] public enum ConsoleLoggerFormat { /// diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerOptions.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerOptions.cs index 6b675398f3b1..cda6f89e52c1 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerOptions.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerOptions.cs @@ -10,21 +10,18 @@ namespace Microsoft.Extensions.Logging.Console /// public class ConsoleLoggerOptions { - private ConsoleLoggerFormat _format = ConsoleLoggerFormat.Default; - - /// - /// Includes scopes when . - /// - public bool IncludeScopes { get; set; } - /// /// Disables colors when . /// + [System.ObsoleteAttribute("ConsoleLoggerOptions.DisableColors has been deprecated. Please use SimpleConsoleFormatterOptions.DisableColors instead.", false)] public bool DisableColors { get; set; } +#pragma warning disable CS0618 + private ConsoleLoggerFormat _format = ConsoleLoggerFormat.Default; /// /// Gets or sets log message format. Defaults to . /// + [System.ObsoleteAttribute("ConsoleLoggerOptions.Format has been deprecated. Please use ConsoleLoggerOptions.FormatterName instead.", false)] public ConsoleLoggerFormat Format { get => _format; @@ -36,8 +33,20 @@ public ConsoleLoggerFormat Format } _format = value; } +#pragma warning restore CS0618 } + /// + /// Name of the log message formatter to use. Defaults to "simple" />. + /// + public string FormatterName { get; set; } + + /// + /// Includes scopes when . + /// + [System.ObsoleteAttribute("ConsoleLoggerOptions.IncludeScopes has been deprecated. Please use ConsoleFormatterOptions.IncludeScopes instead.", false)] + public bool IncludeScopes { get; set; } + /// /// Gets or sets value indicating the minimum level of messages that would get written to Console.Error. /// @@ -46,11 +55,13 @@ public ConsoleLoggerFormat Format /// /// Gets or sets format string used to format timestamp in logging messages. Defaults to null. /// + [System.ObsoleteAttribute("ConsoleLoggerOptions.TimestampFormat has been deprecated. Please use ConsoleFormatterOptions.TimestampFormat instead.", false)] public string TimestampFormat { get; set; } /// /// Gets or sets indication whether or not UTC timezone should be used to for timestamps in logging messages. Defaults to false. /// + [System.ObsoleteAttribute("ConsoleLoggerOptions.UseUtcTimestamp has been deprecated. Please use ConsoleFormatterOptions.UseUtcTimestamp instead.", false)] public bool UseUtcTimestamp { get; set; } } -} +} \ No newline at end of file diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProcessor.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProcessor.cs index 4c5109a86819..83a49c20d4c8 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProcessor.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProcessor.cs @@ -49,22 +49,10 @@ public virtual void EnqueueMessage(LogMessageEntry message) } // for testing - internal virtual void WriteMessage(LogMessageEntry message) + internal virtual void WriteMessage(LogMessageEntry entry) { - IConsole console = message.LogAsError ? ErrorConsole : Console; - - if (message.TimeStamp != null) - { - console.Write(message.TimeStamp, message.MessageColor, message.MessageColor); - } - - if (message.LevelString != null) - { - console.Write(message.LevelString, message.LevelBackground, message.LevelForeground); - } - - console.Write(message.Message, message.MessageColor, message.MessageColor); - console.Flush(); + IConsole console = entry.LogAsError ? ErrorConsole : Console; + console.Write(entry.Message); } private void ProcessLogQueue() diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProvider.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProvider.cs index 2a9d02b3bc72..4c5c596a4467 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProvider.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProvider.cs @@ -3,6 +3,8 @@ using System; using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; using System.Runtime.InteropServices; using Microsoft.Extensions.Options; @@ -16,6 +18,7 @@ public class ConsoleLoggerProvider : ILoggerProvider, ISupportExternalScope { private readonly IOptionsMonitor _options; private readonly ConcurrentDictionary _loggers; + private ConcurrentDictionary _formatters; private readonly ConsoleLoggerProcessor _messageQueue; private IDisposable _optionsReloadToken; @@ -26,43 +29,148 @@ public class ConsoleLoggerProvider : ILoggerProvider, ISupportExternalScope /// /// The options to create instances with. public ConsoleLoggerProvider(IOptionsMonitor options) + : this(options, Enumerable.Empty()) { } + + /// + /// Creates an instance of . + /// + /// The options to create instances with. + /// Log formatters added for insteaces. + public ConsoleLoggerProvider(IOptionsMonitor options, IEnumerable formatters) { _options = options; _loggers = new ConcurrentDictionary(); + SetFormatters(formatters); ReloadLoggerOptions(options.CurrentValue); _optionsReloadToken = _options.OnChange(ReloadLoggerOptions); _messageQueue = new ConsoleLoggerProcessor(); - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + if (DoesConsoleSupportAnsi()) + { + _messageQueue.Console = new AnsiLogConsole(); + _messageQueue.ErrorConsole = new AnsiLogConsole(stdErr: true); + } + else + { + _messageQueue.Console = new AnsiParsingLogConsole(); + _messageQueue.ErrorConsole = new AnsiParsingLogConsole(stdErr: true); + } + } + + private static bool DoesConsoleSupportAnsi() + { + if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + return true; + } + // for Windows, check the console mode + var stdOutHandle = Interop.Kernel32.GetStdHandle(Interop.Kernel32.STD_OUTPUT_HANDLE); + if (!Interop.Kernel32.GetConsoleMode(stdOutHandle, out int consoleMode)) + { + return false; + } + + return (consoleMode & Interop.Kernel32.ENABLE_VIRTUAL_TERMINAL_PROCESSING) == Interop.Kernel32.ENABLE_VIRTUAL_TERMINAL_PROCESSING; + } + + private void SetFormatters(IEnumerable formatters = null) + { + _formatters = new ConcurrentDictionary(StringComparer.OrdinalIgnoreCase); + if (formatters == null || !formatters.Any()) { - _messageQueue.Console = new WindowsLogConsole(); - _messageQueue.ErrorConsole = new WindowsLogConsole(stdErr: true); + var defaultMonitor = new FormatterOptionsMonitor(new SimpleConsoleFormatterOptions()); + var systemdMonitor = new FormatterOptionsMonitor(new ConsoleFormatterOptions()); + var jsonMonitor = new FormatterOptionsMonitor(new JsonConsoleFormatterOptions()); + _formatters.GetOrAdd(ConsoleFormatterNames.Simple, formatterName => new SimpleConsoleFormatter(defaultMonitor)); + _formatters.GetOrAdd(ConsoleFormatterNames.Systemd, formatterName => new SystemdConsoleFormatter(systemdMonitor)); + _formatters.GetOrAdd(ConsoleFormatterNames.Json, formatterName => new JsonConsoleFormatter(jsonMonitor)); } else { - _messageQueue.Console = new AnsiLogConsole(new AnsiSystemConsole()); - _messageQueue.ErrorConsole = new AnsiLogConsole(new AnsiSystemConsole(stdErr: true)); + foreach (ConsoleFormatter formatter in formatters) + { + _formatters.GetOrAdd(formatter.Name, formatterName => formatter); + } } } + // warning: ReloadLoggerOptions can be called before the ctor completed,... before registering all of the state used in this method need to be initialized private void ReloadLoggerOptions(ConsoleLoggerOptions options) { - foreach (System.Collections.Generic.KeyValuePair logger in _loggers) + if (options.FormatterName == null || !_formatters.TryGetValue(options.FormatterName, out ConsoleFormatter logFormatter)) + { +#pragma warning disable CS0618 + logFormatter = options.Format switch + { + ConsoleLoggerFormat.Systemd => _formatters[ConsoleFormatterNames.Systemd], + _ => _formatters[ConsoleFormatterNames.Simple], + }; + if (options.FormatterName == null) + { + UpdateFormatterOptions(logFormatter, options); + } +#pragma warning restore CS0618 + } + + foreach (KeyValuePair logger in _loggers) { logger.Value.Options = options; + logger.Value.Formatter = logFormatter; } } /// public ILogger CreateLogger(string name) { + if (_options.CurrentValue.FormatterName == null || !_formatters.TryGetValue(_options.CurrentValue.FormatterName, out ConsoleFormatter logFormatter)) + { +#pragma warning disable CS0618 + logFormatter = _options.CurrentValue.Format switch + { + ConsoleLoggerFormat.Systemd => _formatters[ConsoleFormatterNames.Systemd], + _ => _formatters[ConsoleFormatterNames.Simple], + }; + if (_options.CurrentValue.FormatterName == null) + { + UpdateFormatterOptions(logFormatter, _options.CurrentValue); + } +#pragma warning disable CS0618 + } + return _loggers.GetOrAdd(name, loggerName => new ConsoleLogger(name, _messageQueue) { Options = _options.CurrentValue, - ScopeProvider = _scopeProvider + ScopeProvider = _scopeProvider, + Formatter = logFormatter, }); } +#pragma warning disable CS0618 + private void UpdateFormatterOptions(ConsoleFormatter formatter, ConsoleLoggerOptions deprecatedFromOptions) + { + // kept for deprecated apis: + if (formatter is SimpleConsoleFormatter defaultFormatter) + { + defaultFormatter.FormatterOptions = new SimpleConsoleFormatterOptions() + { + DisableColors = deprecatedFromOptions.DisableColors, + IncludeScopes = deprecatedFromOptions.IncludeScopes, + TimestampFormat = deprecatedFromOptions.TimestampFormat, + UseUtcTimestamp = deprecatedFromOptions.UseUtcTimestamp, + }; + } + else + if (formatter is SystemdConsoleFormatter systemdFormatter) + { + systemdFormatter.FormatterOptions = new ConsoleFormatterOptions() + { + IncludeScopes = deprecatedFromOptions.IncludeScopes, + TimestampFormat = deprecatedFromOptions.TimestampFormat, + UseUtcTimestamp = deprecatedFromOptions.UseUtcTimestamp, + }; + } + } +#pragma warning restore CS0618 /// public void Dispose() @@ -80,7 +188,6 @@ public void SetScopeProvider(IExternalScopeProvider scopeProvider) { logger.Value.ScopeProvider = _scopeProvider; } - } } } diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/FormatterOptionsMonitor.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/FormatterOptionsMonitor.cs new file mode 100644 index 000000000000..d29376cb9b84 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/FormatterOptionsMonitor.cs @@ -0,0 +1,26 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using Microsoft.Extensions.Options; + +namespace Microsoft.Extensions.Logging.Console +{ + internal class FormatterOptionsMonitor : IOptionsMonitor where TOptions : ConsoleFormatterOptions + { + private TOptions _options; + public FormatterOptionsMonitor(TOptions options) + { + _options = options; + } + + public TOptions Get(string name) => _options; + + public IDisposable OnChange(Action listener) + { + return null; + } + + public TOptions CurrentValue => _options; + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/IAnsiSystemConsole.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/IAnsiSystemConsole.cs deleted file mode 100644 index d2f2d040dbcd..000000000000 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/IAnsiSystemConsole.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace Microsoft.Extensions.Logging.Console -{ - internal interface IAnsiSystemConsole - { - void Write(string message); - } -} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/IConsole.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/IConsole.cs index b1a4ae5de4c8..5285cc7ea5b9 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/IConsole.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/IConsole.cs @@ -1,14 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; - namespace Microsoft.Extensions.Logging.Console { internal interface IConsole { - void Write(string message, ConsoleColor? background, ConsoleColor? foreground); - void WriteLine(string message, ConsoleColor? background, ConsoleColor? foreground); - void Flush(); + void Write(string message); } } diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs new file mode 100644 index 000000000000..68aa95a92504 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs @@ -0,0 +1,150 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.Json; +using Microsoft.Extensions.Logging.Abstractions; +using Microsoft.Extensions.Options; + +namespace Microsoft.Extensions.Logging.Console +{ + internal class JsonConsoleFormatter : ConsoleFormatter, IDisposable + { + private IDisposable _optionsReloadToken; + + public JsonConsoleFormatter(IOptionsMonitor options) + : base (ConsoleFormatterNames.Json) + { + ReloadLoggerOptions(options.CurrentValue); + _optionsReloadToken = options.OnChange(ReloadLoggerOptions); + } + + public override void Write(in LogEntry logEntry, IExternalScopeProvider scopeProvider, TextWriter textWriter) + { + string message = logEntry.Formatter(logEntry.State, logEntry.Exception); + if (logEntry.Exception == null && message == null) + { + return; + } + LogLevel logLevel = logEntry.LogLevel; + string category = logEntry.Category; + int eventId = logEntry.EventId.Id; + Exception exception = logEntry.Exception; + const int DefaultBufferSize = 1024; + using (var output = new PooledByteBufferWriter(DefaultBufferSize)) + { + using (var writer = new Utf8JsonWriter(output, FormatterOptions.JsonWriterOptions)) + { + writer.WriteStartObject(); + string timestamp = null; + var timestampFormat = FormatterOptions.TimestampFormat; + if (timestampFormat != null) + { + var dateTime = FormatterOptions.UseUtcTimestamp ? DateTime.UtcNow : DateTime.Now; + timestamp = dateTime.ToString(timestampFormat); + } + writer.WriteString("Timestamp", timestamp); + writer.WriteNumber(nameof(logEntry.EventId), eventId); + writer.WriteString(nameof(logEntry.LogLevel), GetLogLevelString(logLevel)); + writer.WriteString(nameof(logEntry.Category), category); + writer.WriteString("Message", message); + + if (exception != null) + { + writer.WriteStartObject(nameof(Exception)); + writer.WriteString(nameof(exception.Message), exception.Message.ToString()); + writer.WriteString("Type", exception.GetType().ToString()); + writer.WriteStartArray(nameof(exception.StackTrace)); + string stackTrace = exception?.StackTrace; + if (stackTrace != null) + { +#if NETCOREAPP + foreach (var stackTraceLines in stackTrace?.Split(Environment.NewLine)) +#else + foreach (var stackTraceLines in stackTrace?.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)) +#endif + { + writer.WriteStringValue(stackTraceLines); + } + } + writer.WriteEndArray(); + writer.WriteNumber(nameof(exception.HResult), exception.HResult); + writer.WriteEndObject(); + } + + if (logEntry.State is IReadOnlyCollection> stateDictionary) + { + foreach (KeyValuePair item in stateDictionary) + { + writer.WriteString(item.Key, Convert.ToString(item.Value, CultureInfo.InvariantCulture)); + } + } + WriteScopeInformation(writer, scopeProvider); + writer.WriteEndObject(); + writer.Flush(); + } +#if NETCOREAPP + textWriter.Write(Encoding.UTF8.GetString(output.WrittenMemory.Span)); +#else + textWriter.Write(Encoding.UTF8.GetString(output.WrittenMemory.Span.ToArray())); +#endif + } + textWriter.Write(Environment.NewLine); + } + + private static string GetLogLevelString(LogLevel logLevel) + { + return logLevel switch + { + LogLevel.Trace => "Trace", + LogLevel.Debug => "Debug", + LogLevel.Information => "Information", + LogLevel.Warning => "Warning", + LogLevel.Error => "Error", + LogLevel.Critical => "Critical", + _ => throw new ArgumentOutOfRangeException(nameof(logLevel)) + }; + } + + private void WriteScopeInformation(Utf8JsonWriter writer, IExternalScopeProvider scopeProvider) + { + if (FormatterOptions.IncludeScopes && scopeProvider != null) + { + int numScopes = 0; + writer.WriteStartObject("Scopes"); + scopeProvider.ForEachScope((scope, state) => + { + if (scope is IReadOnlyCollection> scopeDictionary) + { + foreach (KeyValuePair item in scopeDictionary) + { + state.WriteString(item.Key, Convert.ToString(item.Value, CultureInfo.InvariantCulture)); + } + } + else + { + state.WriteString(numScopes++.ToString(), scope.ToString()); + } + }, writer); + writer.WriteEndObject(); + } + } + + internal JsonConsoleFormatterOptions FormatterOptions { get; set; } + + private void ReloadLoggerOptions(JsonConsoleFormatterOptions options) + { + FormatterOptions = options; + } + + public void Dispose() + { + _optionsReloadToken?.Dispose(); + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatterOptions.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatterOptions.cs new file mode 100644 index 000000000000..3603cc97e8a5 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatterOptions.cs @@ -0,0 +1,20 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Text.Json; + +namespace Microsoft.Extensions.Logging.Console +{ + /// + /// Options for the built-in json console log formatter. + /// + public class JsonConsoleFormatterOptions : ConsoleFormatterOptions + { + public JsonConsoleFormatterOptions() { } + + /// + /// Gets or sets JsonWriterOptions. + /// + public JsonWriterOptions JsonWriterOptions { get; set; } + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/LogMessageEntry.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/LogMessageEntry.cs index 6297b01c5b9d..e070ee946d59 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/LogMessageEntry.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/LogMessageEntry.cs @@ -1,28 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; - namespace Microsoft.Extensions.Logging.Console { internal readonly struct LogMessageEntry { - public LogMessageEntry(string message, string timeStamp = null, string levelString = null, ConsoleColor? levelBackground = null, ConsoleColor? levelForeground = null, ConsoleColor? messageColor = null, bool logAsError = false) + public LogMessageEntry(string message, bool logAsError = false) { - TimeStamp = timeStamp; - LevelString = levelString; - LevelBackground = levelBackground; - LevelForeground = levelForeground; - MessageColor = messageColor; Message = message; LogAsError = logAsError; } - public readonly string TimeStamp; - public readonly string LevelString; - public readonly ConsoleColor? LevelBackground; - public readonly ConsoleColor? LevelForeground; - public readonly ConsoleColor? MessageColor; public readonly string Message; public readonly bool LogAsError; } diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/Microsoft.Extensions.Logging.Console.csproj b/src/libraries/Microsoft.Extensions.Logging.Console/src/Microsoft.Extensions.Logging.Console.csproj index 0096f0711660..3afd1b9ed232 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/Microsoft.Extensions.Logging.Console.csproj +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/Microsoft.Extensions.Logging.Console.csproj @@ -1,8 +1,15 @@ - $(NetCoreAppCurrent);netstandard2.0 + $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent) + true true + annotations + $(DefineConstants);NO_SUPPRESS_GC_TRANSITION + + + + $(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.6.1\1.0.1\lib\net461\;$(AssemblySearchPaths) @@ -18,14 +25,47 @@ Link="Common\src\Extensions\Logging\NullExternalScopeProvider.cs" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/Properties/InternalsVisibleTo.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/Properties/InternalsVisibleTo.cs index c9d3b5185197..401c4ac78875 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/Properties/InternalsVisibleTo.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/Properties/InternalsVisibleTo.cs @@ -3,4 +3,4 @@ using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("Microsoft.Extensions.Logging.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("Microsoft.Extensions.Logging.Console.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/Resources/Strings.resx b/src/libraries/Microsoft.Extensions.Logging.Console/src/Resources/Strings.resx new file mode 100644 index 000000000000..5ef4b889b114 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/Resources/Strings.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cannot allocate a buffer of size {0}. + + \ No newline at end of file diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/SimpleConsoleFormatter.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/SimpleConsoleFormatter.cs new file mode 100644 index 000000000000..e92aa0c27840 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/SimpleConsoleFormatter.cs @@ -0,0 +1,210 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.IO; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using Microsoft.Extensions.Logging.Abstractions; +using Microsoft.Extensions.Options; + +namespace Microsoft.Extensions.Logging.Console +{ + internal class SimpleConsoleFormatter : ConsoleFormatter, IDisposable + { + private const string LoglevelPadding = ": "; + private static readonly string _messagePadding = new string(' ', GetLogLevelString(LogLevel.Information).Length + LoglevelPadding.Length); + private static readonly string _newLineWithMessagePadding = Environment.NewLine + _messagePadding; + private IDisposable _optionsReloadToken; + + public SimpleConsoleFormatter(IOptionsMonitor options) + : base (ConsoleFormatterNames.Simple) + { + ReloadLoggerOptions(options.CurrentValue); + _optionsReloadToken = options.OnChange(ReloadLoggerOptions); + } + + private void ReloadLoggerOptions(SimpleConsoleFormatterOptions options) + { + FormatterOptions = options; + } + + public void Dispose() + { + _optionsReloadToken?.Dispose(); + } + + internal SimpleConsoleFormatterOptions FormatterOptions { get; set; } + + public override void Write(in LogEntry logEntry, IExternalScopeProvider scopeProvider, TextWriter textWriter) + { + string message = logEntry.Formatter(logEntry.State, logEntry.Exception); + if (logEntry.Exception == null && message == null) + { + return; + } + LogLevel logLevel = logEntry.LogLevel; + ConsoleColors logLevelColors = GetLogLevelConsoleColors(logLevel); + string logLevelString = GetLogLevelString(logLevel); + + string timestamp = null; + string timestampFormat = FormatterOptions.TimestampFormat; + if (timestampFormat != null) + { + DateTime dateTime = GetCurrentDateTime(); + timestamp = dateTime.ToString(timestampFormat); + } + if (timestamp != null) + { + textWriter.Write(timestamp); + } + if (logLevelString != null) + { + textWriter.WriteColoredMessage(logLevelString, logLevelColors.Background, logLevelColors.Foreground); + } + CreateDefaultLogMessage(textWriter, logEntry, message, scopeProvider); + } + + private void CreateDefaultLogMessage(TextWriter textWriter, in LogEntry logEntry, string message, IExternalScopeProvider scopeProvider) + { + bool singleLine = FormatterOptions.SingleLine; + int eventId = logEntry.EventId.Id; + Exception exception = logEntry.Exception; + + // Example: + // info: ConsoleApp.Program[10] + // Request received + + // category and event id + textWriter.Write(LoglevelPadding + logEntry.Category + '[' + eventId + "]"); + if (!singleLine) + { + textWriter.Write(Environment.NewLine); + } + + // scope information + WriteScopeInformation(textWriter, scopeProvider, singleLine); + if (singleLine) + { + textWriter.Write(' '); + } + WriteMessage(textWriter, message, singleLine); + + // Example: + // System.InvalidOperationException + // at Namespace.Class.Function() in File:line X + if (exception != null) + { + // exception message + WriteMessage(textWriter, exception.ToString(), singleLine); + } + if (singleLine) + { + textWriter.Write(Environment.NewLine); + } + } + + private void WriteMessage(TextWriter textWriter, string message, bool singleLine) + { + if (!string.IsNullOrEmpty(message)) + { + if (singleLine) + { + WriteReplacing(textWriter, Environment.NewLine, " ", message); + } + else + { + textWriter.Write(_messagePadding); + WriteReplacing(textWriter, Environment.NewLine, _newLineWithMessagePadding, message); + textWriter.Write(Environment.NewLine); + } + } + + static void WriteReplacing(TextWriter writer, string oldValue, string newValue, string message) + { + string newMessage = message.Replace(oldValue, newValue); + writer.Write(newMessage); + } + } + + private DateTime GetCurrentDateTime() + { + return FormatterOptions.UseUtcTimestamp ? DateTime.UtcNow : DateTime.Now; + } + + private static string GetLogLevelString(LogLevel logLevel) + { + return logLevel switch + { + LogLevel.Trace => "trce", + LogLevel.Debug => "dbug", + LogLevel.Information => "info", + LogLevel.Warning => "warn", + LogLevel.Error => "fail", + LogLevel.Critical => "crit", + _ => throw new ArgumentOutOfRangeException(nameof(logLevel)) + }; + } + + private ConsoleColors GetLogLevelConsoleColors(LogLevel logLevel) + { + if (FormatterOptions.DisableColors) + { + return new ConsoleColors(null, null); + } + // We must explicitly set the background color if we are setting the foreground color, + // since just setting one can look bad on the users console. + return logLevel switch + { + LogLevel.Trace => new ConsoleColors(ConsoleColor.Gray, ConsoleColor.Black), + LogLevel.Debug => new ConsoleColors(ConsoleColor.Gray, ConsoleColor.Black), + LogLevel.Information => new ConsoleColors(ConsoleColor.DarkGreen, ConsoleColor.Black), + LogLevel.Warning => new ConsoleColors(ConsoleColor.Yellow, ConsoleColor.Black), + LogLevel.Error => new ConsoleColors(ConsoleColor.Black, ConsoleColor.DarkRed), + LogLevel.Critical => new ConsoleColors(ConsoleColor.White, ConsoleColor.DarkRed), + _ => new ConsoleColors(null, null) + }; + } + + private void WriteScopeInformation(TextWriter textWriter, IExternalScopeProvider scopeProvider, bool singleLine) + { + if (FormatterOptions.IncludeScopes && scopeProvider != null) + { + bool paddingNeeded = !singleLine; + scopeProvider.ForEachScope((scope, state) => + { + if (paddingNeeded) + { + paddingNeeded = false; + state.Write(_messagePadding + "=> "); + } + else + { + state.Write(" => "); + } + state.Write(scope); + }, textWriter); + + if (!paddingNeeded && !singleLine) + { + textWriter.Write(Environment.NewLine); + } + } + } + + private readonly struct ConsoleColors + { + public ConsoleColors(ConsoleColor? foreground, ConsoleColor? background) + { + Foreground = foreground; + Background = background; + } + + public ConsoleColor? Foreground { get; } + + public ConsoleColor? Background { get; } + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/SimpleConsoleFormatterOptions.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/SimpleConsoleFormatterOptions.cs new file mode 100644 index 000000000000..9ee51c149389 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/SimpleConsoleFormatterOptions.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Microsoft.Extensions.Logging.Console +{ + /// + /// Options for the built-in default console log formatter. + /// + public class SimpleConsoleFormatterOptions : ConsoleFormatterOptions + { + public SimpleConsoleFormatterOptions() { } + + /// + /// Disables colors when . + /// + public bool DisableColors { get; set; } + + /// + /// When , the entire message gets logged in a single line. + /// + public bool SingleLine { get; set; } + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/SystemdConsoleFormatter.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/SystemdConsoleFormatter.cs new file mode 100644 index 000000000000..0140adf51356 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/SystemdConsoleFormatter.cs @@ -0,0 +1,131 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.IO; +using System.Text; +using Microsoft.Extensions.Logging.Abstractions; +using Microsoft.Extensions.Options; + +namespace Microsoft.Extensions.Logging.Console +{ + internal class SystemdConsoleFormatter : ConsoleFormatter, IDisposable + { + private IDisposable _optionsReloadToken; + + public SystemdConsoleFormatter(IOptionsMonitor options) + : base(ConsoleFormatterNames.Systemd) + { + ReloadLoggerOptions(options.CurrentValue); + _optionsReloadToken = options.OnChange(ReloadLoggerOptions); + } + + private void ReloadLoggerOptions(ConsoleFormatterOptions options) + { + FormatterOptions = options; + } + + public void Dispose() + { + _optionsReloadToken?.Dispose(); + } + + internal ConsoleFormatterOptions FormatterOptions { get; set; } + + public override void Write(in LogEntry logEntry, IExternalScopeProvider scopeProvider, TextWriter textWriter) + { + string message = logEntry.Formatter(logEntry.State, logEntry.Exception); + if (logEntry.Exception == null && message == null) + { + return; + } + LogLevel logLevel = logEntry.LogLevel; + string category = logEntry.Category; + int eventId = logEntry.EventId.Id; + Exception exception = logEntry.Exception; + // systemd reads messages from standard out line-by-line in a 'message' format. + // newline characters are treated as message delimiters, so we must replace them. + // Messages longer than the journal LineMax setting (default: 48KB) are cropped. + // Example: + // <6>ConsoleApp.Program[10] Request received + + // loglevel + string logLevelString = GetSyslogSeverityString(logLevel); + textWriter.Write(logLevelString); + + // timestamp + string timestampFormat = FormatterOptions.TimestampFormat; + if (timestampFormat != null) + { + DateTime dateTime = GetCurrentDateTime(); + textWriter.Write(dateTime.ToString(timestampFormat)); + } + + // category and event id + textWriter.Write(category); + textWriter.Write('['); + textWriter.Write(eventId); + textWriter.Write(']'); + + // scope information + WriteScopeInformation(textWriter, scopeProvider); + + // message + if (!string.IsNullOrEmpty(message)) + { + textWriter.Write(' '); + // message + WriteReplacingNewLine(textWriter, message); + } + + // exception + // System.InvalidOperationException at Namespace.Class.Function() in File:line X + if (exception != null) + { + textWriter.Write(' '); + WriteReplacingNewLine(textWriter, exception.ToString()); + } + + // newline delimiter + textWriter.Write(Environment.NewLine); + + static void WriteReplacingNewLine(TextWriter writer, string message) + { + string newMessage = message.Replace(Environment.NewLine, " "); + writer.Write(newMessage); + } + } + + private DateTime GetCurrentDateTime() + { + return FormatterOptions.UseUtcTimestamp ? DateTime.UtcNow : DateTime.Now; + } + + private static string GetSyslogSeverityString(LogLevel logLevel) + { + // 'Syslog Message Severities' from https://tools.ietf.org/html/rfc5424. + return logLevel switch + { + LogLevel.Trace => "<7>", + LogLevel.Debug => "<7>", // debug-level messages + LogLevel.Information => "<6>", // informational messages + LogLevel.Warning => "<4>", // warning conditions + LogLevel.Error => "<3>", // error conditions + LogLevel.Critical => "<2>", // critical conditions + _ => throw new ArgumentOutOfRangeException(nameof(logLevel)) + }; + } + + private void WriteScopeInformation(TextWriter textWriter, IExternalScopeProvider scopeProvider) + { + if (FormatterOptions.IncludeScopes && scopeProvider != null) + { + scopeProvider.ForEachScope((scope, state) => + { + state.Write(" => "); + state.Write(scope); + }, textWriter); + } + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/TextWriterExtensions.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/TextWriterExtensions.cs new file mode 100644 index 000000000000..b7afe29d278e --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/TextWriterExtensions.cs @@ -0,0 +1,33 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.IO; + +namespace Microsoft.Extensions.Logging.Console +{ + internal static class TextWriterExtensions + { + public static void WriteColoredMessage(this TextWriter textWriter, string message, ConsoleColor? background, ConsoleColor? foreground) + { + // Order: backgroundcolor, foregroundcolor, Message, reset foregroundcolor, reset backgroundcolor + if (background.HasValue) + { + textWriter.Write(AnsiParser.GetBackgroundColorEscapeCode(background.Value)); + } + if (foreground.HasValue) + { + textWriter.Write(AnsiParser.GetForegroundColorEscapeCode(foreground.Value)); + } + textWriter.Write(message); + if (foreground.HasValue) + { + textWriter.Write(AnsiParser.DefaultForegroundColor); // reset to default foreground color + } + if (background.HasValue) + { + textWriter.Write(AnsiParser.DefaultBackgroundColor); // reset to the background color + } + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/WindowsLogConsole.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/WindowsLogConsole.cs deleted file mode 100644 index 9bbc8f99c165..000000000000 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/WindowsLogConsole.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.IO; - -namespace Microsoft.Extensions.Logging.Console -{ - internal class WindowsLogConsole : IConsole - { - private readonly TextWriter _textWriter; - - public WindowsLogConsole(bool stdErr = false) - { - _textWriter = stdErr ? System.Console.Error : System.Console.Out; - } - - private bool SetColor(ConsoleColor? background, ConsoleColor? foreground) - { - if (background.HasValue) - { - System.Console.BackgroundColor = background.Value; - } - - if (foreground.HasValue) - { - System.Console.ForegroundColor = foreground.Value; - } - - return background.HasValue || foreground.HasValue; - } - - private void ResetColor() - { - System.Console.ResetColor(); - } - - public void Write(string message, ConsoleColor? background, ConsoleColor? foreground) - { - bool colorChanged = SetColor(background, foreground); - _textWriter.Write(message); - if (colorChanged) - { - ResetColor(); - } - } - - public void WriteLine(string message, ConsoleColor? background, ConsoleColor? foreground) - { - bool colorChanged = SetColor(background, foreground); - _textWriter.WriteLine(message); - if (colorChanged) - { - ResetColor(); - } - } - - public void Flush() - { - // No action required as for every write, data is sent directly to the console - // output stream - } - } -} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/AnsiParserTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/AnsiParserTests.cs new file mode 100644 index 000000000000..fbe579c07645 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/AnsiParserTests.cs @@ -0,0 +1,262 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Extensions.Logging.Test.Console; +using Xunit; + +namespace Microsoft.Extensions.Logging.Console.Test +{ + public class AnsiParserTests + { + private const char EscapeChar = '\x1B'; + + [Theory] + [InlineData(1, "No Color", "No Color")] + [InlineData(2, "\x1B[41mColored\x1B[49mNo Color", "No Color")] + [InlineData(2, "\x1B[41m\x1B[1m\x1B[31mmColored\x1B[39m\x1B[49mNo Color", "No Color")] + public void Parse_CheckTimesWrittenToConsole(int numSegments, string message, string lastSegment) + { + // Arrange + var segments = new List(); + Action onParseWrite = (message, startIndex, length, bg, fg) => { + segments.Add(new ConsoleContext() { + BackgroundColor = bg, + ForegroundColor = fg, + Message = message.AsSpan().Slice(startIndex, length).ToString() + }); + }; + var parser = new AnsiParser(onParseWrite); + + // Act + parser.Parse(message); + + // Assert + Assert.Equal(numSegments, segments.Count); + Assert.Equal(lastSegment, segments.Last().Message); + } + + [Theory] + [MemberData(nameof(Colors))] + public void Parse_SetBackgroundForegroundAndMessageThenReset_Success(ConsoleColor background, ConsoleColor foreground) + { + // Arrange + var message = AnsiParser.GetBackgroundColorEscapeCode(background) + + AnsiParser.GetForegroundColorEscapeCode(foreground) + + "Request received" + + AnsiParser.DefaultForegroundColor //resets foreground color + + AnsiParser.DefaultBackgroundColor; //resets background color + var segments = new List(); + Action onParseWrite = (message, startIndex, length, bg, fg) => { + segments.Add(new ConsoleContext() { + BackgroundColor = bg, + ForegroundColor = fg, + Message = message.AsSpan().Slice(startIndex, length).ToString() + }); + }; + var parser = new AnsiParser(onParseWrite); + + // Act + parser.Parse(message); + + // Assert + Assert.Equal(1, segments.Count); + Assert.Equal("Request received", segments[0].Message); + VerifyForeground(foreground, segments[0]); + VerifyBackground(background, segments[0]); + } + + [Fact] + public void Parse_MessageWithMultipleColors_ParsedIntoMultipleSegments() + { + // Arrange + var message = AnsiParser.GetBackgroundColorEscapeCode(ConsoleColor.DarkRed) + + AnsiParser.GetForegroundColorEscapeCode(ConsoleColor.Gray) + + "Message1" + + AnsiParser.DefaultForegroundColor + + AnsiParser.DefaultBackgroundColor + + "NoColor" + + AnsiParser.GetBackgroundColorEscapeCode(ConsoleColor.DarkGreen) + + AnsiParser.GetForegroundColorEscapeCode(ConsoleColor.Cyan) + + "Message2" + + AnsiParser.GetBackgroundColorEscapeCode(ConsoleColor.DarkBlue) + + AnsiParser.GetForegroundColorEscapeCode(ConsoleColor.Yellow) + + "Message3" + + AnsiParser.DefaultForegroundColor + + AnsiParser.DefaultBackgroundColor; + var segments = new List(); + Action onParseWrite = (message, startIndex, length, bg, fg) => { + segments.Add(new ConsoleContext() { + BackgroundColor = bg, + ForegroundColor = fg, + Message = message.AsSpan().Slice(startIndex, length).ToString() + }); + }; + var parser = new AnsiParser(onParseWrite); + + // Act + parser.Parse(message); + + // Assert + Assert.Equal(4, segments.Count); + Assert.Equal("NoColor", segments[1].Message); + Assert.Null(segments[1].ForegroundColor); + Assert.Null(segments[1].BackgroundColor); + + Assert.Equal("Message1", segments[0].Message); + Assert.Equal("Message2", segments[2].Message); + Assert.Equal("Message3", segments[3].Message); + VerifyBackground(ConsoleColor.DarkRed, segments[0]); + VerifyBackground(ConsoleColor.DarkGreen, segments[2]); + VerifyBackground(ConsoleColor.DarkBlue, segments[3]); + VerifyForeground(ConsoleColor.Gray, segments[0]); + VerifyForeground(ConsoleColor.Cyan, segments[2]); + VerifyForeground(ConsoleColor.Yellow, segments[3]); + } + + [Fact] + public void Parse_RepeatedColorChange_PicksLastSet() + { + // Arrange + var message = AnsiParser.GetBackgroundColorEscapeCode(ConsoleColor.DarkRed) + + AnsiParser.GetBackgroundColorEscapeCode(ConsoleColor.DarkGreen) + + AnsiParser.GetBackgroundColorEscapeCode(ConsoleColor.DarkBlue) + + AnsiParser.GetForegroundColorEscapeCode(ConsoleColor.Gray) + + AnsiParser.GetForegroundColorEscapeCode(ConsoleColor.Cyan) + + AnsiParser.GetForegroundColorEscapeCode(ConsoleColor.Yellow) + + "Request received" + + AnsiParser.DefaultForegroundColor //resets foreground color + + AnsiParser.DefaultBackgroundColor; //resets background color + var segments = new List(); + Action onParseWrite = (message, startIndex, length, bg, fg) => { + segments.Add(new ConsoleContext() { + BackgroundColor = bg, + ForegroundColor = fg, + Message = message.AsSpan().Slice(startIndex, length).ToString() + }); + }; + var parser = new AnsiParser(onParseWrite); + + // Act + parser.Parse(message); + + // Assert + Assert.Equal(1, segments.Count); + Assert.Equal("Request received", segments[0].Message); + VerifyBackground(ConsoleColor.DarkBlue, segments[0]); + VerifyForeground(ConsoleColor.Yellow, segments[0]); + } + + [Theory] + // supported + [InlineData("\x1B[77mInfo", "Info")] + [InlineData("\x1B[77m\x1B[1m\x1B[2m\x1B[0mInfo\x1B[1m", "Info")] + [InlineData("\x1B[7mInfo", "Info")] + [InlineData("\x1B[40m\x1B[1m\x1B[33mwarn\x1B[39m\x1B[22m\x1B[49m:", "warn", ":")] + // unsupported: skips + [InlineData("Info\x1B[77m:", "Info", ":")] + [InlineData("Info\x1B[7m:", "Info", ":")] + // treats as content + [InlineData("\x1B", "\x1B")] + [InlineData("\x1B ", "\x1B ")] + [InlineData("\x1Bm", "\x1Bm")] + [InlineData("\x1B m", "\x1B m")] + [InlineData("\x1Bxym", "\x1Bxym")] + [InlineData("\x1B[", "\x1B[")] + [InlineData("\x1B[m", "\x1B[m")] + [InlineData("\x1B[ ", "\x1B[ ")] + [InlineData("\x1B[ m", "\x1B[ m")] + [InlineData("\x1B[xym", "\x1B[xym")] + [InlineData("\x1B[7777m", "\x1B[7777m")] + [InlineData("\x1B\x1B\x1B", "\x1B\x1B\x1B")] + [InlineData("Message\x1B\x1B\x1B", "Message\x1B\x1B\x1B")] + [InlineData("\x1B\x1BMessage\x1B", "\x1B\x1BMessage\x1B")] + [InlineData("\x1B\x1B\x1BMessage", "\x1B\x1B\x1BMessage")] + [InlineData("Message\x1B ", "Message\x1B ")] + [InlineData("\x1BmMessage", "\x1BmMessage")] + [InlineData("\x1B[77m\x1B m\x1B[40m", "\x1B m")] + [InlineData("\x1B mMessage\x1Bxym", "\x1B mMessage\x1Bxym")] + public void Parse_ValidSupportedOrUnsupportedCodesInMessage_MessageParsedSuccessfully(string messageWithUnsupportedCode, params string[] output) + { + // Arrange + var message = messageWithUnsupportedCode; + var segments = new List(); + Action onParseWrite = (message, startIndex, length, bg, fg) => { + segments.Add(new ConsoleContext() { + BackgroundColor = bg, + ForegroundColor = fg, + Message = message.AsSpan().Slice(startIndex, length).ToString() + }); + }; + var parser = new AnsiParser(onParseWrite); + + // Act + parser.Parse(messageWithUnsupportedCode); + + // Assert + Assert.Equal(output.Length, segments.Count); + for (int i = 0; i < output.Length; i++) + Assert.Equal(output[i], segments[i].Message); + } + + [Fact] + public void NullDelegate_Throws() + { + Assert.Throws(() => new AnsiParser(null)); + } + + public static TheoryData Colors + { + get + { + var data = new TheoryData(); + foreach (ConsoleColor background in Enum.GetValues(typeof(ConsoleColor))) + { + foreach (ConsoleColor foreground in Enum.GetValues(typeof(ConsoleColor))) + { + data.Add(background, foreground); + } + } + return data; + } + } + + private void VerifyBackground(ConsoleColor background, ConsoleContext segment) + { + if (IsBackgroundColorNotSupported(background)) + { + Assert.Null(segment.BackgroundColor); + } + else + { + Assert.Equal(background, segment.BackgroundColor); + } + } + + private void VerifyForeground(ConsoleColor foreground, ConsoleContext segment) + { + if (IsForegroundColorNotSupported(foreground)) + { + Assert.Null(segment.ForegroundColor); + } + else + { + Assert.Equal(foreground, segment.ForegroundColor); + } + } + + private static bool IsBackgroundColorNotSupported(ConsoleColor color) + { + return AnsiParser.GetBackgroundColorEscapeCode(color).Equals( + AnsiParser.DefaultBackgroundColor, StringComparison.OrdinalIgnoreCase); + } + + private static bool IsForegroundColorNotSupported(ConsoleColor color) + { + return AnsiParser.GetForegroundColorEscapeCode(color).Equals( + AnsiParser.DefaultForegroundColor, StringComparison.OrdinalIgnoreCase); + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/Console/ConsoleContext.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Console/ConsoleContext.cs similarity index 100% rename from src/libraries/Microsoft.Extensions.Logging/tests/Common/Console/ConsoleContext.cs rename to src/libraries/Microsoft.Extensions.Logging.Console/tests/Console/ConsoleContext.cs diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/Console/ConsoleSink.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Console/ConsoleSink.cs similarity index 100% rename from src/libraries/Microsoft.Extensions.Logging/tests/Common/Console/ConsoleSink.cs rename to src/libraries/Microsoft.Extensions.Logging.Console/tests/Console/ConsoleSink.cs diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/Console/TestConsole.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Console/TestConsole.cs similarity index 78% rename from src/libraries/Microsoft.Extensions.Logging/tests/Common/Console/TestConsole.cs rename to src/libraries/Microsoft.Extensions.Logging.Console/tests/Console/TestConsole.cs index 5c26251cd5d4..c6040753d9c9 100644 --- a/src/libraries/Microsoft.Extensions.Logging/tests/Common/Console/TestConsole.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Console/TestConsole.cs @@ -12,10 +12,12 @@ public class TestConsole : IConsole public static readonly ConsoleColor? DefaultForegroundColor; private ConsoleSink _sink; + private AnsiParser _parser; public TestConsole(ConsoleSink sink) { _sink = sink; + _parser = new AnsiParser(OnParseWrite); BackgroundColor = DefaultBackgroundColor; ForegroundColor = DefaultForegroundColor; } @@ -24,10 +26,15 @@ public TestConsole(ConsoleSink sink) public ConsoleColor? ForegroundColor { get; private set; } - public void Write(string message, ConsoleColor? background, ConsoleColor? foreground) + public void Write(string message) + { + _parser.Parse(message); + } + + public void OnParseWrite(string message, int startIndex, int length, ConsoleColor? background, ConsoleColor? foreground) { var consoleContext = new ConsoleContext(); - consoleContext.Message = message; + consoleContext.Message = message.AsSpan().Slice(startIndex, length).ToString(); if (background.HasValue) { @@ -44,15 +51,6 @@ public void Write(string message, ConsoleColor? background, ConsoleColor? foregr ResetColor(); } - public void WriteLine(string message, ConsoleColor? background, ConsoleColor? foreground) - { - Write(message + Environment.NewLine, background, foreground); - } - - public void Flush() - { - } - private void ResetColor() { BackgroundColor = DefaultBackgroundColor; diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/ConsoleFormatterTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/ConsoleFormatterTests.cs new file mode 100644 index 000000000000..580a745a12d8 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/ConsoleFormatterTests.cs @@ -0,0 +1,272 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.Encodings.Web; +using System.Text.Json; +using System.Text.RegularExpressions; +using Microsoft.Extensions.Logging.Abstractions; +using Microsoft.Extensions.Logging.Test.Console; +using Microsoft.Extensions.Options; +using Xunit; + +namespace Microsoft.Extensions.Logging.Console.Test +{ + public class ConsoleFormatterTests + { + protected const string _loggerName = "test"; + protected const string _state = "This is a test, and {curly braces} are just fine!"; + protected readonly Func _defaultFormatter = (state, exception) => state.ToString(); + + protected string GetMessage(List contexts) + { + return string.Join("", contexts.Select(c => c.Message)); + } + + internal static (ConsoleLogger Logger, ConsoleSink Sink, ConsoleSink ErrorSink, Func GetLevelPrefix, int WritesPerMsg) SetUp( + ConsoleLoggerOptions options = null, + SimpleConsoleFormatterOptions simpleOptions = null, + ConsoleFormatterOptions systemdOptions = null, + JsonConsoleFormatterOptions jsonOptions = null) + { + // Arrange + var sink = new ConsoleSink(); + var errorSink = new ConsoleSink(); + var console = new TestConsole(sink); + var errorConsole = new TestConsole(errorSink); + var consoleLoggerProcessor = new TestLoggerProcessor(); + consoleLoggerProcessor.Console = console; + consoleLoggerProcessor.ErrorConsole = errorConsole; + + var logger = new ConsoleLogger(_loggerName, consoleLoggerProcessor); + logger.ScopeProvider = new LoggerExternalScopeProvider(); + logger.Options = options ?? new ConsoleLoggerOptions(); + var formatters = new ConcurrentDictionary(ConsoleLoggerTest.GetFormatters(simpleOptions, systemdOptions, jsonOptions).ToDictionary(f => f.Name)); + + Func levelAsString; + int writesPerMsg; + switch (logger.Options.FormatterName) + { + case ConsoleFormatterNames.Simple: + levelAsString = ConsoleLoggerTest.LogLevelAsStringDefault; + writesPerMsg = 2; + logger.Formatter = formatters[ConsoleFormatterNames.Simple]; + break; + case ConsoleFormatterNames.Systemd: + levelAsString = ConsoleLoggerTest.GetSyslogSeverityString; + writesPerMsg = 1; + logger.Formatter = formatters[ConsoleFormatterNames.Systemd]; + break; + case ConsoleFormatterNames.Json: + levelAsString = ConsoleLoggerTest.GetJsonLogLevelString; + writesPerMsg = 1; + logger.Formatter = formatters[ConsoleFormatterNames.Json]; + break; + default: + throw new ArgumentOutOfRangeException(nameof(logger.Options.FormatterName)); + } + + return (logger, sink, errorSink, levelAsString, writesPerMsg); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + public void ConsoleLoggerOptions_TimeStampFormat_IsReloaded() + { + // Arrange + var monitor = new TestOptionsMonitor(new ConsoleLoggerOptions() { FormatterName = "NonExistentFormatter" }); + var loggerProvider = new ConsoleLoggerProvider(monitor, ConsoleLoggerTest.GetFormatters()); + var logger = (ConsoleLogger)loggerProvider.CreateLogger("Name"); + + // Act & Assert + Assert.Equal("NonExistentFormatter", logger.Options.FormatterName); + Assert.Equal(ConsoleFormatterNames.Simple, logger.Formatter.Name); + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [MemberData(nameof(FormatterNames))] + public void InvalidLogLevel_Throws(string formatterName) + { + // Arrange + var t = SetUp( + new ConsoleLoggerOptions { FormatterName = formatterName } + ); + var logger = (ILogger)t.Logger; + + // Act/Assert + Assert.Throws(() => logger.Log((LogLevel)8, 0, _state, null, _defaultFormatter)); + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [MemberData(nameof(FormatterNamesAndLevels))] + public void NoMessageOrException_Noop(string formatterName, LogLevel level) + { + // Arrange + var t = SetUp(new ConsoleLoggerOptions { FormatterName = formatterName }); + var levelPrefix = t.GetLevelPrefix(level); + var logger = t.Logger; + var sink = t.Sink; + var ex = new Exception("Exception message" + Environment.NewLine + "with a second line"); + + // Act + Func formatter = (state, exception) => null; + logger.Log(level, 0, _state, null, formatter); + + // Assert + Assert.Equal(0, sink.Writes.Count); + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [MemberData(nameof(FormatterNamesAndLevels))] + public void Log_LogsCorrectTimestamp(string formatterName, LogLevel level) + { + // Arrange + var t = SetUp( + new ConsoleLoggerOptions { FormatterName = formatterName }, + new SimpleConsoleFormatterOptions { TimestampFormat = "yyyy-MM-ddTHH:mm:sszz ", UseUtcTimestamp = false }, + new ConsoleFormatterOptions { TimestampFormat = "yyyy-MM-ddTHH:mm:sszz ", UseUtcTimestamp = false }, + new JsonConsoleFormatterOptions { + TimestampFormat = "yyyy-MM-ddTHH:mm:sszz ", + UseUtcTimestamp = false, + JsonWriterOptions = new JsonWriterOptions() + { + // otherwise escapes for timezone formatting from + to \u002b + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + Indented = true + } + }); + var levelPrefix = t.GetLevelPrefix(level); + var logger = t.Logger; + var sink = t.Sink; + var ex = new Exception("Exception message" + Environment.NewLine + "with a second line"); + + // Act + logger.Log(level, 0, _state, ex, _defaultFormatter); + + // Assert + switch (formatterName) + { + case ConsoleFormatterNames.Simple: + { + Assert.Equal(3, sink.Writes.Count); + Assert.StartsWith(levelPrefix, sink.Writes[1].Message); + Assert.Matches(@"^\d{4}\D\d{2}\D\d{2}\D\d{2}\D\d{2}\D\d{2}\D\d{2}\s$", sink.Writes[0].Message); + var parsedDateTime = DateTimeOffset.Parse(sink.Writes[0].Message.Trim()); + Assert.Equal(DateTimeOffset.Now.Offset, parsedDateTime.Offset); + } + break; + case ConsoleFormatterNames.Systemd: + { + Assert.Single(sink.Writes); + Assert.StartsWith(levelPrefix, sink.Writes[0].Message); + var regexMatch = Regex.Match(sink.Writes[0].Message, @"^<\d>(\d{4}\D\d{2}\D\d{2}\D\d{2}\D\d{2}\D\d{2}\D\d{2})\s[^\s]"); + Assert.True(regexMatch.Success); + var parsedDateTime = DateTimeOffset.Parse(regexMatch.Groups[1].Value); + Assert.Equal(DateTimeOffset.Now.Offset, parsedDateTime.Offset); + } + break; + case ConsoleFormatterNames.Json: + { + Assert.Single(sink.Writes); + var regexMatch = Regex.Match(sink.Writes[0].Message, @"(\d{4}\D\d{2}\D\d{2}\D\d{2}\D\d{2}\D\d{2}\D\d{2})"); + Assert.True(regexMatch.Success, sink.Writes[0].Message); + var parsedDateTime = DateTimeOffset.Parse(regexMatch.Groups[1].Value); + Assert.Equal(DateTimeOffset.Now.Offset, parsedDateTime.Offset); + } + break; + default: + throw new ArgumentOutOfRangeException(nameof(formatterName)); + } + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + public void NullFormatterName_Throws() + { + // Arrange + Assert.Throws(() => new NullNameConsoleFormatter()); + } + + private class NullNameConsoleFormatter : ConsoleFormatter + { + public NullNameConsoleFormatter() : base(null) { } + public override void Write(in LogEntry logEntry, IExternalScopeProvider scopeProvider, TextWriter textWriter) { } + } + + public static TheoryData FormatterNamesAndLevels + { + get + { + var data = new TheoryData(); + foreach (LogLevel level in Enum.GetValues(typeof(LogLevel))) + { + if (level == LogLevel.None) + { + continue; + } + data.Add(ConsoleFormatterNames.Simple, level); + data.Add(ConsoleFormatterNames.Systemd, level); + data.Add(ConsoleFormatterNames.Json, level); + } + return data; + } + } + + public static TheoryData FormatterNames + { + get + { + var data = new TheoryData(); + data.Add(ConsoleFormatterNames.Simple); + data.Add(ConsoleFormatterNames.Systemd); + data.Add(ConsoleFormatterNames.Json); + return data; + } + } + + public static TheoryData Levels + { + get + { + var data = new TheoryData(); + foreach (LogLevel value in Enum.GetValues(typeof(LogLevel))) + { + data.Add(value); + } + return data; + } + } + + } + + public class TestFormatter : ConsoleFormatter, IDisposable + { + private IDisposable _optionsReloadToken; + + public TestFormatter(IOptionsMonitor options) + : base ("TestFormatter") + { + FormatterOptions = options.CurrentValue; + ReloadLoggerOptions(options.CurrentValue); + _optionsReloadToken = options.OnChange(ReloadLoggerOptions); + } + + private void ReloadLoggerOptions(SimpleConsoleFormatterOptions options) + { + FormatterOptions = options; + } + + public void Dispose() + { + _optionsReloadToken?.Dispose(); + } + + internal SimpleConsoleFormatterOptions FormatterOptions { get; set; } + public override void Write(in LogEntry logEntry, IExternalScopeProvider scopeProvider, TextWriter textWriter) + { + ; + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/ConsoleLoggerExtensionsTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/ConsoleLoggerExtensionsTests.cs new file mode 100644 index 000000000000..85a643012c82 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/ConsoleLoggerExtensionsTests.cs @@ -0,0 +1,476 @@ + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Encodings.Web; +using System.Text.Json; +using Microsoft.Extensions.Logging.Abstractions; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Console; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Xunit; + +namespace Microsoft.Extensions.Logging.Test +{ + public class ConsoleLoggerExtensionsTests + { + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + public void AddConsole_NullConfigure_Throws() + { + Assert.Throws(() => + new ServiceCollection() + .AddLogging(builder => + { + builder.AddConsole(null); + })); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + public void AddSimpleConsole_NullConfigure_Throws() + { + Assert.Throws(() => + new ServiceCollection() + .AddLogging(builder => + { + builder.AddSimpleConsole(null); + })); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + public void AddSystemdConsole_NullConfigure_Throws() + { + Assert.Throws(() => + new ServiceCollection() + .AddLogging(builder => + { + builder.AddSystemdConsole(null); + })); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + public void AddJsonConsole_NullConfigure_Throws() + { + Assert.Throws(() => + new ServiceCollection() + .AddLogging(builder => + { + builder.AddJsonConsole(null); + })); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + public void AddConsoleFormatter_NullConfigure_Throws() + { + Assert.Throws(() => + new ServiceCollection() + .AddLogging(builder => + { + builder.AddConsoleFormatter(null); + })); + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [MemberData(nameof(FormatterNames))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)] + public void AddConsole_ConsoleLoggerOptionsFromConfigFile_IsReadFromLoggingConfiguration(string formatterName) + { + var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { + new KeyValuePair("Console:FormatterName", formatterName) + }).Build(); + + var loggerProvider = new ServiceCollection() + .AddLogging(builder => builder + .AddConfiguration(configuration) + .AddConsole()) + .BuildServiceProvider() + .GetRequiredService(); + + var consoleLoggerProvider = Assert.IsType(loggerProvider); + var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category"); + Assert.Equal(formatterName, logger.Options.FormatterName); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)] + public void AddConsoleFormatter_CustomFormatter_IsReadFromLoggingConfiguration() + { + var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { + new KeyValuePair("Console:FormatterName", "custom"), + new KeyValuePair("Console:FormatterOptions:CustomLabel", "random"), + }).Build(); + + var loggerProvider = new ServiceCollection() + .AddLogging(builder => builder + .AddConfiguration(configuration) + .AddConsoleFormatter(fOptions => { fOptions.CustomLabel = "random"; }) + .AddConsole(o => { o.FormatterName = "custom"; }) + ) + .BuildServiceProvider() + .GetRequiredService(); + + var consoleLoggerProvider = Assert.IsType(loggerProvider); + var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category"); + Assert.Equal("custom", logger.Options.FormatterName); + var formatter = Assert.IsType(logger.Formatter); + Assert.Equal("random", formatter.FormatterOptions.CustomLabel); + } + + private class CustomFormatter : ConsoleFormatter, IDisposable + { + private IDisposable _optionsReloadToken; + + public CustomFormatter(IOptionsMonitor options) + : base("custom") + { + ReloadLoggerOptions(options.CurrentValue); + _optionsReloadToken = options.OnChange(ReloadLoggerOptions); + } + + private void ReloadLoggerOptions(CustomOptions options) + { + FormatterOptions = options; + } + + public CustomOptions FormatterOptions { get; set; } + public string CustomLog { get; set; } + + public override void Write(in LogEntry logEntry, IExternalScopeProvider scopeProvider, TextWriter textWriter) + { + CustomLog = logEntry.Formatter(logEntry.State, logEntry.Exception); + } + + public void Dispose() + { + _optionsReloadToken?.Dispose(); + } + } + + private class CustomOptions : ConsoleFormatterOptions + { + public string CustomLabel { get; set; } + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)] + public void AddSimpleConsole_ChangeProperties_IsReadFromLoggingConfiguration() + { + var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { + new KeyValuePair("Console:FormatterOptions:DisableColors", "true"), + new KeyValuePair("Console:FormatterOptions:SingleLine", "true"), + new KeyValuePair("Console:FormatterOptions:TimestampFormat", "HH:mm "), + new KeyValuePair("Console:FormatterOptions:UseUtcTimestamp", "true"), + new KeyValuePair("Console:FormatterOptions:IncludeScopes", "true"), + }).Build(); + + var loggerProvider = new ServiceCollection() + .AddLogging(builder => builder + .AddConfiguration(configuration) + .AddSimpleConsole(o => {}) + ) + .BuildServiceProvider() + .GetRequiredService(); + + var consoleLoggerProvider = Assert.IsType(loggerProvider); + var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category"); + Assert.Equal(ConsoleFormatterNames.Simple, logger.Options.FormatterName); + var formatter = Assert.IsType(logger.Formatter); + Assert.True(formatter.FormatterOptions.DisableColors); + Assert.True(formatter.FormatterOptions.SingleLine); + Assert.Equal("HH:mm ", formatter.FormatterOptions.TimestampFormat); + Assert.True(formatter.FormatterOptions.UseUtcTimestamp); + Assert.True(formatter.FormatterOptions.IncludeScopes); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)] + public void AddSystemdConsole_ChangeProperties_IsReadFromLoggingConfiguration() + { + var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { + new KeyValuePair("Console:FormatterOptions:TimestampFormat", "HH:mm "), + new KeyValuePair("Console:FormatterOptions:UseUtcTimestamp", "true"), + new KeyValuePair("Console:FormatterOptions:IncludeScopes", "true"), + }).Build(); + + var loggerProvider = new ServiceCollection() + .AddLogging(builder => builder + .AddConfiguration(configuration) + .AddSystemdConsole(o => {}) + ) + .BuildServiceProvider() + .GetRequiredService(); + + var consoleLoggerProvider = Assert.IsType(loggerProvider); + var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category"); + Assert.Equal(ConsoleFormatterNames.Systemd, logger.Options.FormatterName); + var formatter = Assert.IsType(logger.Formatter); + Assert.Equal("HH:mm ", formatter.FormatterOptions.TimestampFormat); + Assert.True(formatter.FormatterOptions.UseUtcTimestamp); + Assert.True(formatter.FormatterOptions.IncludeScopes); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)] + public void AddJsonConsole_ChangeProperties_IsReadFromLoggingConfiguration() + { + var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { + new KeyValuePair("Console:FormatterOptions:TimestampFormat", "HH:mm "), + new KeyValuePair("Console:FormatterOptions:UseUtcTimestamp", "true"), + new KeyValuePair("Console:FormatterOptions:IncludeScopes", "true"), + new KeyValuePair("Console:FormatterOptions:JsonWriterOptions:Indented", "true"), + }).Build(); + + var loggerProvider = new ServiceCollection() + .AddLogging(builder => builder + .AddConfiguration(configuration) + .AddJsonConsole(o => {}) + ) + .BuildServiceProvider() + .GetRequiredService(); + + var consoleLoggerProvider = Assert.IsType(loggerProvider); + var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category"); + Assert.Equal(ConsoleFormatterNames.Json, logger.Options.FormatterName); + var formatter = Assert.IsType(logger.Formatter); + Assert.Equal("HH:mm ", formatter.FormatterOptions.TimestampFormat); + Assert.True(formatter.FormatterOptions.UseUtcTimestamp); + Assert.True(formatter.FormatterOptions.IncludeScopes); + Assert.True(formatter.FormatterOptions.JsonWriterOptions.Indented); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)] + public void AddJsonConsole_OutsideConfig_TakesProperty() + { + var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { + new KeyValuePair("Console:FormatterOptions:TimestampFormat", "HH:mm "), + new KeyValuePair("Console:FormatterOptions:UseUtcTimestamp", "true"), + new KeyValuePair("Console:FormatterOptions:IncludeScopes", "true"), + }).Build(); + + var loggerProvider = new ServiceCollection() + .AddLogging(builder => builder + .AddConfiguration(configuration) + .AddJsonConsole(o => { + o.JsonWriterOptions = new JsonWriterOptions() + { + Indented = false, + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping + }; + }) + ) + .BuildServiceProvider() + .GetRequiredService(); + + var consoleLoggerProvider = Assert.IsType(loggerProvider); + var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category"); + Assert.Equal(ConsoleFormatterNames.Json, logger.Options.FormatterName); + var formatter = Assert.IsType(logger.Formatter); + Assert.Equal("HH:mm ", formatter.FormatterOptions.TimestampFormat); + Assert.True(formatter.FormatterOptions.UseUtcTimestamp); + Assert.True(formatter.FormatterOptions.IncludeScopes); + Assert.False(formatter.FormatterOptions.JsonWriterOptions.Indented); + Assert.Equal(JavaScriptEncoder.UnsafeRelaxedJsonEscaping, formatter.FormatterOptions.JsonWriterOptions.Encoder); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)] + public void AddConsole_NullFormatterNameUsingSystemdFormat_AnyDeprecatedPropertiesOverwriteFormatterOptions() + { + var configs = new[] { + new KeyValuePair("Console:Format", "Systemd"), + new KeyValuePair("Console:TimestampFormat", "HH:mm:ss "), + new KeyValuePair("Console:FormatterOptions:TimestampFormat", "HH:mm "), + }; + var configuration = new ConfigurationBuilder().AddInMemoryCollection(configs).Build(); + + var loggerProvider = new ServiceCollection() + .AddLogging(builder => builder + .AddConfiguration(configuration) + .AddConsole(o => { }) + ) + .BuildServiceProvider() + .GetRequiredService(); + + var consoleLoggerProvider = Assert.IsType(loggerProvider); + var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category"); + Assert.Null(logger.Options.FormatterName); + var formatter = Assert.IsType(logger.Formatter); + Assert.Equal("HH:mm:ss ", formatter.FormatterOptions.TimestampFormat); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)] + public void AddConsole_NullFormatterName_UsingSystemdFormat_IgnoreFormatterOptionsAndUseDeprecatedInstead() + { + var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { + new KeyValuePair("Console:Format", "Systemd"), + new KeyValuePair("Console:IncludeScopes", "true"), + new KeyValuePair("Console:TimestampFormat", "HH:mm:ss "), + new KeyValuePair("Console:FormatterOptions:TimestampFormat", "HH:mm "), + }).Build(); + + var loggerProvider = new ServiceCollection() + .AddLogging(builder => builder + .AddConfiguration(configuration) + .AddConsole(o => { +#pragma warning disable CS0618 + o.IncludeScopes = false; +#pragma warning restore CS0618 + }) + ) + .BuildServiceProvider() + .GetRequiredService(); + + var consoleLoggerProvider = Assert.IsType(loggerProvider); + var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category"); + Assert.Null(logger.Options.FormatterName); + var formatter = Assert.IsType(logger.Formatter); + + Assert.Equal("HH:mm:ss ", formatter.FormatterOptions.TimestampFormat); // ignore FormatterOptions, using deprecated one + Assert.False(formatter.FormatterOptions.UseUtcTimestamp); // not set anywhere, defaulted to false + Assert.False(formatter.FormatterOptions.IncludeScopes); // setup using lambda wins over config + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)] + public void AddConsole_NullFormatterName_UsingDefaultFormat_IgnoreFormatterOptionsAndUseDeprecatedInstead() + { + var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { + new KeyValuePair("Console:Format", "Default"), + new KeyValuePair("Console:IncludeScopes", "true"), + new KeyValuePair("Console:TimestampFormat", "HH:mm:ss "), + new KeyValuePair("Console:FormatterOptions:SingleLine", "true"), + new KeyValuePair("Console:FormatterOptions:TimestampFormat", "HH:mm "), + }).Build(); + + var loggerProvider = new ServiceCollection() + .AddLogging(builder => builder + .AddConfiguration(configuration) + .AddConsole(o => { +#pragma warning disable CS0618 + o.DisableColors = true; + o.IncludeScopes = false; +#pragma warning restore CS0618 + }) + ) + .BuildServiceProvider() + .GetRequiredService(); + + var consoleLoggerProvider = Assert.IsType(loggerProvider); + var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category"); + Assert.Null(logger.Options.FormatterName); +#pragma warning disable CS0618 + Assert.True(logger.Options.DisableColors); +#pragma warning restore CS0618 + var formatter = Assert.IsType(logger.Formatter); + + Assert.False(formatter.FormatterOptions.SingleLine); // ignored + Assert.Equal("HH:mm:ss ", formatter.FormatterOptions.TimestampFormat); // ignore FormatterOptions, using deprecated one + Assert.False(formatter.FormatterOptions.UseUtcTimestamp); // not set anywhere, defaulted to false + Assert.False(formatter.FormatterOptions.IncludeScopes); // setup using lambda wins over config + Assert.True(formatter.FormatterOptions.DisableColors); // setup using lambda + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [InlineData("missingFormatter")] + [InlineData("simple")] + [InlineData("Simple")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)] + public void AddConsole_FormatterNameIsSet_UsingDefaultFormat_IgnoreDeprecatedAndUseFormatterOptionsInstead(string formatterName) + { + var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { + new KeyValuePair("Console:Format", "Default"), + new KeyValuePair("Console:FormatterName", formatterName), + new KeyValuePair("Console:TimestampFormat", "HH:mm:ss "), + new KeyValuePair("Console:FormatterOptions:IncludeScopes", "true"), + new KeyValuePair("Console:FormatterOptions:SingleLine", "true"), + new KeyValuePair("Console:FormatterOptions:TimestampFormat", "HH:mm "), + }).Build(); + + var loggerProvider = new ServiceCollection() + .AddLogging(builder => builder + .AddConfiguration(configuration) + .AddConsole(o => { +#pragma warning disable CS0618 + o.DisableColors = true; + o.IncludeScopes = false; +#pragma warning restore CS0618 + }) + ) + .BuildServiceProvider() + .GetRequiredService(); + + var consoleLoggerProvider = Assert.IsType(loggerProvider); + var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category"); + Assert.Equal(formatterName, logger.Options.FormatterName); +#pragma warning disable CS0618 + Assert.True(logger.Options.DisableColors); +#pragma warning restore CS0618 + var formatter = Assert.IsType(logger.Formatter); + + Assert.True(formatter.FormatterOptions.SingleLine); // picked from FormatterOptions + Assert.Equal("HH:mm ", formatter.FormatterOptions.TimestampFormat); // ignore deprecated, using FormatterOptions instead + Assert.False(formatter.FormatterOptions.UseUtcTimestamp); // not set anywhere, defaulted to false + Assert.True(formatter.FormatterOptions.IncludeScopes); // ignore deprecated set in lambda use FormatterOptions instead + Assert.False(formatter.FormatterOptions.DisableColors); // ignore deprecated set in lambda, defaulted to false + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [InlineData("missingFormatter")] + [InlineData("systemd")] + [InlineData("Systemd")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)] + public void AddConsole_FormatterNameIsSet_UsingSystemdFormat_IgnoreDeprecatedAndUseFormatterOptionsInstead(string formatterName) + { + var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { + new KeyValuePair("Console:Format", "Systemd"), + new KeyValuePair("Console:FormatterName", formatterName), + new KeyValuePair("Console:TimestampFormat", "HH:mm:ss "), + new KeyValuePair("Console:FormatterOptions:IncludeScopes", "true"), + new KeyValuePair("Console:FormatterOptions:TimestampFormat", "HH:mm "), + }).Build(); + + var loggerProvider = new ServiceCollection() + .AddLogging(builder => builder + .AddConfiguration(configuration) + .AddConsole(o => { +#pragma warning disable CS0618 + o.UseUtcTimestamp = true; + o.IncludeScopes = false; +#pragma warning restore CS0618 + }) + ) + .BuildServiceProvider() + .GetRequiredService(); + + var consoleLoggerProvider = Assert.IsType(loggerProvider); + var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category"); + Assert.Equal(formatterName, logger.Options.FormatterName); +#pragma warning disable CS0618 + Assert.True(logger.Options.UseUtcTimestamp); +#pragma warning restore CS0618 + var formatter = Assert.IsType(logger.Formatter); + + Assert.Equal("HH:mm ", formatter.FormatterOptions.TimestampFormat); // ignore deprecated, using FormatterOptions instead + Assert.True(formatter.FormatterOptions.IncludeScopes); // ignore deprecated set in lambda use FormatterOptions instead + Assert.False(formatter.FormatterOptions.UseUtcTimestamp); // ignore deprecated set in lambda, defaulted to false + } + + public static TheoryData FormatterNames + { + get + { + var data = new TheoryData(); + data.Add(ConsoleFormatterNames.Simple); + data.Add(ConsoleFormatterNames.Systemd); + data.Add(ConsoleFormatterNames.Json); + return data; + } + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/ConsoleLoggerTest.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/ConsoleLoggerTest.cs similarity index 83% rename from src/libraries/Microsoft.Extensions.Logging/tests/Common/ConsoleLoggerTest.cs rename to src/libraries/Microsoft.Extensions.Logging.Console/tests/ConsoleLoggerTest.cs index dfbf0927117e..9f6a99f5d7d9 100644 --- a/src/libraries/Microsoft.Extensions.Logging/tests/Common/ConsoleLoggerTest.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/ConsoleLoggerTest.cs @@ -2,17 +2,18 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging.Console; using Microsoft.Extensions.Logging.Test.Console; using Microsoft.Extensions.Options; using Xunit; +#pragma warning disable CS0618 -namespace Microsoft.Extensions.Logging.Test +namespace Microsoft.Extensions.Logging.Console.Test { public class ConsoleLoggerTest { @@ -21,6 +22,22 @@ public class ConsoleLoggerTest private const string _state = "This is a test, and {curly braces} are just fine!"; private readonly Func _defaultFormatter = (state, exception) => state.ToString(); + internal static IEnumerable GetFormatters( + SimpleConsoleFormatterOptions simpleOptions = null, + ConsoleFormatterOptions systemdOptions = null, + JsonConsoleFormatterOptions jsonOptions = null) + { + var defaultMonitor = new TestFormatterOptionsMonitor(simpleOptions ?? new SimpleConsoleFormatterOptions()); + var systemdMonitor = new TestFormatterOptionsMonitor(systemdOptions ?? new ConsoleFormatterOptions()); + var jsonMonitor = new TestFormatterOptionsMonitor(jsonOptions ?? new JsonConsoleFormatterOptions()); + var formatters = new List() { + new SimpleConsoleFormatter(defaultMonitor), + new SystemdConsoleFormatter(systemdMonitor), + new JsonConsoleFormatter(jsonMonitor) + }; + return formatters; + } + private static (ConsoleLogger Logger, ConsoleSink Sink, ConsoleSink ErrorSink, Func GetLevelPrefix, int WritesPerMsg) SetUp(ConsoleLoggerOptions options = null) { // Arrange @@ -35,6 +52,8 @@ private static (ConsoleLogger Logger, ConsoleSink Sink, ConsoleSink ErrorSink, F var logger = new ConsoleLogger(_loggerName, consoleLoggerProcessor); logger.ScopeProvider = new LoggerExternalScopeProvider(); logger.Options = options ?? new ConsoleLoggerOptions(); + var formatters = new ConcurrentDictionary(GetFormatters().ToDictionary(f => f.Name)); + Func levelAsString; int writesPerMsg; switch (logger.Options.Format) @@ -42,18 +61,62 @@ private static (ConsoleLogger Logger, ConsoleSink Sink, ConsoleSink ErrorSink, F case ConsoleLoggerFormat.Default: levelAsString = LogLevelAsStringDefault; writesPerMsg = 2; + logger.Formatter = formatters[ConsoleFormatterNames.Simple]; break; case ConsoleLoggerFormat.Systemd: levelAsString = GetSyslogSeverityString; writesPerMsg = 1; + logger.Formatter = formatters[ConsoleFormatterNames.Systemd]; break; default: throw new ArgumentOutOfRangeException(nameof(logger.Options.Format)); } + + UpdateFormatterOptions(logger.Formatter, logger.Options); + VerifyDeprecatedPropertiesUsedOnNullFormatterName(logger); return (logger, sink, errorSink, levelAsString, writesPerMsg); } - private static string LogLevelAsStringDefault(LogLevel level) + private static void VerifyDeprecatedPropertiesUsedOnNullFormatterName(ConsoleLogger logger) + { + Assert.Null(logger.Options.FormatterName); + if (ConsoleLoggerFormat.Default == logger.Options.Format) + { + var formatter = Assert.IsType(logger.Formatter); + Assert.Equal(formatter.FormatterOptions.IncludeScopes, logger.Options.IncludeScopes); + Assert.Equal(formatter.FormatterOptions.UseUtcTimestamp, logger.Options.UseUtcTimestamp); + Assert.Equal(formatter.FormatterOptions.TimestampFormat, logger.Options.TimestampFormat); + Assert.Equal(formatter.FormatterOptions.DisableColors, logger.Options.DisableColors); + } + else + { + var formatter = Assert.IsType(logger.Formatter); + Assert.Equal(formatter.FormatterOptions.IncludeScopes, logger.Options.IncludeScopes); + Assert.Equal(formatter.FormatterOptions.UseUtcTimestamp, logger.Options.UseUtcTimestamp); + Assert.Equal(formatter.FormatterOptions.TimestampFormat, logger.Options.TimestampFormat); + } + } + + private static void UpdateFormatterOptions(ConsoleFormatter formatter, ConsoleLoggerOptions deprecatedFromOptions) + { + // kept for deprecated apis: + if (formatter is SimpleConsoleFormatter defaultFormatter) + { + defaultFormatter.FormatterOptions.DisableColors = deprecatedFromOptions.DisableColors; + defaultFormatter.FormatterOptions.IncludeScopes = deprecatedFromOptions.IncludeScopes; + defaultFormatter.FormatterOptions.TimestampFormat = deprecatedFromOptions.TimestampFormat; + defaultFormatter.FormatterOptions.UseUtcTimestamp = deprecatedFromOptions.UseUtcTimestamp; + } + else + if (formatter is SystemdConsoleFormatter systemdFormatter) + { + systemdFormatter.FormatterOptions.IncludeScopes = deprecatedFromOptions.IncludeScopes; + systemdFormatter.FormatterOptions.TimestampFormat = deprecatedFromOptions.TimestampFormat; + systemdFormatter.FormatterOptions.UseUtcTimestamp = deprecatedFromOptions.UseUtcTimestamp; + } + } + + internal static string LogLevelAsStringDefault(LogLevel level) { switch (level) { @@ -74,7 +137,7 @@ private static string LogLevelAsStringDefault(LogLevel level) } } - private static string GetSyslogSeverityString(LogLevel level) + internal static string GetSyslogSeverityString(LogLevel level) { switch (level) { @@ -94,6 +157,20 @@ private static string GetSyslogSeverityString(LogLevel level) } } + internal static string GetJsonLogLevelString(LogLevel logLevel) + { + return logLevel switch + { + LogLevel.Trace => "Trace", + LogLevel.Debug => "Debug", + LogLevel.Information => "Information", + LogLevel.Warning => "Warning", + LogLevel.Error => "Error", + LogLevel.Critical => "Critical", + _ => throw new ArgumentOutOfRangeException(nameof(logLevel)) + }; + } + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] public void LogsWhenMessageIsNotProvided() { @@ -112,17 +189,17 @@ public void LogsWhenMessageIsNotProvided() Assert.Equal(6, sink.Writes.Count); Assert.Equal( "crit: test[0]" + Environment.NewLine + - " [null]" + Environment.NewLine, + _paddingString + "[null]" + Environment.NewLine, GetMessage(sink.Writes.GetRange(0 * t.WritesPerMsg, t.WritesPerMsg))); Assert.Equal( "crit: test[0]" + Environment.NewLine + - " [null]" + Environment.NewLine, + _paddingString + "[null]" + Environment.NewLine, GetMessage(sink.Writes.GetRange(1 * t.WritesPerMsg, t.WritesPerMsg))); Assert.Equal( "crit: test[0]" + Environment.NewLine + - " [null]" + Environment.NewLine + - "System.InvalidOperationException: Invalid value" + Environment.NewLine, + _paddingString + "[null]" + Environment.NewLine + + _paddingString + "System.InvalidOperationException: Invalid value" + Environment.NewLine, GetMessage(sink.Writes.GetRange(2 * t.WritesPerMsg, t.WritesPerMsg))); } @@ -133,12 +210,12 @@ public void DoesNotLog_NewLine_WhenNoExceptionIsProvided() var t = SetUp(); var logger = (ILogger)t.Logger; var sink = t.Sink; - var logMessage = "Route with name 'Default' was not found."; + var logMessage = "Route with name 'Simple' was not found."; var expected1 = @"crit: test[0]" + Environment.NewLine + - " Route with name 'Default' was not found." + Environment.NewLine; + _paddingString + "Route with name 'Simple' was not found." + Environment.NewLine; var expected2 = @"crit: test[10]" + Environment.NewLine + - " Route with name 'Default' was not found." + Environment.NewLine; + _paddingString + "Route with name 'Simple' was not found." + Environment.NewLine; // Act logger.LogCritical(logMessage); @@ -155,7 +232,49 @@ public void DoesNotLog_NewLine_WhenNoExceptionIsProvided() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [InlineData("Route with name 'Default' was not found.")] + [InlineData(null, 0)] + [InlineData(null, 1)] + [InlineData("missingFormatter", 0)] + [InlineData("missingFormatter", 1)] + public void Options_FormatterNameNull_UsesDeprecatedProperties(string formatterName, int formatNumber) + { + // Arrange + ConsoleLoggerFormat format = (ConsoleLoggerFormat)formatNumber; + var options = new ConsoleLoggerOptions() { FormatterName = formatterName }; + var monitor = new TestOptionsMonitor(options); + var loggerProvider = new ConsoleLoggerProvider(monitor, GetFormatters()); + var logger = (ConsoleLogger)loggerProvider.CreateLogger("Name"); + + // Act + monitor.Set(new ConsoleLoggerOptions() { FormatterName = null, Format = format, TimestampFormat = "HH:mm:ss " }); + + // Assert + switch (format) + { + case ConsoleLoggerFormat.Default: + { + Assert.Null(logger.Options.FormatterName); + Assert.Equal(ConsoleFormatterNames.Simple, logger.Formatter.Name); + var formatter = Assert.IsType(logger.Formatter); + Assert.Equal("HH:mm:ss ", formatter.FormatterOptions.TimestampFormat); + } + break; + case ConsoleLoggerFormat.Systemd: + { + Assert.Null(logger.Options.FormatterName); + Assert.Equal(ConsoleFormatterNames.Systemd, logger.Formatter.Name); + var formatter = Assert.IsType(logger.Formatter); + Assert.Equal("HH:mm:ss ", formatter.FormatterOptions.TimestampFormat); + } + break; + default: + throw new ArgumentOutOfRangeException(nameof(format)); + } + loggerProvider?.Dispose(); + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [InlineData("Route with name 'Simple' was not found.")] public void Writes_NewLine_WhenExceptionIsProvided(string message) { // Arrange @@ -168,7 +287,7 @@ public void Writes_NewLine_WhenExceptionIsProvided(string message) var expectedMessage = _paddingString + message + Environment.NewLine; var expectedExceptionMessage = - exception.ToString() + Environment.NewLine; + _paddingString + exception.ToString() + Environment.NewLine; // Act logger.LogCritical(eventId, exception, message); @@ -224,7 +343,7 @@ public void WriteCritical_LogsCorrectColors() // Assert Assert.Equal(2, sink.Writes.Count); var write = sink.Writes[0]; - Assert.Equal(ConsoleColor.Red, write.BackgroundColor); + Assert.Equal(ConsoleColor.DarkRed, write.BackgroundColor); Assert.Equal(ConsoleColor.White, write.ForegroundColor); write = sink.Writes[1]; Assert.Equal(TestConsole.DefaultBackgroundColor, write.BackgroundColor); @@ -245,7 +364,7 @@ public void WriteError_LogsCorrectColors() // Assert Assert.Equal(2, sink.Writes.Count); var write = sink.Writes[0]; - Assert.Equal(ConsoleColor.Red, write.BackgroundColor); + Assert.Equal(ConsoleColor.DarkRed, write.BackgroundColor); Assert.Equal(ConsoleColor.Black, write.ForegroundColor); write = sink.Writes[1]; Assert.Equal(TestConsole.DefaultBackgroundColor, write.BackgroundColor); @@ -352,7 +471,7 @@ public void WriteAllLevelsDisabledColors_LogsNoColors() } // Assert - Assert.Equal(2 * levelSequence, sink.Writes.Count); + Assert.Equal(levelSequence, sink.Writes.Count); foreach (ConsoleContext write in sink.Writes) { Assert.Null(write.ForegroundColor); @@ -362,7 +481,7 @@ public void WriteAllLevelsDisabledColors_LogsNoColors() [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [MemberData(nameof(FormatsAndLevels))] - public void WriteCore_LogsCorrectTimestamp(ConsoleLoggerFormat format, LogLevel level) + public void Log_LogsCorrectTimestamp(ConsoleLoggerFormat format, LogLevel level) { // Arrange var t = SetUp(new ConsoleLoggerOptions { TimestampFormat = "yyyy-MM-ddTHH:mm:sszz ", Format = format, UseUtcTimestamp = false }); @@ -464,9 +583,9 @@ public void WriteCore_LogsCorrectMessages(ConsoleLoggerFormat format, LogLevel l Assert.Equal(2, sink.Writes.Count); Assert.Equal( levelPrefix + ": test[0]" + Environment.NewLine + - " This is a test, and {curly braces} are just fine!" + Environment.NewLine + - "System.Exception: Exception message" + Environment.NewLine + - "with a second line" + Environment.NewLine, + _paddingString + "This is a test, and {curly braces} are just fine!" + Environment.NewLine + + _paddingString + "System.Exception: Exception message" + Environment.NewLine + + _paddingString + "with a second line" + Environment.NewLine, GetMessage(sink.Writes)); } break; @@ -662,6 +781,8 @@ public void WritingNestedScopes_LogsExpectedMessage(ConsoleLoggerFormat format) { // Assert Assert.Equal(2, sink.Writes.Count); + var formatter = Assert.IsType(logger.Formatter); + Assert.True(formatter.FormatterOptions.IncludeScopes); // scope var write = sink.Writes[1]; Assert.Equal(header + Environment.NewLine @@ -675,6 +796,8 @@ public void WritingNestedScopes_LogsExpectedMessage(ConsoleLoggerFormat format) { // Assert Assert.Single(sink.Writes); + var formatter = Assert.IsType(logger.Formatter); + Assert.True(formatter.FormatterOptions.IncludeScopes); // scope var write = sink.Writes[0]; Assert.Equal(levelPrefix + header + " " + scope + " " + message + Environment.NewLine, write.Message); @@ -811,13 +934,13 @@ public void ConsoleLoggerLogsToError_WhenOverErrorLevel(ConsoleLoggerFormat form Assert.Equal(2, sink.Writes.Count); Assert.Equal( "info: test[0]" + Environment.NewLine + - " Info" + Environment.NewLine, + _paddingString + "Info" + Environment.NewLine, GetMessage(sink.Writes)); Assert.Equal(2, errorSink.Writes.Count); Assert.Equal( "warn: test[0]" + Environment.NewLine + - " Warn" + Environment.NewLine, + _paddingString + "Warn" + Environment.NewLine, GetMessage(errorSink.Writes)); } break; @@ -863,8 +986,8 @@ public void WriteCore_NullMessageWithException(ConsoleLoggerFormat format, LogLe Assert.Equal(2, sink.Writes.Count); Assert.Equal( levelPrefix + ": test[0]" + Environment.NewLine + - "System.Exception: Exception message" + Environment.NewLine + - "with a second line" + Environment.NewLine, + _paddingString + "System.Exception: Exception message" + Environment.NewLine + + _paddingString + "with a second line" + Environment.NewLine, GetMessage(sink.Writes)); } break; @@ -906,8 +1029,8 @@ public void WriteCore_EmptyMessageWithException(ConsoleLoggerFormat format, LogL Assert.Equal(2, sink.Writes.Count); Assert.Equal( levelPrefix + ": test[0]" + Environment.NewLine + - "System.Exception: Exception message" + Environment.NewLine + - "with a second line" + Environment.NewLine, + _paddingString + "System.Exception: Exception message" + Environment.NewLine + + _paddingString + "with a second line" + Environment.NewLine, GetMessage(sink.Writes)); } break; @@ -948,7 +1071,7 @@ public void WriteCore_MessageWithNullException(ConsoleLoggerFormat format, LogLe Assert.Equal(2, sink.Writes.Count); Assert.Equal( levelPrefix + ": test[0]" + Environment.NewLine + - " This is a test, and {curly braces} are just fine!" + Environment.NewLine, + _paddingString + "This is a test, and {curly braces} are just fine!" + Environment.NewLine, GetMessage(sink.Writes)); } break; @@ -992,9 +1115,13 @@ public void LogAfterDisposeWritesLog() var console = new TestConsole(sink); var processor = new ConsoleLoggerProcessor(); processor.Console = console; + var formatters = new ConcurrentDictionary(GetFormatters().ToDictionary(f => f.Name)); var logger = new ConsoleLogger(_loggerName, loggerProcessor: processor); logger.Options = new ConsoleLoggerOptions(); + Assert.Null(logger.Options.FormatterName); + logger.Formatter = formatters[ConsoleFormatterNames.Simple]; + UpdateFormatterOptions(logger.Formatter, logger.Options); // Act processor.Dispose(); logger.LogInformation("Logging after dispose"); @@ -1031,8 +1158,13 @@ public void ConsoleLoggerOptions_DisableColors_IsAppliedToLoggers() Assert.False(logger.Options.DisableColors); } - [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + public void ConsoleLoggerOptions_InvalidFormat_Throws() + { + Assert.Throws(() => new ConsoleLoggerOptions() { Format = (ConsoleLoggerFormat)10 }); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] public void ConsoleLoggerOptions_DisableColors_IsReadFromLoggingConfiguration() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { new KeyValuePair("Console:DisableColors", "true") }).Build(); @@ -1063,8 +1195,7 @@ public void ConsoleLoggerOptions_TimeStampFormat_IsReloaded() Assert.Equal("yyyyMMddHHmmss", logger.Options.TimestampFormat); } - [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] public void ConsoleLoggerOptions_TimeStampFormat_IsReadFromLoggingConfiguration() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { new KeyValuePair("Console:TimeStampFormat", "yyyyMMddHHmmss") }).Build(); @@ -1109,8 +1240,7 @@ public void ConsoleLoggerOptions_IncludeScopes_IsAppliedToLoggers() Assert.False(logger.Options.IncludeScopes); } - [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] public void ConsoleLoggerOptions_LogAsErrorLevel_IsReadFromLoggingConfiguration() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { new KeyValuePair("Console:LogToStandardErrorThreshold", "Warning") }).Build(); @@ -1155,8 +1285,7 @@ public void ConsoleLoggerOptions_UseUtcTimestamp_IsAppliedToLoggers() Assert.True(logger.Options.UseUtcTimestamp); } - [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] public void ConsoleLoggerOptions_IncludeScopes_IsReadFromLoggingConfiguration() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { new KeyValuePair("Console:IncludeScopes", "true") }).Build(); @@ -1171,6 +1300,8 @@ public void ConsoleLoggerOptions_IncludeScopes_IsReadFromLoggingConfiguration() var consoleLoggerProvider = Assert.IsType(loggerProvider); var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category"); Assert.NotNull(logger.ScopeProvider); + var formatter = Assert.IsType(logger.Formatter); + Assert.True(formatter.FormatterOptions.IncludeScopes); } public static TheoryData FormatsAndLevels @@ -1237,18 +1368,17 @@ private string CreateHeader(ConsoleLoggerFormat format, int eventId = 0) throw new ArgumentOutOfRangeException(nameof(format)); } } + } - - private class TestLoggerProcessor : ConsoleLoggerProcessor + internal class TestLoggerProcessor : ConsoleLoggerProcessor + { + public TestLoggerProcessor() { - public TestLoggerProcessor() - { - } + } - public override void EnqueueMessage(LogMessageEntry message) - { - WriteMessage(message); - } + public override void EnqueueMessage(LogMessageEntry message) + { + WriteMessage(message); } } @@ -1279,3 +1409,4 @@ public void Set(ConsoleLoggerOptions options) } } } +#pragma warning restore CS0618 diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/JsonConsoleFormatterTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/JsonConsoleFormatterTests.cs new file mode 100644 index 000000000000..f5e536d94adb --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/JsonConsoleFormatterTests.cs @@ -0,0 +1,48 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Text.Json; +using Microsoft.Extensions.Logging.Abstractions; +using Microsoft.Extensions.Logging.Console; +using Microsoft.Extensions.Logging.Test.Console; +using Xunit; + +namespace Microsoft.Extensions.Logging.Console.Test +{ + public class JsonConsoleFormatterTests : ConsoleFormatterTests + { + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + public void NoLogScope_DoesNotWriteAnyScopeContentToOutput_Json() + { + // Arrange + var t = ConsoleFormatterTests.SetUp( + new ConsoleLoggerOptions { FormatterName = ConsoleFormatterNames.Json }, + new SimpleConsoleFormatterOptions { IncludeScopes = true }, + new ConsoleFormatterOptions { IncludeScopes = true }, + new JsonConsoleFormatterOptions { + IncludeScopes = true, + JsonWriterOptions = new JsonWriterOptions() { Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping } + }); + var logger = t.Logger; + var sink = t.Sink; + + // Act + using (logger.BeginScope("Scope with named parameter {namedParameter}", 123)) + using (logger.BeginScope("SimpleScope")) + logger.Log(LogLevel.Warning, 0, "Message with {args}", 73, _defaultFormatter); + + // Assert + Assert.Equal(1, sink.Writes.Count); + var write = sink.Writes[0]; + Assert.Equal(TestConsole.DefaultBackgroundColor, write.BackgroundColor); + Assert.Equal(TestConsole.DefaultForegroundColor, write.ForegroundColor); + Assert.Contains("Message with {args}", write.Message); + Assert.Contains("73", write.Message); + Assert.Contains("{OriginalFormat}", write.Message); + Assert.Contains("namedParameter", write.Message); + Assert.Contains("123", write.Message); + Assert.Contains("SimpleScope", write.Message); + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests.csproj b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests.csproj new file mode 100644 index 000000000000..2524f77b4b46 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests.csproj @@ -0,0 +1,13 @@ + + + + $(NetCoreAppCurrent);$(NetFrameworkCurrent) + true + true + + + + + + + \ No newline at end of file diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/SimpleConsoleFormatterTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/SimpleConsoleFormatterTests.cs new file mode 100644 index 000000000000..d92c8af95148 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/SimpleConsoleFormatterTests.cs @@ -0,0 +1,96 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using Microsoft.Extensions.Logging.Test.Console; +using Xunit; + +namespace Microsoft.Extensions.Logging.Console.Test +{ + public class SimpleConsoleFormatterTests : ConsoleFormatterTests + { + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + public void Log_WritingScopes_LogsWithCorrectColors() + { + // Arrange + var t = SetUp( + new ConsoleLoggerOptions { FormatterName = ConsoleFormatterNames.Simple }, + new SimpleConsoleFormatterOptions { IncludeScopes = true } + ); + var logger = t.Logger; + var sink = t.Sink; + var id = Guid.NewGuid(); + var scopeMessage = "RequestId: {RequestId}"; + + // Act + using (logger.BeginScope(scopeMessage, id)) + { + logger.Log(LogLevel.Information, 0, _state, null, _defaultFormatter); + } + + // Assert + Assert.Equal(2, sink.Writes.Count); + var write = sink.Writes[0]; + Assert.Equal(ConsoleColor.Black, write.BackgroundColor); + Assert.Equal(ConsoleColor.DarkGreen, write.ForegroundColor); + write = sink.Writes[1]; + Assert.Equal(TestConsole.DefaultBackgroundColor, write.BackgroundColor); + Assert.Equal(TestConsole.DefaultForegroundColor, write.ForegroundColor); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + public void Log_NoLogScope_DoesNotWriteAnyScopeContentToOutput() + { + // Arrange + var t = SetUp( + new ConsoleLoggerOptions { FormatterName = ConsoleFormatterNames.Simple }, + new SimpleConsoleFormatterOptions { IncludeScopes = true } + ); + var logger = t.Logger; + var sink = t.Sink; + + // Act + logger.Log(LogLevel.Warning, 0, _state, null, _defaultFormatter); + + // Assert + Assert.Equal(2, sink.Writes.Count); + var write = sink.Writes[0]; + Assert.Equal(ConsoleColor.Black, write.BackgroundColor); + Assert.Equal(ConsoleColor.Yellow, write.ForegroundColor); + write = sink.Writes[1]; + Assert.Equal(TestConsole.DefaultBackgroundColor, write.BackgroundColor); + Assert.Equal(TestConsole.DefaultForegroundColor, write.ForegroundColor); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + public void Log_SingleLine_LogsWhenMessageIsNotProvided() + { + // Arrange + var t = SetUp( + new ConsoleLoggerOptions { FormatterName = ConsoleFormatterNames.Simple }, + new SimpleConsoleFormatterOptions { SingleLine = true } + ); + var logger = (ILogger)t.Logger; + var sink = t.Sink; + var exception = new InvalidOperationException("Invalid value"); + + // Act + logger.LogCritical(eventId: 0, exception: null, message: null); + logger.LogCritical(eventId: 0, message: null); + logger.LogCritical(eventId: 0, message: null, exception: exception); + + // Assert + Assert.Equal(6, sink.Writes.Count); + Assert.Equal( + "crit: test[0]" + " " + "[null]" + Environment.NewLine, + GetMessage(sink.Writes.GetRange(0 * t.WritesPerMsg, t.WritesPerMsg))); + Assert.Equal( + "crit: test[0]" + " " + "[null]" + Environment.NewLine, + GetMessage(sink.Writes.GetRange(1 * t.WritesPerMsg, t.WritesPerMsg))); + + Assert.Equal( + "crit: test[0]" + " " + "[null]" + "System.InvalidOperationException: Invalid value" + Environment.NewLine, + GetMessage(sink.Writes.GetRange(2 * t.WritesPerMsg, t.WritesPerMsg))); + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/TestFormatterOptionsMonitor.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/TestFormatterOptionsMonitor.cs new file mode 100644 index 000000000000..90ee21e3439e --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/TestFormatterOptionsMonitor.cs @@ -0,0 +1,34 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using Microsoft.Extensions.Options; + +namespace Microsoft.Extensions.Logging.Console.Test +{ + internal class TestFormatterOptionsMonitor : IOptionsMonitor where TOptions : ConsoleFormatterOptions + { + private TOptions _options; + private event Action _onChange; + public TestFormatterOptionsMonitor(TOptions options) + { + _options = options; + } + + public TOptions Get(string name) => _options; + + public IDisposable OnChange(Action listener) + { + _onChange += listener; + return null; + } + + public TOptions CurrentValue => _options; + + public void Set(TOptions options) + { + _options = options; + _onChange?.Invoke(options, ""); + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/TextWriterExtensionsTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/TextWriterExtensionsTests.cs new file mode 100644 index 000000000000..3c6520ebb9bf --- /dev/null +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/TextWriterExtensionsTests.cs @@ -0,0 +1,79 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.IO; +using Xunit; + +namespace Microsoft.Extensions.Logging.Console.Test +{ + public class TextWriterExtensionsTests + { + [Fact] + public void WriteColoredMessage_WithForegroundEscapeCode_AndNoBackgroundColorSpecified() + { + // Arrange + var message = "Request received"; + var expectedMessage = AnsiParser.GetForegroundColorEscapeCode(ConsoleColor.DarkGreen) + + message + + "\x1B[39m\x1B[22m"; //resets foreground color + var textWriter = new StringWriter(); + + // Act + textWriter.WriteColoredMessage(message, background: null, foreground: ConsoleColor.DarkGreen); + + // Assert + Assert.Equal(expectedMessage, textWriter.ToString()); + } + + [Fact] + public void WriteColoredMessage_WithBackgroundEscapeCode_AndNoForegroundColorSpecified() + { + // Arrange + var message = "Request received"; + var expectedMessage = AnsiParser.GetBackgroundColorEscapeCode(ConsoleColor.Red) + + message + + "\x1B[49m"; //resets background color + var textWriter = new StringWriter(); + + // Act + textWriter.WriteColoredMessage(message, background: ConsoleColor.Red, foreground: null); + + // Assert + Assert.Equal(expectedMessage, textWriter.ToString()); + } + + [Fact] + public void WriteColoredMessage_InOrder_WhenBothForegroundOrBackgroundColorsSpecified() + { + // Arrange + var message = "Request received"; + var expectedMessage = AnsiParser.GetBackgroundColorEscapeCode(ConsoleColor.Red) + + AnsiParser.GetForegroundColorEscapeCode(ConsoleColor.DarkGreen) + + "Request received" + + "\x1B[39m\x1B[22m" //resets foreground color + + "\x1B[49m"; //resets background color + var textWriter = new StringWriter(); + + // Act + textWriter.WriteColoredMessage(message, ConsoleColor.Red, ConsoleColor.DarkGreen); + + // Assert + Assert.Equal(expectedMessage, textWriter.ToString()); + } + + [Fact] + public void WriteColoredMessage_NullColors_NoAnsiEmbedded() + { + // Arrange + var message = "Request received"; + var textWriter = new StringWriter(); + + // Act + textWriter.WriteColoredMessage(message, null, null); + + // Assert + Assert.Equal(message, textWriter.ToString()); + } + } +} diff --git a/src/libraries/Microsoft.Extensions.Logging.Debug/src/Microsoft.Extensions.Logging.Debug.csproj b/src/libraries/Microsoft.Extensions.Logging.Debug/src/Microsoft.Extensions.Logging.Debug.csproj index 048869e72d2f..d1d2c4274e5b 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Debug/src/Microsoft.Extensions.Logging.Debug.csproj +++ b/src/libraries/Microsoft.Extensions.Logging.Debug/src/Microsoft.Extensions.Logging.Debug.csproj @@ -1,7 +1,7 @@ - $(NetCoreAppCurrent);netstandard2.0 + $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent) true @@ -22,4 +22,9 @@ + + + + + diff --git a/src/libraries/Microsoft.Extensions.Logging.EventLog/src/Microsoft.Extensions.Logging.EventLog.csproj b/src/libraries/Microsoft.Extensions.Logging.EventLog/src/Microsoft.Extensions.Logging.EventLog.csproj index 159cbede9d37..fca2aa1bcf1a 100644 --- a/src/libraries/Microsoft.Extensions.Logging.EventLog/src/Microsoft.Extensions.Logging.EventLog.csproj +++ b/src/libraries/Microsoft.Extensions.Logging.EventLog/src/Microsoft.Extensions.Logging.EventLog.csproj @@ -2,6 +2,7 @@ $(NetCoreAppCurrent);$(NetFrameworkCurrent);net461;netstandard2.0;netstandard2.1 + true true diff --git a/src/libraries/Microsoft.Extensions.Logging.EventSource/src/Microsoft.Extensions.Logging.EventSource.csproj b/src/libraries/Microsoft.Extensions.Logging.EventSource/src/Microsoft.Extensions.Logging.EventSource.csproj index ac39c2475843..d55f53f867f6 100644 --- a/src/libraries/Microsoft.Extensions.Logging.EventSource/src/Microsoft.Extensions.Logging.EventSource.csproj +++ b/src/libraries/Microsoft.Extensions.Logging.EventSource/src/Microsoft.Extensions.Logging.EventSource.csproj @@ -1,7 +1,8 @@ - $(NetCoreAppCurrent);netstandard2.0 + $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent) + true true true @@ -30,8 +31,13 @@ - + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/Microsoft.Extensions.Logging.TraceSource.csproj b/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/Microsoft.Extensions.Logging.TraceSource.csproj index cfdb67e93d30..ca883dd4c7dd 100644 --- a/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/Microsoft.Extensions.Logging.TraceSource.csproj +++ b/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/Microsoft.Extensions.Logging.TraceSource.csproj @@ -1,7 +1,8 @@ - $(NetCoreAppCurrent);netstandard2.0 + $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent) + true true @@ -18,4 +19,9 @@ + + + + + diff --git a/src/libraries/Microsoft.Extensions.Logging/src/Microsoft.Extensions.Logging.csproj b/src/libraries/Microsoft.Extensions.Logging/src/Microsoft.Extensions.Logging.csproj index 6c22af6efd16..5d4787254c6b 100644 --- a/src/libraries/Microsoft.Extensions.Logging/src/Microsoft.Extensions.Logging.csproj +++ b/src/libraries/Microsoft.Extensions.Logging/src/Microsoft.Extensions.Logging.csproj @@ -1,7 +1,8 @@ - $(NetCoreAppCurrent);netstandard2.0 + $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent) + true true @@ -29,7 +30,7 @@ - + @@ -37,4 +38,11 @@ + + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/AnsiLogConsoleTest.cs b/src/libraries/Microsoft.Extensions.Logging/tests/Common/AnsiLogConsoleTest.cs deleted file mode 100644 index cc84f5d03bd5..000000000000 --- a/src/libraries/Microsoft.Extensions.Logging/tests/Common/AnsiLogConsoleTest.cs +++ /dev/null @@ -1,179 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using Microsoft.Extensions.Logging.Console; -using Xunit; - -namespace Microsoft.Extensions.Logging -{ - public class AnsiLogConsoleTest - { - [Fact] - public void DoesNotAddNewLine() - { - // Arrange - var systemConsole = new TestAnsiSystemConsole(); - var console = new AnsiLogConsole(systemConsole); - var message = "Request received"; - var expectedMessage = message; - - // Act - console.Write(message, background: null, foreground: null); - console.Flush(); - - // Assert - Assert.Equal(expectedMessage, systemConsole.Message); - } - - [Fact] - public void NotCallingFlush_DoesNotWriteData_ToSystemConsole() - { - // Arrange - var systemConsole = new TestAnsiSystemConsole(); - var console = new AnsiLogConsole(systemConsole); - var message = "Request received"; - var expectedMessage = message + Environment.NewLine; - - // Act - console.WriteLine(message, background: null, foreground: null); - - // Assert - Assert.Null(systemConsole.Message); - } - - [Fact] - public void CallingFlush_ClearsData_FromOutputBuilder() - { - // Arrange - var systemConsole = new TestAnsiSystemConsole(); - var console = new AnsiLogConsole(systemConsole); - var message = "Request received"; - var expectedMessage = message + Environment.NewLine; - - // Act - console.WriteLine(message, background: null, foreground: null); - console.Flush(); - console.WriteLine(message, background: null, foreground: null); - console.Flush(); - - // Assert - Assert.Equal(expectedMessage, systemConsole.Message); - } - - [Fact] - public void WritesMessage_WithoutEscapeCodes_AndNoForegroundOrBackgroundColorsSpecified() - { - // Arrange - var systemConsole = new TestAnsiSystemConsole(); - var console = new AnsiLogConsole(systemConsole); - var message = "Request received"; - var expectedMessage = message + Environment.NewLine; - - // Act - console.WriteLine(message, background: null, foreground: null); - console.Flush(); - - // Assert - Assert.Equal(expectedMessage, systemConsole.Message); - } - - [Fact] - public void WritesMessage_WithForegroundEscapeCode_AndNoBackgroundColorSpecified() - { - // Arrange - var systemConsole = new TestAnsiSystemConsole(); - var console = new AnsiLogConsole(systemConsole); - var message = "Request received"; - var expectedMessage = GetForegroundColorEscapeCode(ConsoleColor.DarkGreen) - + message - + "\x1B[39m\x1B[22m"; //resets foreground color - - // Act - console.WriteLine(message, background: null, foreground: ConsoleColor.DarkGreen); - console.Flush(); - - // Assert - Assert.Equal(expectedMessage + Environment.NewLine, systemConsole.Message); - } - - [Fact] - public void WritesMessage_WithBackgroundEscapeCode_AndNoForegroundColorSpecified() - { - // Arrange - var systemConsole = new TestAnsiSystemConsole(); - var console = new AnsiLogConsole(systemConsole); - var message = "Request received"; - var expectedMessage = GetBackgroundColorEscapeCode(ConsoleColor.Red) - + message - + "\x1B[49m"; //resets background color - - // Act - console.WriteLine(message, background: ConsoleColor.Red, foreground: null); - console.Flush(); - - // Assert - Assert.Equal(expectedMessage + Environment.NewLine, systemConsole.Message); - } - - [Fact] - public void WriteMessage_InOrder_WhenBothForegroundOrBackgroundColorsSpecified() - { - // Arrange - var systemConsole = new TestAnsiSystemConsole(); - var console = new AnsiLogConsole(systemConsole); - var message = "Request received"; - var expectedMessage = GetBackgroundColorEscapeCode(ConsoleColor.Red) - + GetForegroundColorEscapeCode(ConsoleColor.DarkGreen) - + "Request received" - + "\x1B[39m\x1B[22m" //resets foreground color - + "\x1B[49m" //resets background color - + Environment.NewLine; - - // Act - console.WriteLine(message, background: ConsoleColor.Red, foreground: ConsoleColor.DarkGreen); - console.Flush(); - - // Assert - Assert.Equal(expectedMessage, systemConsole.Message); - } - - private class TestAnsiSystemConsole : IAnsiSystemConsole - { - public string Message { get; private set; } - - public void Write(string message) - { - Message = message; - } - } - - private static string GetForegroundColorEscapeCode(ConsoleColor color) - { - switch (color) - { - case ConsoleColor.Red: - return "\x1B[31m"; - case ConsoleColor.DarkGreen: - return "\x1B[32m"; - case ConsoleColor.DarkYellow: - return "\x1B[33m"; - case ConsoleColor.Gray: - return "\x1B[37m"; - default: - return "\x1B[39m"; - } - } - - private static string GetBackgroundColorEscapeCode(ConsoleColor color) - { - switch (color) - { - case ConsoleColor.Red: - return "\x1B[41m"; - default: - return "\x1B[49m"; - } - } - } -} diff --git a/src/libraries/Microsoft.Extensions.Options.ConfigurationExtensions/src/Microsoft.Extensions.Options.ConfigurationExtensions.csproj b/src/libraries/Microsoft.Extensions.Options.ConfigurationExtensions/src/Microsoft.Extensions.Options.ConfigurationExtensions.csproj index 9feb20a52838..3d9e3c322e96 100644 --- a/src/libraries/Microsoft.Extensions.Options.ConfigurationExtensions/src/Microsoft.Extensions.Options.ConfigurationExtensions.csproj +++ b/src/libraries/Microsoft.Extensions.Options.ConfigurationExtensions/src/Microsoft.Extensions.Options.ConfigurationExtensions.csproj @@ -1,7 +1,8 @@ - $(NetCoreAppCurrent);netstandard2.0 + $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent) + true true @@ -18,4 +19,8 @@ + + + + diff --git a/src/libraries/Microsoft.Extensions.Options.DataAnnotations/src/Microsoft.Extensions.Options.DataAnnotations.csproj b/src/libraries/Microsoft.Extensions.Options.DataAnnotations/src/Microsoft.Extensions.Options.DataAnnotations.csproj index 8dadd0c88af1..9adaadcc69d5 100644 --- a/src/libraries/Microsoft.Extensions.Options.DataAnnotations/src/Microsoft.Extensions.Options.DataAnnotations.csproj +++ b/src/libraries/Microsoft.Extensions.Options.DataAnnotations/src/Microsoft.Extensions.Options.DataAnnotations.csproj @@ -1,7 +1,8 @@ - $(NetCoreAppCurrent);netstandard2.0 + $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent) + true true @@ -20,4 +21,9 @@ + + + + + diff --git a/src/libraries/Microsoft.Extensions.Options/src/Microsoft.Extensions.Options.csproj b/src/libraries/Microsoft.Extensions.Options/src/Microsoft.Extensions.Options.csproj index fcc42385829f..eda46678ac44 100644 --- a/src/libraries/Microsoft.Extensions.Options/src/Microsoft.Extensions.Options.csproj +++ b/src/libraries/Microsoft.Extensions.Options/src/Microsoft.Extensions.Options.csproj @@ -1,7 +1,8 @@ - $(NetCoreAppCurrent);netstandard2.0 + $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent) + true true @@ -19,8 +20,13 @@ - + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Options/src/OptionsServiceCollectionExtensions.cs b/src/libraries/Microsoft.Extensions.Options/src/OptionsServiceCollectionExtensions.cs index f91460871b76..2a1aec0395ab 100644 --- a/src/libraries/Microsoft.Extensions.Options/src/OptionsServiceCollectionExtensions.cs +++ b/src/libraries/Microsoft.Extensions.Options/src/OptionsServiceCollectionExtensions.cs @@ -133,7 +133,9 @@ public static IServiceCollection PostConfigureAll(this IServiceCollect => services.PostConfigure(name: null, configureOptions: configureOptions); /// - /// Registers a type that will have all of its I[Post]ConfigureOptions registered. + /// Registers a type that will have all of its , + /// , and + /// registered. /// /// The type that will configure options. /// The to add the services to. @@ -144,24 +146,30 @@ public static IServiceCollection ConfigureOptions(this IServi private static bool IsAction(Type type) => (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(Action<>)); - private static IEnumerable FindIConfigureOptions(Type type) + private static IEnumerable FindConfigurationServices(Type type) { - IEnumerable serviceTypes = type.GetTypeInfo().ImplementedInterfaces - .Where(t => t.GetTypeInfo().IsGenericType && - (t.GetGenericTypeDefinition() == typeof(IConfigureOptions<>) - || t.GetGenericTypeDefinition() == typeof(IPostConfigureOptions<>))); + IEnumerable serviceTypes = type + .GetTypeInfo() + .ImplementedInterfaces + .Where(t => t.GetTypeInfo().IsGenericType) + .Where(t => + t.GetGenericTypeDefinition() == typeof(IConfigureOptions<>) || + t.GetGenericTypeDefinition() == typeof(IPostConfigureOptions<>) || + t.GetGenericTypeDefinition() == typeof(IValidateOptions<>)); if (!serviceTypes.Any()) { throw new InvalidOperationException( IsAction(type) - ? SR.Error_NoIConfigureOptionsAndAction - : SR.Error_NoIConfigureOptions); + ? SR.Error_NoConfigurationServicesAndAction + : SR.Error_NoConfigurationServices); } return serviceTypes; } /// - /// Registers a type that will have all of its I[Post]ConfigureOptions registered. + /// Registers a type that will have all of its , + /// , and + /// registered. /// /// The to add the services to. /// The type that will configure options. @@ -169,7 +177,7 @@ private static IEnumerable FindIConfigureOptions(Type type) public static IServiceCollection ConfigureOptions(this IServiceCollection services, Type configureType) { services.AddOptions(); - IEnumerable serviceTypes = FindIConfigureOptions(configureType); + IEnumerable serviceTypes = FindConfigurationServices(configureType); foreach (Type serviceType in serviceTypes) { services.AddTransient(serviceType, configureType); @@ -178,7 +186,9 @@ public static IServiceCollection ConfigureOptions(this IServiceCollection servic } /// - /// Registers an object that will have all of its I[Post]ConfigureOptions registered. + /// Registers an object that will have all of its , + /// , and + /// registered. /// /// The to add the services to. /// The instance that will configure options. @@ -186,7 +196,7 @@ public static IServiceCollection ConfigureOptions(this IServiceCollection servic public static IServiceCollection ConfigureOptions(this IServiceCollection services, object configureInstance) { services.AddOptions(); - IEnumerable serviceTypes = FindIConfigureOptions(configureInstance.GetType()); + IEnumerable serviceTypes = FindConfigurationServices(configureInstance.GetType()); foreach (Type serviceType in serviceTypes) { services.AddSingleton(serviceType, configureInstance); diff --git a/src/libraries/Microsoft.Extensions.Options/src/Resources/Strings.resx b/src/libraries/Microsoft.Extensions.Options/src/Resources/Strings.resx index 7804a76ee22c..60292ad6dbca 100644 --- a/src/libraries/Microsoft.Extensions.Options/src/Resources/Strings.resx +++ b/src/libraries/Microsoft.Extensions.Options/src/Resources/Strings.resx @@ -129,10 +129,10 @@ Cannot create instance of type '{0}' because it is missing a public parameterless constructor. - - No IConfigureOptions<> or IPostConfigureOptions<> implementations were found. + + No IConfigureOptions<>, IPostConfigureOptions<>, or IValidateOptions<> implementations were found. - - No IConfigureOptions<> or IPostConfigureOptions<> implementations were found, did you mean to call Configure<> or PostConfigure<>? + + No IConfigureOptions<>, IPostConfigureOptions<>, or IValidateOptions<> implementations were found, did you mean to call Configure<> or PostConfigure<>? \ No newline at end of file diff --git a/src/libraries/Microsoft.Extensions.Options/tests/OptionsFactoryTests.cs b/src/libraries/Microsoft.Extensions.Options/tests/OptionsFactoryTests.cs index b432bec729a9..e49c65ed6a01 100644 --- a/src/libraries/Microsoft.Extensions.Options/tests/OptionsFactoryTests.cs +++ b/src/libraries/Microsoft.Extensions.Options/tests/OptionsFactoryTests.cs @@ -191,7 +191,34 @@ public void CanConfigureOptionsOnlyDefault() Assert.Equal("", factory.Create("anything").Message); } - public class UberBothSetup : IConfigureNamedOptions, IConfigureNamedOptions, IPostConfigureOptions, IPostConfigureOptions + public class FakeOptionsValidation : IValidateOptions + { + public ValidateOptionsResult Validate(string name, FakeOptions options) + { + return ValidateOptionsResult.Fail("Hello world"); + } + } + + [Fact] + public void CanValidateOptionsWithConfigureOptions() + { + var factory = new ServiceCollection() + .ConfigureOptions() + .BuildServiceProvider() + .GetRequiredService>(); + + var ex = Assert.Throws(() => factory.Create(Options.DefaultName)); + var message = Assert.Single(ex.Failures); + Assert.Equal("Hello world", message); + } + + public class UberSetup + : IConfigureNamedOptions + , IConfigureNamedOptions + , IPostConfigureOptions + , IPostConfigureOptions + , IValidateOptions + , IValidateOptions { public void Configure(string name, FakeOptions options) => options.Message += "["+name; @@ -203,18 +230,38 @@ public void Configure(string name, FakeOptions2 options) public void Configure(FakeOptions2 options) => Configure(Options.DefaultName, options); + public void PostConfigure(string name, FakeOptions options) + => options.Message += "]"; + public void PostConfigure(string name, FakeOptions2 options) => options.Message += "]]"; - public void PostConfigure(string name, FakeOptions options) - => options.Message += "]"; + public ValidateOptionsResult Validate(string name, FakeOptions options) + { + if (options.Message == "[foo]") + { + return ValidateOptionsResult.Fail("Invalid message '[foo]'"); + } + + return ValidateOptionsResult.Success; + } + + public ValidateOptionsResult Validate(string name, FakeOptions2 options) + { + if (options.Message.Contains("[[bar]]")) + { + return ValidateOptionsResult.Fail($"Invalid message '{options.Message}'"); + } + + return ValidateOptionsResult.Success; + } } [Fact] public void CanConfigureTwoOptionsWithConfigureOptions() { var services = new ServiceCollection(); - services.ConfigureOptions(); + services.ConfigureOptions(); var sp = services.BuildServiceProvider(); var factory = sp.GetRequiredService>(); @@ -222,8 +269,17 @@ public void CanConfigureTwoOptionsWithConfigureOptions() Assert.Equal("[]", factory.Create(Options.DefaultName).Message); Assert.Equal("[hao]", factory.Create("hao").Message); + + var ex1 = Assert.Throws(() => factory.Create("foo")); + var failure1 = Assert.Single(ex1.Failures); + Assert.Equal("Invalid message '[foo]'", failure1); + Assert.Equal("[[]]", factory2.Create(Options.DefaultName).Message); Assert.Equal("[[hao]]", factory2.Create("hao").Message); + + var ex2 = Assert.Throws(() => factory2.Create("bar")); + var failure2 = Assert.Single(ex2.Failures); + Assert.Equal("Invalid message '[[bar]]'", failure2); } [Fact] @@ -231,11 +287,12 @@ public void CanMixConfigureEverything() { var services = new ServiceCollection(); services.ConfigureAll(o => o.Message = "!"); - services.ConfigureOptions(); + services.ConfigureOptions(); services.Configure("#1", o => o.Message += "#"); services.PostConfigureAll(o => o.Message += "|"); services.ConfigureOptions(new PostConfigureOptions("override", o => o.Message = "override")); services.PostConfigure("end", o => o.Message += "_"); + services.ConfigureOptions(new ValidateOptions("fail", o => false, "fail")); var sp = services.BuildServiceProvider(); var factory = sp.GetRequiredService>(); @@ -251,6 +308,18 @@ public void CanMixConfigureEverything() Assert.Equal("![[override]]|", factory2.Create("override").Message); Assert.Equal("[end]_", factory.Create("end").Message); Assert.Equal("![[end]]|", factory2.Create("end").Message); + + var ex1 = Assert.Throws(() => factory.Create("foo")); + var failure1 = Assert.Single(ex1.Failures); + Assert.Equal("Invalid message '[foo]'", failure1); + + var ex2 = Assert.Throws(() => factory2.Create("bar")); + var failure2 = Assert.Single(ex2.Failures); + Assert.Equal("Invalid message '![[bar]]|'", failure2); + + var ex3 = Assert.Throws(() => factory.Create("fail")); + var failure3 = Assert.Single(ex3.Failures); + Assert.Equal("fail", failure3); } [Fact] @@ -259,7 +328,7 @@ public void ConfigureOptionsThrowsWithAction() var services = new ServiceCollection(); Action act = o => o.Message = "whatev"; var error = Assert.Throws(() => services.ConfigureOptions(act)); - Assert.Equal("No IConfigureOptions<> or IPostConfigureOptions<> implementations were found, did you mean to call Configure<> or PostConfigure<>?", error.Message); + Assert.Equal("No IConfigureOptions<>, IPostConfigureOptions<>, or IValidateOptions<> implementations were found, did you mean to call Configure<> or PostConfigure<>?", error.Message); } [Fact] @@ -267,7 +336,7 @@ public void ConfigureOptionsThrowsIfNothingFound() { var services = new ServiceCollection(); var error = Assert.Throws(() => services.ConfigureOptions(new object())); - Assert.Equal("No IConfigureOptions<> or IPostConfigureOptions<> implementations were found.", error.Message); + Assert.Equal("No IConfigureOptions<>, IPostConfigureOptions<>, or IValidateOptions<> implementations were found.", error.Message); } } } diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/Microsoft.Extensions.Primitives.csproj b/src/libraries/Microsoft.Extensions.Primitives/src/Microsoft.Extensions.Primitives.csproj index b5de2b4e6f39..bd8c31c27a13 100644 --- a/src/libraries/Microsoft.Extensions.Primitives/src/Microsoft.Extensions.Primitives.csproj +++ b/src/libraries/Microsoft.Extensions.Primitives/src/Microsoft.Extensions.Primitives.csproj @@ -1,6 +1,7 @@ - $(NetCoreAppCurrent);netcoreapp3.0;netstandard2.0 + $(NetCoreAppCurrent);netcoreapp3.0;netstandard2.0;net461;$(NetFrameworkCurrent) + true true true @@ -19,7 +20,7 @@ - + @@ -30,8 +31,12 @@ - + + + + + diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/StringSegment.cs b/src/libraries/Microsoft.Extensions.Primitives/src/StringSegment.cs index 509aaf776a7f..288b0e773b31 100644 --- a/src/libraries/Microsoft.Extensions.Primitives/src/StringSegment.cs +++ b/src/libraries/Microsoft.Extensions.Primitives/src/StringSegment.cs @@ -247,7 +247,7 @@ public override int GetHashCode() { #if NETCOREAPP || NETSTANDARD2_1 return string.GetHashCode(AsSpan()); -#elif NETSTANDARD2_0 +#elif (NETSTANDARD2_0 || NETFRAMEWORK) // This GetHashCode is expensive since it allocates on every call. // However this is required to ensure we retain any behavior (such as hash code randomization) that // string.GetHashCode has. diff --git a/src/libraries/Microsoft.IO.Redist/src/Microsoft.IO.Redist.csproj b/src/libraries/Microsoft.IO.Redist/src/Microsoft.IO.Redist.csproj index 5e8d6bcfed85..41b1e51a0b58 100644 --- a/src/libraries/Microsoft.IO.Redist/src/Microsoft.IO.Redist.csproj +++ b/src/libraries/Microsoft.IO.Redist/src/Microsoft.IO.Redist.csproj @@ -6,6 +6,7 @@ true false annotations + true - + diff --git a/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs b/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs index dd0bd5ceb4d5..7b0bfbcf12dc 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs @@ -771,7 +771,7 @@ internal Conversions() { } public static decimal ToDecimal(string? Value) { throw null; } public static double ToDouble(object? Value) { throw null; } public static double ToDouble(string? Value) { throw null; } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("Value")] public static T ToGenericParameter(object? Value) { throw null; } public static int ToInteger(object? Value) { throw null; } diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/FinancialTests.cs b/src/libraries/Microsoft.VisualBasic.Core/tests/FinancialTests.cs index b5fded0d1a57..3b4ac13ca757 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/FinancialTests.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/FinancialTests.cs @@ -13,7 +13,7 @@ public class FinancialTests // The accuracy to which we can validate some numeric test cases depends on the platform. private static readonly int s_precision = IsArmOrArm64OrAlpine ? 12 : - PlatformDetection.IsNetFramework ? 14 : 15; + (PlatformDetection.IsBrowser || PlatformDetection.IsNetFramework) ? 14 : 15; [Theory] [InlineData(0, 1.0, 1.0, 1.0, 1.0, 0, 0)] diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/ObjectTypeTests.cs b/src/libraries/Microsoft.VisualBasic.Core/tests/ObjectTypeTests.cs index 872d9647d4db..f1e4b8ac6935 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/ObjectTypeTests.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/ObjectTypeTests.cs @@ -342,8 +342,8 @@ public static IEnumerable ObjTst_TestData() yield return new object[] { "a", "a", 0, 0 }; yield return new object[] { "a", "b", -1, -1 }; yield return new object[] { "b", "a", 1, 1 }; - yield return new object[] { "a", "ABC", 32, -1 }; - yield return new object[] { "ABC", "a", -32, 1 }; + yield return new object[] { "a", "ABC", 32, PlatformDetection.IsInvariantGlobalization ? -2 : -1 }; + yield return new object[] { "ABC", "a", -32, PlatformDetection.IsInvariantGlobalization ? 2 : 1 }; yield return new object[] { "abc", "ABC", 32, 0 }; } } diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/StringTypeTests.cs b/src/libraries/Microsoft.VisualBasic.Core/tests/StringTypeTests.cs index cb0fe6c95323..41fc7717c8c0 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/StringTypeTests.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/StringTypeTests.cs @@ -364,25 +364,30 @@ public void MidStmtStr_ArgumentException(string str, int start, int length, stri } [Theory] - [InlineData(null, null, 0, 0)] - [InlineData(null, "", 0, 0)] - [InlineData("", null, 0, 0)] - [InlineData(null, "a", -1, -1)] - [InlineData("a", null, 1, 1)] - [InlineData("", "a", -97, -1)] - [InlineData("a", "", 97, 1)] - [InlineData("a", "a", 0, 0)] - [InlineData("a", "b", -1, -1)] - [InlineData("b", "a", 1, 1)] - [InlineData("a", "ABC", 32, -1)] - [InlineData("ABC", "a", -32, 1)] - [InlineData("abc", "ABC", 32, 0)] + [MemberData(nameof(StrCmp_TestData))] public void StrCmp(string left, string right, int expectedBinaryCompare, int expectedTextCompare) { Assert.Equal(expectedBinaryCompare, StringType.StrCmp(left, right, TextCompare: false)); Assert.Equal(expectedTextCompare, StringType.StrCmp(left, right, TextCompare: true)); } + public static IEnumerable StrCmp_TestData() + { + yield return new object[] { null, null, 0, 0 }; + yield return new object[] { null, "", 0, 0 }; + yield return new object[] { "", null, 0, 0 }; + yield return new object[] { null, "a", -1, -1 }; + yield return new object[] { "a", null, 1, 1 }; + yield return new object[] { "", "a", -97, -1 }; + yield return new object[] { "a", "", 97, 1 }; + yield return new object[] { "a", "a", 0, 0 }; + yield return new object[] { "a", "b", -1, -1 }; + yield return new object[] { "b", "a", 1, 1 }; + yield return new object[] { "a", "ABC", 32, PlatformDetection.IsInvariantGlobalization ? -2 : -1 }; + yield return new object[] { "ABC", "a", -32, PlatformDetection.IsInvariantGlobalization ? 2 : 1 }; + yield return new object[] { "abc", "ABC", 32, 0 }; + } + [Theory] [InlineData(null, null, true, true)] [InlineData("", null, true, true)] diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/StringsTests.cs b/src/libraries/Microsoft.VisualBasic.Core/tests/StringsTests.cs index 2baca766f569..52d7ec1af1b8 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/StringsTests.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/StringsTests.cs @@ -129,7 +129,7 @@ public void Asc_Chr_Invariant(int charCode, int expected) } [ActiveIssue("https://github.com/dotnet/runtime/issues/30419", TargetFrameworkMonikers.NetFramework)] - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [InlineData(0, 0)] [InlineData(33, 33)] [InlineData(172, 0)] diff --git a/src/libraries/Microsoft.Win32.Registry.AccessControl/Directory.Build.props b/src/libraries/Microsoft.Win32.Registry.AccessControl/Directory.Build.props index 63f02a0f817e..33e65b7cb465 100644 --- a/src/libraries/Microsoft.Win32.Registry.AccessControl/Directory.Build.props +++ b/src/libraries/Microsoft.Win32.Registry.AccessControl/Directory.Build.props @@ -2,5 +2,6 @@ Microsoft + true \ No newline at end of file diff --git a/src/libraries/Microsoft.Win32.Registry/Directory.Build.props b/src/libraries/Microsoft.Win32.Registry/Directory.Build.props index 8c72c62fd593..27a4a5522a27 100644 --- a/src/libraries/Microsoft.Win32.Registry/Directory.Build.props +++ b/src/libraries/Microsoft.Win32.Registry/Directory.Build.props @@ -4,5 +4,6 @@ Microsoft true false + true \ No newline at end of file diff --git a/src/libraries/Microsoft.Win32.SystemEvents/Directory.Build.props b/src/libraries/Microsoft.Win32.SystemEvents/Directory.Build.props index bdcfca3b543c..2f8a8940e012 100644 --- a/src/libraries/Microsoft.Win32.SystemEvents/Directory.Build.props +++ b/src/libraries/Microsoft.Win32.SystemEvents/Directory.Build.props @@ -2,5 +2,6 @@ Open + true \ No newline at end of file diff --git a/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft.Win32.SystemEvents.csproj b/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft.Win32.SystemEvents.csproj index 407a37698931..0470f8b07a79 100644 --- a/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft.Win32.SystemEvents.csproj +++ b/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft.Win32.SystemEvents.csproj @@ -113,8 +113,8 @@ - + diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim_internal.h b/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim_internal.h index 929b737a4723..fcb669e0fc6a 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim_internal.h +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim_internal.h @@ -19,11 +19,13 @@ // All ICU headers need to be included here so that all function prototypes are // available before the function pointers are declared below. +#include #include #include #include #include #include +#include #include #include #include @@ -55,6 +57,7 @@ #include "pal_compiler.h" +#if !defined(STATIC_ICU) // List of all functions from the ICU libraries that are used in the System.Globalization.Native.so #define FOR_ALL_UNCONDITIONAL_ICU_FUNCTIONS \ PER_FUNCTION_BLOCK(u_charsToUChars, libicuuc) \ @@ -279,3 +282,5 @@ FOR_ALL_ICU_FUNCTIONS #define usearch_getMatchedLength(...) usearch_getMatchedLength_ptr(__VA_ARGS__) #define usearch_last(...) usearch_last_ptr(__VA_ARGS__) #define usearch_openFromCollator(...) usearch_openFromCollator_ptr(__VA_ARGS__) + +#endif // !defined(STATIC_ICU) diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim_static.c b/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim_static.c new file mode 100644 index 000000000000..41a1956a2743 --- /dev/null +++ b/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim_static.c @@ -0,0 +1,83 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// + +#include +#include +#include "pal_icushim_internal.h" +#include "pal_icushim.h" +#include +#include +#include +#include + +static void log_icu_error(const char* name, UErrorCode status) +{ + const char * statusText = u_errorName(status); + fprintf(stderr, "ICU call %s failed with error #%d '%s'.\n", name, status, statusText); +} + +static void U_CALLCONV icu_trace_data(const void* context, int32_t fnNumber, int32_t level, const char* fmt, va_list args) +{ + char buf[1000]; + utrace_vformat(buf, sizeof(buf), 0, fmt, args); + printf("[ICUDT] %s: %s\n", utrace_functionName(fnNumber), buf); +} + +#ifdef __EMSCRIPTEN__ +#include + +EMSCRIPTEN_KEEPALIVE int32_t mono_wasm_load_icu_data(void * pData); + +EMSCRIPTEN_KEEPALIVE int32_t mono_wasm_load_icu_data(void * pData) +{ + UErrorCode status = 0; + udata_setCommonData(pData, &status); + + if (U_FAILURE(status)) { + log_icu_error("udata_setCommonData", status); + return 0; + } else { + //// Uncomment to enable ICU tracing, + //// see https://github.com/unicode-org/icu/blob/master/docs/userguide/icu_data/tracing.md + // utrace_setFunctions(0, 0, 0, icu_trace_data); + // utrace_setLevel(UTRACE_VERBOSE); + return 1; + } +} +#endif + +int32_t GlobalizationNative_LoadICU(void) +{ + const char* icudir = getenv("DOTNET_ICU_DIR"); + if (icudir) + u_setDataDirectory(icudir); + else + ; // default ICU search path behavior will be used, see http://userguide.icu-project.org/icudata + + UErrorCode status = 0; + UVersionInfo version; + // Request the CLDR version to perform basic ICU initialization and find out + // whether it worked. + ulocdata_getCLDRVersion(version, &status); + + if (U_FAILURE(status)) { + log_icu_error("ulocdata_getCLDRVersion", status); + return 0; + } + + return 1; +} + +void GlobalizationNative_InitICUFunctions(void* icuuc, void* icuin, const char* version, const char* suffix) +{ + // no-op for static +} + +int32_t GlobalizationNative_GetICUVersion(void) +{ + UVersionInfo versionInfo; + u_getVersion(versionInfo); + + return (versionInfo[0] << 24) + (versionInfo[1] << 16) + (versionInfo[2] << 8) + versionInfo[3]; +} diff --git a/src/libraries/Native/Unix/System.Native/pal_interfaceaddresses.c b/src/libraries/Native/Unix/System.Native/pal_interfaceaddresses.c index 6b4b8e14a421..249f1c5464b2 100644 --- a/src/libraries/Native/Unix/System.Native/pal_interfaceaddresses.c +++ b/src/libraries/Native/Unix/System.Native/pal_interfaceaddresses.c @@ -235,6 +235,7 @@ int32_t SystemNative_GetNetworkInterfaces(int32_t * interfaceCount, NetworkInter if (getifaddrs(&head) == -1) { + assert(errno != 0); return -1; } @@ -261,6 +262,7 @@ int32_t SystemNative_GetNetworkInterfaces(int32_t * interfaceCount, NetworkInter void * memoryBlock = calloc((size_t)count, sizeof(NetworkInterfaceInfo)); if (memoryBlock == NULL) { + errno = ENOMEM; return -1; } diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_digest.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_digest.c index 583752112f18..4011e40e66f1 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_digest.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_digest.c @@ -46,7 +46,7 @@ DigestCtx* AppleCryptoNative_DigestCreate(PAL_HashAlgorithm algorithm, int32_t* case PAL_MD5: *pcbDigest = CC_MD5_DIGEST_LENGTH; #pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma clang diagnostic ignored "-Wdeprecated-declarations" CC_MD5_Init(&digestCtx->d.md5); #pragma clang diagnostic pop break; @@ -171,3 +171,58 @@ int32_t AppleCryptoNative_DigestCurrent(const DigestCtx* ctx, uint8_t* pOutput, DigestCtx dup = *ctx; return AppleCryptoNative_DigestFinal(&dup, pOutput, cbOutput); } + +int32_t AppleCryptoNative_DigestOneShot(PAL_HashAlgorithm algorithm, uint8_t* pBuf, int32_t cbBuf, uint8_t* pOutput, int32_t cbOutput, int32_t* pcbDigest) +{ + if (pOutput == NULL || cbOutput <= 0 || pcbDigest == NULL) + return -1; + + switch (algorithm) + { + case PAL_SHA1: + *pcbDigest = CC_SHA1_DIGEST_LENGTH; + if (cbOutput < CC_SHA1_DIGEST_LENGTH) + { + return -1; + } + CC_SHA1(pBuf, cbBuf, pOutput); + return 1; + case PAL_SHA256: + *pcbDigest = CC_SHA256_DIGEST_LENGTH; + if (cbOutput < CC_SHA256_DIGEST_LENGTH) + { + return -1; + } + CC_SHA256(pBuf, cbBuf, pOutput); + return 1; + case PAL_SHA384: + *pcbDigest = CC_SHA384_DIGEST_LENGTH; + if (cbOutput < CC_SHA384_DIGEST_LENGTH) + { + return -1; + } + CC_SHA384(pBuf, cbBuf, pOutput); + return 1; + case PAL_SHA512: + *pcbDigest = CC_SHA512_DIGEST_LENGTH; + if (cbOutput < CC_SHA512_DIGEST_LENGTH) + { + return -1; + } + CC_SHA512(pBuf, cbBuf, pOutput); + return 1; + case PAL_MD5: + *pcbDigest = CC_MD5_DIGEST_LENGTH; + if (cbOutput < CC_MD5_DIGEST_LENGTH) + { + return -1; + } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + CC_MD5(pBuf, cbBuf, pOutput); +#pragma clang diagnostic pop + return 1; + default: + return -1; + } +} diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_digest.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_digest.h index 6ade7c7e3f5a..cb48e191b795 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_digest.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_digest.h @@ -56,3 +56,10 @@ Get the digest of the data already loaded into ctx, without resetting ctx. Returns 1 on success, 0 on failure, any other value on invalid inputs/state. */ PALEXPORT int32_t AppleCryptoNative_DigestCurrent(const DigestCtx* ctx, uint8_t* pOutput, int32_t cbOutput); + +/* +Combines DigestCreate, DigestUpdate, and DigestFinal in to a single operation. + +Returns 1 on success, 0 on failure, any other value on invalid inputs/state. +*/ +PALEXPORT int32_t AppleCryptoNative_DigestOneShot(PAL_HashAlgorithm algorithm, uint8_t* pBuf, int32_t cbBuf, uint8_t* pOutput, int32_t cbOutput, int32_t* pcbDigest); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp.c index 9560bcd2e201..4e67c450e9e8 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp.c @@ -93,6 +93,30 @@ int32_t CryptoNative_EvpDigestCurrent(const EVP_MD_CTX* ctx, uint8_t* md, uint32 return 0; } +int32_t CryptoNative_EvpDigestOneShot(const EVP_MD* type, const void* source, int32_t sourceSize, uint8_t* md, uint32_t* mdSize) +{ + if (type == NULL || sourceSize < 0 || md == NULL || mdSize == NULL) + return 0; + + EVP_MD_CTX* ctx = CryptoNative_EvpMdCtxCreate(type); + + if (ctx == NULL) + return 0; + + int32_t ret = EVP_DigestUpdate(ctx, source, (size_t)sourceSize); + + if (ret != SUCCESS) + { + CryptoNative_EvpMdCtxDestroy(ctx); + return 0; + } + + ret = CryptoNative_EvpDigestFinalEx(ctx, md, mdSize); + + CryptoNative_EvpMdCtxDestroy(ctx); + return ret; +} + int32_t CryptoNative_EvpMdSize(const EVP_MD* md) { return EVP_MD_size(md); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp.h index 5bebbb91df71..3a546c9f9232 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp.h @@ -57,6 +57,14 @@ Shims EVP_DigestFinal_ex on a duplicated value of ctx. */ PALEXPORT int32_t CryptoNative_EvpDigestCurrent(const EVP_MD_CTX* ctx, uint8_t* md, uint32_t* s); +/* +Function: +EvpDigestOneShot + +Combines EVP_MD_CTX_create, EVP_DigestUpdate, and EVP_DigestFinal_ex in to a single operation. +*/ +PALEXPORT int32_t CryptoNative_EvpDigestOneShot(const EVP_MD* type, const void* source, int32_t sourceSize, uint8_t* md, uint32_t* mdSize); + /* Function: EvpMdSize diff --git a/src/libraries/Native/native-binplace.proj b/src/libraries/Native/native-binplace.proj index 264a881802f3..f8a558defe35 100644 --- a/src/libraries/Native/native-binplace.proj +++ b/src/libraries/Native/native-binplace.proj @@ -25,6 +25,7 @@ + diff --git a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/BlockingCollection.cs b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/BlockingCollection.cs index 7e6b08c17cf6..ec80b76e7541 100644 --- a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/BlockingCollection.cs +++ b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/BlockingCollection.cs @@ -418,7 +418,7 @@ private bool TryAddWithNoTimeValidation(T item, int millisecondsTimeout, Cancell CancellationTokenSource? linkedTokenSource = null; try { - waitForSemaphoreWasSuccessful = _freeNodes.Wait(0); + waitForSemaphoreWasSuccessful = _freeNodes.Wait(0, default); if (waitForSemaphoreWasSuccessful == false && millisecondsTimeout != 0) { linkedTokenSource = CancellationTokenSource.CreateLinkedTokenSource( diff --git a/src/libraries/System.Collections.Concurrent/tests/ProducerConsumerCollectionTests.cs b/src/libraries/System.Collections.Concurrent/tests/ProducerConsumerCollectionTests.cs index ef699764e421..c6393faa9359 100644 --- a/src/libraries/System.Collections.Concurrent/tests/ProducerConsumerCollectionTests.cs +++ b/src/libraries/System.Collections.Concurrent/tests/ProducerConsumerCollectionTests.cs @@ -98,6 +98,7 @@ public void Ctor_InitializeFromCollection_ContainsExpectedItems(int numItems) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [SkipOnCoreClr("https://github.com/dotnet/runtime/issues/39398", RuntimeTestModes.TailcallStress)] public void Add_TakeFromAnotherThread_ExpectedItemsTaken() { IProducerConsumerCollection c = CreateProducerConsumerCollection(); diff --git a/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj b/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj index 09ff1a3d1536..f2fc64f714f3 100644 --- a/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj +++ b/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj @@ -1,7 +1,8 @@ - $(NetCoreAppCurrent);netstandard1.0;netstandard1.3;netstandard2.0 + $(NetCoreAppCurrent);netstandard1.0;netstandard1.3;netstandard2.0;net461;$(NetFrameworkCurrent) true + true enable @@ -114,4 +115,11 @@ + + + + + + + diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.cs index 542a7a09e5d3..411c38a4ea3d 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.cs @@ -14,7 +14,7 @@ namespace System.Collections.Immutable /// The type of elements in the set. [DebuggerDisplay("Count = {Count}")] [DebuggerTypeProxy(typeof(ImmutableEnumerableDebuggerProxy<>))] - #if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !NETSTANDARD2_0 + #if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !NETSTANDARD2_0 && !NETFRAMEWORK public sealed partial class ImmutableHashSet : IImmutableSet, IHashKeyCollection, IReadOnlyCollection, ICollection, ISet, IReadOnlySet, ICollection, IStrongEnumerable.Enumerator> #else public sealed partial class ImmutableHashSet : IImmutableSet, IHashKeyCollection, IReadOnlyCollection, ICollection, ISet, ICollection, IStrongEnumerable.Enumerator> diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs index 57e5aebb91a7..c6b8a281f98a 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs @@ -19,7 +19,7 @@ namespace System.Collections.Immutable /// [DebuggerDisplay("Count = {Count}")] [DebuggerTypeProxy(typeof(ImmutableEnumerableDebuggerProxy<>))] - #if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !NETSTANDARD2_0 + #if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !NETSTANDARD2_0 && !NETFRAMEWORK public sealed partial class ImmutableSortedSet : IImmutableSet, ISortKeyCollection, IReadOnlySet, IReadOnlyList, IList, ISet, IList, IStrongEnumerable.Enumerator> #else public sealed partial class ImmutableSortedSet : IImmutableSet, ISortKeyCollection, IReadOnlyList, IList, ISet, IList, IStrongEnumerable.Enumerator> diff --git a/src/libraries/System.Collections/ref/System.Collections.cs b/src/libraries/System.Collections/ref/System.Collections.cs index 510c7678062b..b0505e823849 100644 --- a/src/libraries/System.Collections/ref/System.Collections.cs +++ b/src/libraries/System.Collections/ref/System.Collections.cs @@ -248,6 +248,7 @@ public LinkedListNode(T value) { } public System.Collections.Generic.LinkedListNode? Next { get { throw null; } } public System.Collections.Generic.LinkedListNode? Previous { get { throw null; } } public T Value { get { throw null; } set { } } + public ref T ValueRef { get { throw null; } } } public partial class LinkedList : System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.ICollection, System.Collections.IEnumerable, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable { diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/LinkedList.cs b/src/libraries/System.Collections/src/System/Collections/Generic/LinkedList.cs index 0ab398f5686f..1694a7cbf651 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/LinkedList.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/LinkedList.cs @@ -651,6 +651,9 @@ public T Value set { item = value; } } + /// Gets a reference to the value held by the node. + public ref T ValueRef => ref item; + internal void Invalidate() { list = null; diff --git a/src/libraries/System.Collections/tests/Generic/Comparers/EqualityComparer.Generic.Serialization.Tests.cs b/src/libraries/System.Collections/tests/Generic/Comparers/EqualityComparer.Generic.Serialization.Tests.cs index 344218fc0a9f..d7b92acfb2e2 100644 --- a/src/libraries/System.Collections/tests/Generic/Comparers/EqualityComparer.Generic.Serialization.Tests.cs +++ b/src/libraries/System.Collections/tests/Generic/Comparers/EqualityComparer.Generic.Serialization.Tests.cs @@ -11,7 +11,7 @@ namespace System.Collections.Generic.Tests { public abstract partial class ComparersGenericTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] public void EqualityComparer_SerializationRoundtrip() { var bf = new BinaryFormatter(); diff --git a/src/libraries/System.Collections/tests/Generic/Dictionary/Dictionary.Tests.cs b/src/libraries/System.Collections/tests/Generic/Dictionary/Dictionary.Tests.cs index 49fb3e2617a0..ee9957b93844 100644 --- a/src/libraries/System.Collections/tests/Generic/Dictionary/Dictionary.Tests.cs +++ b/src/libraries/System.Collections/tests/Generic/Dictionary/Dictionary.Tests.cs @@ -399,7 +399,7 @@ private static IDictionary CreateDictionary(int size, Func keyV return dict; } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] public void ComparerSerialization() { // Strings switch between randomized and non-randomized comparers, diff --git a/src/libraries/System.Collections/tests/Generic/HashSet/HashSet.Generic.Tests.cs b/src/libraries/System.Collections/tests/Generic/HashSet/HashSet.Generic.Tests.cs index ea60d1836805..65261bfd26e4 100644 --- a/src/libraries/System.Collections/tests/Generic/HashSet/HashSet.Generic.Tests.cs +++ b/src/libraries/System.Collections/tests/Generic/HashSet/HashSet.Generic.Tests.cs @@ -658,7 +658,7 @@ public void Remove_NonDefaultComparer_ComparerUsed(int capacity) #region Serialization - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] public void ComparerSerialization() { // Strings switch between randomized and non-randomized comparers, diff --git a/src/libraries/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.Node.cs b/src/libraries/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.Node.cs index 86bf0bee7cf1..daa41a103178 100644 --- a/src/libraries/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.Node.cs +++ b/src/libraries/System.Collections/tests/Generic/LinkedList/LinkedList.Generic.Tests.Node.cs @@ -52,6 +52,35 @@ public void Verify() node.Value = default(T); VerifyLinkedListNode(node, default(T), null, null, null); + + //[] Verify passing something other then default(T) into the constructor and set the value to something other then default(T) + value = CreateT(seed++); + node = new LinkedListNode(value); + value = CreateT(seed++); + node.ValueRef = value; + + VerifyLinkedListNode(node, value, null, null, null); + + //[] Verify passing something other then default(T) into the constructor and set the value to default(T) + value = CreateT(seed++); + node = new LinkedListNode(value); + node.ValueRef = default(T); + + VerifyLinkedListNode(node, default(T), null, null, null); + + //[] Verify passing default(T) into the constructor and set the value to something other then default(T) + node = new LinkedListNode(default(T)); + value = CreateT(seed++); + node.ValueRef = value; + + VerifyLinkedListNode(node, value, null, null, null); + + //[] Verify passing default(T) into the constructor and set the value to default(T) + node = new LinkedListNode(default(T)); + value = CreateT(seed++); + node.ValueRef = default(T); + + VerifyLinkedListNode(node, default(T), null, null, null); } } } diff --git a/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/RangeAttributeTests.cs b/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/RangeAttributeTests.cs index 09d2f2982139..964afae32ae6 100644 --- a/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/RangeAttributeTests.cs +++ b/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/RangeAttributeTests.cs @@ -165,7 +165,7 @@ public static IEnumerable CommaDecimalNonStringValidValues() yield return new object[] { typeof(double), "1,0", "3,0", 2.99999999999999 }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(DotDecimalRanges))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")] public static void ParseDotSeparatorExtremaInCommaSeparatorCultures(Type type, string min, string max) @@ -206,7 +206,7 @@ public static void ParseDotSeparatorInvariantExtremaInCommaSeparatorCultures(Typ } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(CommaDecimalRanges))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")] public static void ParseCommaSeparatorExtremaInCommaSeparatorCultures(Type type, string min, string max) @@ -223,7 +223,7 @@ public static void ParseCommaSeparatorExtremaInCommaSeparatorCultures(Type type, } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(CommaDecimalRanges))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")] public static void ParseCommaSeparatorInvariantExtremaInCommaSeparatorCultures(Type type, string min, string max) @@ -240,7 +240,8 @@ public static void ParseCommaSeparatorInvariantExtremaInCommaSeparatorCultures(T } } - [Theory][MemberData(nameof(DotDecimalValidValues))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] + [MemberData(nameof(DotDecimalValidValues))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")] public static void DotDecimalExtremaAndValues(Type type, string min, string max, string value) { @@ -256,7 +257,7 @@ public static void DotDecimalExtremaAndValues(Type type, string min, string max, } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(DotDecimalValidValues))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")] public static void DotDecimalExtremaAndValuesInvariantParse(Type type, string min, string max, string value) @@ -280,7 +281,7 @@ public static void DotDecimalExtremaAndValuesInvariantParse(Type type, string mi } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(DotDecimalValidValues))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")] public static void DotDecimalExtremaAndValuesInvariantConvert(Type type, string min, string max, string value) @@ -329,7 +330,8 @@ public static void DotDecimalExtremaAndValuesInvariantBoth(Type type, string min }.IsValid(value)); } } - [Theory] + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(DotDecimalNonStringValidValues))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")] public static void DotDecimalExtremaAndNonStringValues(Type type, string min, string max, object value) @@ -370,7 +372,7 @@ public static void DotDecimalExtremaAndNonStringValuesInvariantParse(Type type, } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(DotDecimalNonStringValidValues))][SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")] public static void DotDecimalExtremaAndNonStringValuesInvariantConvert(Type type, string min, string max, object value) { @@ -418,7 +420,7 @@ public static void DotDecimalExtremaAndNonStringValuesInvariantBoth(Type type, s } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(CommaDecimalNonStringValidValues))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")] public static void CommaDecimalExtremaAndNonStringValues(Type type, string min, string max, object value) @@ -459,7 +461,7 @@ public static void CommaDecimalExtremaAndNonStringValuesInvariantParse(Type type } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(CommaDecimalNonStringValidValues))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")] public static void CommaDecimalExtremaAndNonStringValuesInvariantConvert(Type type, string min, string max, object value) @@ -510,7 +512,7 @@ public static void CommaDecimalExtremaAndNonStringValuesInvariantBoth(Type type, } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(DotDecimalInvalidValues))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")] public static void DotDecimalExtremaAndInvalidValues(Type type, string min, string max, string value) @@ -527,7 +529,7 @@ public static void DotDecimalExtremaAndInvalidValues(Type type, string min, stri } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(DotDecimalInvalidValues))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")] public static void DotDecimalExtremaAndInvalidValuesInvariantParse(Type type, string min, string max, string value) @@ -551,7 +553,7 @@ public static void DotDecimalExtremaAndInvalidValuesInvariantParse(Type type, st } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(DotDecimalInvalidValues))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")] public static void DotDecimalExtremaAndInvalidValuesInvariantConvert(Type type, string min, string max, string value) @@ -601,7 +603,7 @@ public static void DotDecimalExtremaAndInvalidValuesInvariantBoth(Type type, str } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(CommaDecimalValidValues))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")] public static void CommaDecimalExtremaAndValues(Type type, string min, string max, string value) @@ -692,7 +694,7 @@ public static void CommaDecimalExtremaAndValuesInvariantBoth(Type type, string m } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(CommaDecimalInvalidValues))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "2648 not fixed on NetFX")] public static void CommaDecimalExtremaAndInvalidValues(Type type, string min, string max, string value) diff --git a/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/ValidationExceptionTests.cs b/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/ValidationExceptionTests.cs index 7e30a6167746..65831b548f12 100644 --- a/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/ValidationExceptionTests.cs +++ b/src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/ValidationExceptionTests.cs @@ -80,7 +80,7 @@ public static void Ctor_String_ValidationAttribute_Object(string errorMessage) Assert.Same(value, ex.Value); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] public void Ctor_SerializationInfo_StreamingContext() { using (var stream = new MemoryStream()) diff --git a/src/libraries/System.ComponentModel.Composition/ref/System.ComponentModel.Composition.csproj b/src/libraries/System.ComponentModel.Composition/ref/System.ComponentModel.Composition.csproj index 953373a8bc09..cbf8732c35c4 100644 --- a/src/libraries/System.ComponentModel.Composition/ref/System.ComponentModel.Composition.csproj +++ b/src/libraries/System.ComponentModel.Composition/ref/System.ComponentModel.Composition.csproj @@ -1,6 +1,6 @@ - netstandard2.0;_$(NetFrameworkCurrent) + netstandard2.0;_net461 enable diff --git a/src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/InvalidAsynchronousStateExceptionTests.cs b/src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/InvalidAsynchronousStateExceptionTests.cs index d90aa355812f..b94a27c5040a 100644 --- a/src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/InvalidAsynchronousStateExceptionTests.cs +++ b/src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/InvalidAsynchronousStateExceptionTests.cs @@ -42,7 +42,7 @@ public void Ctor_String_Exception(string message) Assert.Null(exception.ParamName); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] public void Ctor_SerializationInfo_StreamingContext() { using (var stream = new MemoryStream()) diff --git a/src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/InvalidEnumArgumentExceptionTests.cs b/src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/InvalidEnumArgumentExceptionTests.cs index d6f592fadfd3..4b6187edc248 100644 --- a/src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/InvalidEnumArgumentExceptionTests.cs +++ b/src/libraries/System.ComponentModel.Primitives/tests/System/ComponentModel/InvalidEnumArgumentExceptionTests.cs @@ -87,7 +87,7 @@ public void Ctor_NullEnumClass_ThrowsArgumentNulException() AssertExtensions.Throws("enumClass", () => new InvalidEnumArgumentException("argumentName", 1, null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] public void Ctor_SerializationInfo_StreamingContext() { using (var stream = new MemoryStream()) diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContextSerializer.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContextSerializer.cs index 1b161eccd356..137e2d91951f 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContextSerializer.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContextSerializer.cs @@ -26,14 +26,18 @@ private DesigntimeLicenseContextSerializer() public static void Serialize(Stream o, string cryptoKey, DesigntimeLicenseContext context) { IFormatter formatter = new BinaryFormatter(); +#pragma warning disable MSLIB0003 // Issue https://github.com/dotnet/runtime/issues/39293 tracks finding an alternative to BinaryFormatter formatter.Serialize(o, new object[] { cryptoKey, context._savedLicenseKeys }); +#pragma warning restore MSLIB0003 } internal static void Deserialize(Stream o, string cryptoKey, RuntimeLicenseContext context) { +#pragma warning disable MSLIB0003 // Issue https://github.com/dotnet/runtime/issues/39293 tracks finding an alternative to BinaryFormatter IFormatter formatter = new BinaryFormatter(); object obj = formatter.Deserialize(o); +#pragma warning restore MSLIB0003 if (obj is object[] value) { diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/Design/CheckoutExceptionTests.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/Design/CheckoutExceptionTests.cs index a284948cfdbc..635c7bb09cd5 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/Design/CheckoutExceptionTests.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/Design/CheckoutExceptionTests.cs @@ -60,7 +60,7 @@ public void Cancelled_Get_ReturnsExpected() Assert.Null(exception.InnerException); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] public void Ctor_SerializationInfo_StreamingContext() { using (var stream = new MemoryStream()) diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/LicenseExceptionTests.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/LicenseExceptionTests.cs index 1a275c33c2d9..e41b3b29e912 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/LicenseExceptionTests.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/LicenseExceptionTests.cs @@ -73,7 +73,7 @@ public void Ctor_Type_Object_String_Exception(Type type, object instance, string Assert.Equal(message, exception.Message); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] public void Ctor_SerializationInfo_StreamingContext() { using (var stream = new MemoryStream()) diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/WarningExceptionTests.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/WarningExceptionTests.cs index 998ae25af502..0940a0b74971 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/WarningExceptionTests.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/WarningExceptionTests.cs @@ -74,7 +74,7 @@ public void Ctor_String_String_String(string message, string helpUrl, string hel Assert.Equal(message, exception.Message); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] public void Ctor_SerializationInfo_StreamingContext() { using (var stream = new MemoryStream()) diff --git a/src/libraries/System.Composition.AttributedModel/src/System.Composition.AttributedModel.csproj b/src/libraries/System.Composition.AttributedModel/src/System.Composition.AttributedModel.csproj index 1afd59f2f934..a39f3494bb05 100644 --- a/src/libraries/System.Composition.AttributedModel/src/System.Composition.AttributedModel.csproj +++ b/src/libraries/System.Composition.AttributedModel/src/System.Composition.AttributedModel.csproj @@ -1,7 +1,8 @@ System.Composition.AttributedModel - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true @@ -18,4 +19,7 @@ + + + \ No newline at end of file diff --git a/src/libraries/System.Composition.Convention/src/System.Composition.Convention.csproj b/src/libraries/System.Composition.Convention/src/System.Composition.Convention.csproj index 635f6a2b2fcb..eed8dbc7d09c 100644 --- a/src/libraries/System.Composition.Convention/src/System.Composition.Convention.csproj +++ b/src/libraries/System.Composition.Convention/src/System.Composition.Convention.csproj @@ -4,7 +4,8 @@ - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true @@ -27,4 +28,8 @@ + + + + \ No newline at end of file diff --git a/src/libraries/System.Composition.Hosting/src/System.Composition.Hosting.csproj b/src/libraries/System.Composition.Hosting/src/System.Composition.Hosting.csproj index c3482ad94dfd..23a9f0f48769 100644 --- a/src/libraries/System.Composition.Hosting/src/System.Composition.Hosting.csproj +++ b/src/libraries/System.Composition.Hosting/src/System.Composition.Hosting.csproj @@ -4,7 +4,8 @@ - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true @@ -37,4 +38,10 @@ + + + + + + \ No newline at end of file diff --git a/src/libraries/System.Composition.Runtime/src/System.Composition.Runtime.csproj b/src/libraries/System.Composition.Runtime/src/System.Composition.Runtime.csproj index 854ed1be6a4d..25aab756fed3 100644 --- a/src/libraries/System.Composition.Runtime/src/System.Composition.Runtime.csproj +++ b/src/libraries/System.Composition.Runtime/src/System.Composition.Runtime.csproj @@ -2,7 +2,8 @@ System.Composition System.Composition.Runtime - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true @@ -13,4 +14,9 @@ + + + + + \ No newline at end of file diff --git a/src/libraries/System.Composition.TypedParts/src/System.Composition.TypedParts.csproj b/src/libraries/System.Composition.TypedParts/src/System.Composition.TypedParts.csproj index 0171ea482a7c..2d6a799248f5 100644 --- a/src/libraries/System.Composition.TypedParts/src/System.Composition.TypedParts.csproj +++ b/src/libraries/System.Composition.TypedParts/src/System.Composition.TypedParts.csproj @@ -2,7 +2,8 @@ System.Composition System.Composition.TypedParts - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true @@ -34,4 +35,8 @@ + + + + \ No newline at end of file diff --git a/src/libraries/System.Composition/tests/Microsoft.Composition.Demos.ExtendedCollectionImports/Microsoft.Composition.Demos.ExtendedCollectionImports.csproj b/src/libraries/System.Composition/tests/Microsoft.Composition.Demos.ExtendedCollectionImports/Microsoft.Composition.Demos.ExtendedCollectionImports.csproj index 7d5ce36f12ae..83405db26224 100644 --- a/src/libraries/System.Composition/tests/Microsoft.Composition.Demos.ExtendedCollectionImports/Microsoft.Composition.Demos.ExtendedCollectionImports.csproj +++ b/src/libraries/System.Composition/tests/Microsoft.Composition.Demos.ExtendedCollectionImports/Microsoft.Composition.Demos.ExtendedCollectionImports.csproj @@ -1,7 +1,7 @@ Microsoft.Composition.Demos.ExtendedCollectionImports - netstandard2.0 + netstandard2.0;$(NetFrameworkCurrent) diff --git a/src/libraries/System.Composition/tests/TestLibrary/TestLibrary.csproj b/src/libraries/System.Composition/tests/TestLibrary/TestLibrary.csproj index 6d6060c2a287..dd2b89535774 100644 --- a/src/libraries/System.Composition/tests/TestLibrary/TestLibrary.csproj +++ b/src/libraries/System.Composition/tests/TestLibrary/TestLibrary.csproj @@ -1,6 +1,6 @@ - netstandard2.0 + netstandard2.0;$(NetFrameworkCurrent) diff --git a/src/libraries/System.Configuration.ConfigurationManager/Directory.Build.props b/src/libraries/System.Configuration.ConfigurationManager/Directory.Build.props index bdcfca3b543c..1db5968484c1 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/Directory.Build.props +++ b/src/libraries/System.Configuration.ConfigurationManager/Directory.Build.props @@ -2,5 +2,6 @@ Open + true \ No newline at end of file diff --git a/src/libraries/System.Configuration.ConfigurationManager/ref/System.Configuration.ConfigurationManager.cs b/src/libraries/System.Configuration.ConfigurationManager/ref/System.Configuration.ConfigurationManager.cs index 95a27a212286..df967acbbdfb 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/ref/System.Configuration.ConfigurationManager.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/ref/System.Configuration.ConfigurationManager.cs @@ -607,6 +607,7 @@ public DictionarySectionHandler() { } protected virtual string ValueAttributeName { get { throw null; } } public virtual object Create(object parent, object context, System.Xml.XmlNode section) { throw null; } } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public sealed partial class DpapiProtectedConfigurationProvider : System.Configuration.ProtectedConfigurationProvider { public DpapiProtectedConfigurationProvider() { } diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/DpapiProtectedConfigurationProvider.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/DpapiProtectedConfigurationProvider.cs index 7673dab21603..b6ada8acbfef 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/DpapiProtectedConfigurationProvider.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/DpapiProtectedConfigurationProvider.cs @@ -5,9 +5,11 @@ using System.Security.Cryptography; using System.Text; using System.Xml; +using System.Runtime.Versioning; namespace System.Configuration { + [MinimumOSPlatform("windows7.0")] public sealed class DpapiProtectedConfigurationProvider : ProtectedConfigurationProvider { private bool _useMachineProtection = true; diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SettingsPropertyValue.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SettingsPropertyValue.cs index 5558f6e349ce..12849c5e9258 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SettingsPropertyValue.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SettingsPropertyValue.cs @@ -98,6 +98,7 @@ private object Deserialize() { using (MemoryStream ms = new MemoryStream((byte[])SerializedValue)) { + // Issue https://github.com/dotnet/runtime/issues/39295 tracks finding an alternative to BinaryFormatter value = (new BinaryFormatter()).Deserialize(ms); } } @@ -195,6 +196,7 @@ private static object GetObjectFromString(Type type, SettingsSerializeAs seriali byte[] buffer = Convert.FromBase64String(serializedValue); using (MemoryStream ms = new MemoryStream(buffer)) { + // Issue https://github.com/dotnet/runtime/issues/39295 tracks finding an alternative to BinaryFormatter return (new BinaryFormatter()).Deserialize(ms); } case SettingsSerializeAs.Xml: @@ -221,6 +223,7 @@ private object SerializePropertyValue() using (MemoryStream ms = new MemoryStream()) { + // Issue https://github.com/dotnet/runtime/issues/39295 tracks finding an alternative to BinaryFormatter BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(ms, _value); return ms.ToArray(); diff --git a/src/libraries/System.Console/Directory.Build.props b/src/libraries/System.Console/Directory.Build.props index 465e1110d6b0..42c6eafce67e 100644 --- a/src/libraries/System.Console/Directory.Build.props +++ b/src/libraries/System.Console/Directory.Build.props @@ -3,5 +3,6 @@ Microsoft true + true \ No newline at end of file diff --git a/src/libraries/System.Console/ref/System.Console.cs b/src/libraries/System.Console/ref/System.Console.cs index 98f8027794d7..20b7d335e046 100644 --- a/src/libraries/System.Console/ref/System.Console.cs +++ b/src/libraries/System.Console/ref/System.Console.cs @@ -9,16 +9,16 @@ namespace System public static partial class Console { public static System.ConsoleColor BackgroundColor { get { throw null; } set { } } - public static int BufferHeight { get { throw null; } set { } } - public static int BufferWidth { get { throw null; } set { } } + public static int BufferHeight { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } } + public static int BufferWidth { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static bool CapsLock { get { throw null; } } public static int CursorLeft { get { throw null; } set { } } - public static int CursorSize { get { throw null; } set { } } + public static int CursorSize { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } } public static int CursorTop { get { throw null; } set { } } - public static bool CursorVisible { get { throw null; } set { } } + public static bool CursorVisible { [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] get { throw null; } set { } } public static System.IO.TextWriter Error { get { throw null; } } public static System.ConsoleColor ForegroundColor { get { throw null; } set { } } - public static (int Left, int Top) GetCursorPosition() { throw null; } public static System.IO.TextReader In { get { throw null; } } public static System.Text.Encoding InputEncoding { get { throw null; } set { } } public static bool IsErrorRedirected { get { throw null; } } @@ -27,20 +27,25 @@ public static partial class Console public static bool KeyAvailable { get { throw null; } } public static int LargestWindowHeight { get { throw null; } } public static int LargestWindowWidth { get { throw null; } } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static bool NumberLock { get { throw null; } } public static System.IO.TextWriter Out { get { throw null; } } public static System.Text.Encoding OutputEncoding { get { throw null; } set { } } - public static string Title { get { throw null; } set { } } + public static string Title { [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] get { throw null; } set { } } public static bool TreatControlCAsInput { get { throw null; } set { } } - public static int WindowHeight { get { throw null; } set { } } - public static int WindowLeft { get { throw null; } set { } } - public static int WindowTop { get { throw null; } set { } } - public static int WindowWidth { get { throw null; } set { } } + public static int WindowHeight { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } } + public static int WindowLeft { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } } + public static int WindowTop { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } } + public static int WindowWidth { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } } public static event System.ConsoleCancelEventHandler? CancelKeyPress { add { } remove { } } public static void Beep() { } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static void Beep(int frequency, int duration) { } public static void Clear() { } + public static (int Left, int Top) GetCursorPosition() { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop) { } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop, char sourceChar, System.ConsoleColor sourceForeColor, System.ConsoleColor sourceBackColor) { } public static System.IO.Stream OpenStandardError() { throw null; } public static System.IO.Stream OpenStandardError(int bufferSize) { throw null; } @@ -53,12 +58,15 @@ public static void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth public static System.ConsoleKeyInfo ReadKey(bool intercept) { throw null; } public static string? ReadLine() { throw null; } public static void ResetColor() { } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static void SetBufferSize(int width, int height) { } public static void SetCursorPosition(int left, int top) { } public static void SetError(System.IO.TextWriter newError) { } public static void SetIn(System.IO.TextReader newIn) { } public static void SetOut(System.IO.TextWriter newOut) { } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static void SetWindowPosition(int left, int top) { } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static void SetWindowSize(int width, int height) { } public static void Write(bool value) { } public static void Write(char value) { } diff --git a/src/libraries/System.Console/src/System/Console.cs b/src/libraries/System.Console/src/System/Console.cs index 1cf8bdc6aae4..ed25ffe8599f 100644 --- a/src/libraries/System.Console/src/System/Console.cs +++ b/src/libraries/System.Console/src/System/Console.cs @@ -2,9 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using System.Text; using System.Threading; @@ -277,14 +277,17 @@ static StrongBox EnsureInitialized() public static int CursorSize { get { return ConsolePal.CursorSize; } + [MinimumOSPlatform("windows7.0")] set { ConsolePal.CursorSize = value; } } + [MinimumOSPlatform("windows7.0")] public static bool NumberLock { get { return ConsolePal.NumberLock; } } + [MinimumOSPlatform("windows7.0")] public static bool CapsLock { get { return ConsolePal.CapsLock; } @@ -312,15 +315,18 @@ public static void ResetColor() public static int BufferWidth { get { return ConsolePal.BufferWidth; } + [MinimumOSPlatform("windows7.0")] set { ConsolePal.BufferWidth = value; } } public static int BufferHeight { get { return ConsolePal.BufferHeight; } + [MinimumOSPlatform("windows7.0")] set { ConsolePal.BufferHeight = value; } } + [MinimumOSPlatform("windows7.0")] public static void SetBufferSize(int width, int height) { ConsolePal.SetBufferSize(width, height); @@ -329,32 +335,38 @@ public static void SetBufferSize(int width, int height) public static int WindowLeft { get { return ConsolePal.WindowLeft; } + [MinimumOSPlatform("windows7.0")] set { ConsolePal.WindowLeft = value; } } public static int WindowTop { get { return ConsolePal.WindowTop; } + [MinimumOSPlatform("windows7.0")] set { ConsolePal.WindowTop = value; } } public static int WindowWidth { get { return ConsolePal.WindowWidth; } + [MinimumOSPlatform("windows7.0")] set { ConsolePal.WindowWidth = value; } } public static int WindowHeight { get { return ConsolePal.WindowHeight; } + [MinimumOSPlatform("windows7.0")] set { ConsolePal.WindowHeight = value; } } + [MinimumOSPlatform("windows7.0")] public static void SetWindowPosition(int left, int top) { ConsolePal.SetWindowPosition(left, top); } + [MinimumOSPlatform("windows7.0")] public static void SetWindowSize(int width, int height) { ConsolePal.SetWindowSize(width, height); @@ -372,6 +384,7 @@ public static int LargestWindowHeight public static bool CursorVisible { + [MinimumOSPlatform("windows7.0")] get { return ConsolePal.CursorVisible; } set { ConsolePal.CursorVisible = value; } } @@ -400,6 +413,7 @@ public static (int Left, int Top) GetCursorPosition() public static string Title { + [MinimumOSPlatform("windows7.0")] get { return ConsolePal.Title; } set { @@ -412,16 +426,19 @@ public static void Beep() ConsolePal.Beep(); } + [MinimumOSPlatform("windows7.0")] public static void Beep(int frequency, int duration) { ConsolePal.Beep(frequency, duration); } + [MinimumOSPlatform("windows7.0")] public static void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop) { ConsolePal.MoveBufferArea(sourceLeft, sourceTop, sourceWidth, sourceHeight, targetLeft, targetTop, ' ', ConsoleColor.Black, BackgroundColor); } + [MinimumOSPlatform("windows7.0")] public static void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop, char sourceChar, ConsoleColor sourceForeColor, ConsoleColor sourceBackColor) { ConsolePal.MoveBufferArea(sourceLeft, sourceTop, sourceWidth, sourceHeight, targetLeft, targetTop, sourceChar, sourceForeColor, sourceBackColor); diff --git a/src/libraries/System.Console/src/System/ConsolePal.Unix.cs b/src/libraries/System.Console/src/System/ConsolePal.Unix.cs index d6a9bad1410e..098601bfdbe9 100644 --- a/src/libraries/System.Console/src/System/ConsolePal.Unix.cs +++ b/src/libraries/System.Console/src/System/ConsolePal.Unix.cs @@ -143,14 +143,14 @@ public static bool TreatControlCAsInput return false; EnsureConsoleInitialized(); - return !Interop.Sys.GetSignalForBreak(); + return Interop.Sys.GetSignalForBreak() == 0; } set { if (!Console.IsInputRedirected) { EnsureConsoleInitialized(); - if (!Interop.Sys.SetSignalForBreak(signalForBreak: !value)) + if (Interop.Sys.SetSignalForBreak(Convert.ToInt32(value)) == 0) throw Interop.GetExceptionForIoErrno(Interop.Sys.GetLastErrorInfo()); } } diff --git a/src/libraries/System.Data.Common/ref/System.Data.Common.cs b/src/libraries/System.Data.Common/ref/System.Data.Common.cs index 58feee8f5512..5d70fda61ec0 100644 --- a/src/libraries/System.Data.Common/ref/System.Data.Common.cs +++ b/src/libraries/System.Data.Common/ref/System.Data.Common.cs @@ -49,7 +49,7 @@ public abstract partial class Constraint { internal Constraint() { } [System.ComponentModel.DefaultValueAttribute("")] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public virtual string ConstraintName { get { throw null; } set { } } [System.ComponentModel.BrowsableAttribute(false)] public System.Data.PropertyCollection ExtendedProperties { get { throw null; } } @@ -110,32 +110,32 @@ public DataColumn(string? columnName, System.Type dataType, string? expr, System public long AutoIncrementSeed { get { throw null; } set { } } [System.ComponentModel.DefaultValueAttribute((long)1)] public long AutoIncrementStep { get { throw null; } set { } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string Caption { get { throw null; } set { } } [System.ComponentModel.DefaultValueAttribute(System.Data.MappingType.Element)] public virtual System.Data.MappingType ColumnMapping { get { throw null; } set { } } [System.ComponentModel.DefaultValueAttribute("")] [System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string ColumnName { get { throw null; } set { } } [System.ComponentModel.DefaultValueAttribute(System.Data.DataSetDateTime.UnspecifiedLocal)] [System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)] public System.Data.DataSetDateTime DateTimeMode { get { throw null; } set { } } [System.ComponentModel.DefaultValueAttribute("")] [System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string Expression { get { throw null; } set { } } [System.ComponentModel.BrowsableAttribute(false)] public System.Data.PropertyCollection ExtendedProperties { get { throw null; } } [System.ComponentModel.DefaultValueAttribute(-1)] public int MaxLength { get { throw null; } set { } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string Namespace { get { throw null; } set { } } [System.ComponentModel.BrowsableAttribute(false)] [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] public int Ordinal { get { throw null; } } [System.ComponentModel.DefaultValueAttribute("")] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string Prefix { get { throw null; } set { } } [System.ComponentModel.DefaultValueAttribute(false)] public bool ReadOnly { get { throw null; } set { } } @@ -248,7 +248,7 @@ public DataRelation(string relationName, string? parentTableName, string? childT public virtual System.Data.UniqueConstraint? ParentKeyConstraint { get { throw null; } } public virtual System.Data.DataTable ParentTable { get { throw null; } } [System.ComponentModel.DefaultValueAttribute("")] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public virtual string RelationName { get { throw null; } set { } } protected void CheckStateForProperty() { } protected internal void OnPropertyChanging(System.ComponentModel.PropertyChangedEventArgs pcevent) { } @@ -290,20 +290,20 @@ public partial class DataRow { protected internal DataRow(System.Data.DataRowBuilder builder) { } public bool HasErrors { get { throw null; } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public object this[System.Data.DataColumn column] { get { throw null; } set { } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public object this[System.Data.DataColumn column, System.Data.DataRowVersion version] { get { throw null; } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public object this[int columnIndex] { get { throw null; } set { } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public object this[int columnIndex, System.Data.DataRowVersion version] { get { throw null; } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public object this[string columnName] { get { throw null; } set { } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public object this[string columnName, System.Data.DataRowVersion version] { get { throw null; } } public object?[] ItemArray { get { throw null; } set { } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string RowError { get { throw null; } set { } } public System.Data.DataRowState RowState { get { throw null; } } public System.Data.DataTable Table { get { throw null; } } @@ -403,21 +403,21 @@ internal DataRowComparer() { } } public static partial class DataRowExtensions { - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] public static T Field(this System.Data.DataRow row, System.Data.DataColumn column) { throw null; } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] public static T Field(this System.Data.DataRow row, System.Data.DataColumn column, System.Data.DataRowVersion version) { throw null; } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] public static T Field(this System.Data.DataRow row, int columnIndex) { throw null; } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] public static T Field(this System.Data.DataRow row, int columnIndex, System.Data.DataRowVersion version) { throw null; } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] public static T Field(this System.Data.DataRow row, string columnName) { throw null; } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] public static T Field(this System.Data.DataRow row, string columnName, System.Data.DataRowVersion version) { throw null; } - public static void SetField(this System.Data.DataRow row, System.Data.DataColumn column, [System.Diagnostics.CodeAnalysis.AllowNull] T value) { } - public static void SetField(this System.Data.DataRow row, int columnIndex, [System.Diagnostics.CodeAnalysis.AllowNull] T value) { } - public static void SetField(this System.Data.DataRow row, string columnName, [System.Diagnostics.CodeAnalysis.AllowNull] T value) { } + public static void SetField(this System.Data.DataRow row, System.Data.DataColumn column, [System.Diagnostics.CodeAnalysis.AllowNullAttribute] T value) { } + public static void SetField(this System.Data.DataRow row, int columnIndex, [System.Diagnostics.CodeAnalysis.AllowNullAttribute] T value) { } + public static void SetField(this System.Data.DataRow row, string columnName, [System.Diagnostics.CodeAnalysis.AllowNullAttribute] T value) { } } [System.FlagsAttribute] public enum DataRowState @@ -441,9 +441,9 @@ internal DataRowView() { } public System.Data.DataView DataView { get { throw null; } } public bool IsEdit { get { throw null; } } public bool IsNew { get { throw null; } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public object this[int ndx] { get { throw null; } set { } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public object this[string property] { get { throw null; } set { } } public System.Data.DataRow Row { get { throw null; } } public System.Data.DataRowVersion RowVersion { get { throw null; } } @@ -502,10 +502,10 @@ public DataSet(string dataSetName) { } public bool IsInitialized { get { throw null; } } public System.Globalization.CultureInfo Locale { get { throw null; } set { } } [System.ComponentModel.DefaultValueAttribute("")] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string Namespace { get { throw null; } set { } } [System.ComponentModel.DefaultValueAttribute("")] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string Prefix { get { throw null; } set { } } [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)] public System.Data.DataRelationCollection Relations { get { throw null; } } @@ -645,7 +645,7 @@ public DataTable(string? tableName, string? tableNamespace) { } [System.ComponentModel.BrowsableAttribute(false)] public System.Data.DataView DefaultView { get { throw null; } } [System.ComponentModel.DefaultValueAttribute("")] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string DisplayExpression { get { throw null; } set { } } [System.ComponentModel.BrowsableAttribute(false)] public System.Data.PropertyCollection ExtendedProperties { get { throw null; } } @@ -661,7 +661,7 @@ public DataTable(string? tableName, string? tableNamespace) { } [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] public System.Data.DataRelationCollection ParentRelations { get { throw null; } } [System.ComponentModel.DefaultValueAttribute("")] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string Prefix { get { throw null; } set { } } [System.ComponentModel.DefaultValueAttribute(System.Data.SerializationFormat.Xml)] public System.Data.SerializationFormat RemotingFormat { get { throw null; } set { } } @@ -675,7 +675,7 @@ public DataTable(string? tableName, string? tableNamespace) { } bool System.ComponentModel.IListSource.ContainsListCollection { get { throw null; } } [System.ComponentModel.DefaultValueAttribute("")] [System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string TableName { get { throw null; } set { } } public event System.Data.DataColumnChangeEventHandler? ColumnChanged { add { } remove { } } public event System.Data.DataColumnChangeEventHandler? ColumnChanging { add { } remove { } } @@ -970,7 +970,7 @@ public partial class DataViewManager : System.ComponentModel.MarshalByValueCompo public DataViewManager() { } public DataViewManager(System.Data.DataSet? dataSet) { } [System.ComponentModel.DefaultValueAttribute(null)] - [System.Diagnostics.CodeAnalysis.DisallowNull] + [System.Diagnostics.CodeAnalysis.DisallowNullAttribute] public System.Data.DataSet? DataSet { get { throw null; } set { } } public string DataViewSettingCollectionString { get { throw null; } set { } } [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)] @@ -1036,10 +1036,10 @@ internal DataViewSetting() { } public bool ApplyDefaultSort { get { throw null; } set { } } [System.ComponentModel.BrowsableAttribute(false)] public System.Data.DataViewManager? DataViewManager { get { throw null; } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string RowFilter { get { throw null; } set { } } public System.Data.DataViewRowState RowStateFilter { get { throw null; } set { } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string Sort { get { throw null; } set { } } [System.ComponentModel.BrowsableAttribute(false)] public System.Data.DataTable? Table { get { throw null; } } @@ -1054,7 +1054,7 @@ internal DataViewSettingCollection() { } [System.ComponentModel.BrowsableAttribute(false)] public bool IsSynchronized { get { throw null; } } public virtual System.Data.DataViewSetting this[System.Data.DataTable table] { get { throw null; } set { } } - [System.Diagnostics.CodeAnalysis.MaybeNull] + [System.Diagnostics.CodeAnalysis.MaybeNullAttribute] public virtual System.Data.DataViewSetting this[int index] { get { throw null; } set { } } public virtual System.Data.DataViewSetting? this[string tableName] { get { throw null; } } [System.ComponentModel.BrowsableAttribute(false)] @@ -1069,7 +1069,7 @@ public DBConcurrencyException() { } public DBConcurrencyException(string? message) { } public DBConcurrencyException(string? message, System.Exception? inner) { } public DBConcurrencyException(string? message, System.Exception? inner, System.Data.DataRow[]? dataRows) { } - [System.Diagnostics.CodeAnalysis.DisallowNull] + [System.Diagnostics.CodeAnalysis.DisallowNullAttribute] public System.Data.DataRow? Row { get { throw null; } set { } } public int RowCount { get { throw null; } } public void CopyToRows(System.Data.DataRow[] array) { } @@ -1218,9 +1218,9 @@ public partial interface IDataParameter System.Data.DbType DbType { get; set; } System.Data.ParameterDirection Direction { get; set; } bool IsNullable { get; } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] string ParameterName { get; set; } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] string SourceColumn { get; set; } System.Data.DataRowVersion SourceVersion { get; set; } object? Value { get; set; } @@ -1272,7 +1272,7 @@ public partial interface IDataRecord } public partial interface IDbCommand : System.IDisposable { - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] string CommandText { get; set; } int CommandTimeout { get; set; } System.Data.CommandType CommandType { get; set; } @@ -1290,7 +1290,7 @@ public partial interface IDbCommand : System.IDisposable } public partial interface IDbConnection : System.IDisposable { - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] string ConnectionString { get; set; } int ConnectionTimeout { get; } string Database { get; } @@ -1560,7 +1560,7 @@ public SyntaxErrorException(string? message, System.Exception? innerException) { public static partial class TypedTableBaseExtensions { public static System.Data.EnumerableRowCollection AsEnumerable(this System.Data.TypedTableBase source) where TRow : System.Data.DataRow { throw null; } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] public static TRow ElementAtOrDefault(this System.Data.TypedTableBase source, int index) where TRow : System.Data.DataRow { throw null; } public static System.Data.OrderedEnumerableRowCollection OrderByDescending(this System.Data.TypedTableBase source, System.Func keySelector) where TRow : System.Data.DataRow { throw null; } public static System.Data.OrderedEnumerableRowCollection OrderByDescending(this System.Data.TypedTableBase source, System.Func keySelector, System.Collections.Generic.IComparer comparer) where TRow : System.Data.DataRow { throw null; } @@ -1694,10 +1694,10 @@ public sealed partial class DataColumnMapping : System.MarshalByRefObject, Syste public DataColumnMapping() { } public DataColumnMapping(string? sourceColumn, string? dataSetColumn) { } [System.ComponentModel.DefaultValueAttribute("")] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string DataSetColumn { get { throw null; } set { } } [System.ComponentModel.DefaultValueAttribute("")] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string SourceColumn { get { throw null; } set { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] public System.Data.DataColumn? GetDataColumnBySchemaAction(System.Data.DataTable dataTable, System.Type? dataType, System.Data.MissingSchemaAction schemaAction) { throw null; } @@ -1759,10 +1759,10 @@ public DataTableMapping(string? sourceTable, string? dataSetTable, System.Data.C [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)] public System.Data.Common.DataColumnMappingCollection ColumnMappings { get { throw null; } } [System.ComponentModel.DefaultValueAttribute("")] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string DataSetTable { get { throw null; } set { } } [System.ComponentModel.DefaultValueAttribute("")] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string SourceTable { get { throw null; } set { } } System.Data.IColumnMappingCollection System.Data.ITableMapping.ColumnMappings { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] @@ -1851,7 +1851,7 @@ public abstract partial class DbCommand : System.ComponentModel.Component, Syste protected DbCommand() { } [System.ComponentModel.DefaultValueAttribute("")] [System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public abstract string CommandText { get; set; } public abstract int CommandTimeout { get; set; } [System.ComponentModel.DefaultValueAttribute(System.Data.CommandType.Text)] @@ -1911,7 +1911,7 @@ protected DbCommandBuilder() { } [System.ComponentModel.DefaultValueAttribute(System.Data.Common.CatalogLocation.Start)] public virtual System.Data.Common.CatalogLocation CatalogLocation { get { throw null; } set { } } [System.ComponentModel.DefaultValueAttribute(".")] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public virtual string CatalogSeparator { get { throw null; } set { } } [System.ComponentModel.DefaultValueAttribute(System.Data.ConflictOption.CompareAllSearchableValues)] public virtual System.Data.ConflictOption ConflictOption { get { throw null; } set { } } @@ -1919,13 +1919,13 @@ protected DbCommandBuilder() { } [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] public System.Data.Common.DbDataAdapter? DataAdapter { get { throw null; } set { } } [System.ComponentModel.DefaultValueAttribute("")] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public virtual string QuotePrefix { get { throw null; } set { } } [System.ComponentModel.DefaultValueAttribute("")] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public virtual string QuoteSuffix { get { throw null; } set { } } [System.ComponentModel.DefaultValueAttribute(".")] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public virtual string SchemaSeparator { get { throw null; } set { } } [System.ComponentModel.DefaultValueAttribute(false)] public bool SetAllValues { get { throw null; } set { } } @@ -1955,7 +1955,7 @@ protected DbConnection() { } [System.ComponentModel.RecommendedAsConfigurableAttribute(true)] [System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)] [System.ComponentModel.SettingsBindableAttribute(true)] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public abstract string ConnectionString { get; set; } public virtual int ConnectionTimeout { get { throw null; } } public abstract string Database { get; } @@ -2004,7 +2004,7 @@ public DbConnectionStringBuilder(bool useOdbcRules) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public bool BrowsableConnectionString { get { throw null; } set { } } [System.ComponentModel.RefreshPropertiesAttribute(System.ComponentModel.RefreshProperties.All)] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string ConnectionString { get { throw null; } set { } } [System.ComponentModel.BrowsableAttribute(false)] public virtual int Count { get { throw null; } } @@ -2013,7 +2013,7 @@ public DbConnectionStringBuilder(bool useOdbcRules) { } [System.ComponentModel.BrowsableAttribute(false)] public bool IsReadOnly { get { throw null; } } [System.ComponentModel.BrowsableAttribute(false)] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public virtual object this[string keyword] { get { throw null; } set { } } [System.ComponentModel.BrowsableAttribute(false)] public virtual System.Collections.ICollection Keys { get { throw null; } } @@ -2051,7 +2051,7 @@ void System.Collections.IDictionary.Remove(object keyword) { } System.ComponentModel.PropertyDescriptorCollection System.ComponentModel.ICustomTypeDescriptor.GetProperties(System.Attribute[] attributes) { throw null; } object System.ComponentModel.ICustomTypeDescriptor.GetPropertyOwner(System.ComponentModel.PropertyDescriptor pd) { throw null; } public override string ToString() { throw null; } - public virtual bool TryGetValue(string keyword, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out object? value) { throw null; } + public virtual bool TryGetValue(string keyword, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out object? value) { throw null; } } public abstract partial class DbDataAdapter : System.Data.Common.DataAdapter, System.Data.IDataAdapter, System.Data.IDbDataAdapter, System.ICloneable { @@ -2322,13 +2322,13 @@ protected DbParameter() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public abstract bool IsNullable { get; set; } [System.ComponentModel.DefaultValueAttribute("")] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public abstract string ParameterName { get; set; } public virtual byte Precision { get { throw null; } set { } } public virtual byte Scale { get { throw null; } set { } } public abstract int Size { get; set; } [System.ComponentModel.DefaultValueAttribute("")] - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public abstract string SourceColumn { get; set; } [System.ComponentModel.DefaultValueAttribute(false)] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] @@ -2404,7 +2404,7 @@ public static partial class DbProviderFactories public static void RegisterFactory(string providerInvariantName, System.Data.Common.DbProviderFactory factory) { } public static void RegisterFactory(string providerInvariantName, string factoryTypeAssemblyQualifiedName) { } public static void RegisterFactory(string providerInvariantName, System.Type providerFactoryClass) { } - public static bool TryGetFactory(string providerInvariantName, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Data.Common.DbProviderFactory? factory) { throw null; } + public static bool TryGetFactory(string providerInvariantName, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Data.Common.DbProviderFactory? factory) { throw null; } public static bool UnregisterFactory(string providerInvariantName) { throw null; } } public abstract partial class DbProviderFactory diff --git a/src/libraries/System.Data.Common/src/Resources/Strings.resx b/src/libraries/System.Data.Common/src/Resources/Strings.resx index 4535a6944bff..671bf490bc13 100644 --- a/src/libraries/System.Data.Common/src/Resources/Strings.resx +++ b/src/libraries/System.Data.Common/src/Resources/Strings.resx @@ -165,6 +165,7 @@ '{0}' argument is out of range. '{0}' argument cannot be null. '{0}' argument contains null value. + Type '{0}' is not allowed here. See https://go.microsoft.com/fwlink/?linkid=2132227 for more details. Cannot find column {0}. Column '{0}' already belongs to this DataTable. Column '{0}' already belongs to another DataTable. diff --git a/src/libraries/System.Data.Common/src/System.Data.Common.csproj b/src/libraries/System.Data.Common/src/System.Data.Common.csproj index cbde6845684d..a872f6cefe45 100644 --- a/src/libraries/System.Data.Common/src/System.Data.Common.csproj +++ b/src/libraries/System.Data.Common/src/System.Data.Common.csproj @@ -124,6 +124,10 @@ + + + Common\System\LocalAppContextSwitches.Common.cs + @@ -157,6 +161,7 @@ + @@ -296,25 +301,23 @@ - + + + + + + + - - - + - - - - - - diff --git a/src/libraries/System.Data.Common/src/System/Data/Common/ObjectStorage.cs b/src/libraries/System.Data.Common/src/System/Data/Common/ObjectStorage.cs index f220cf84f760..6e16308edca4 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Common/ObjectStorage.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Common/ObjectStorage.cs @@ -403,6 +403,9 @@ public override object ConvertXmlToObject(XmlReader xmlReader, XmlRootAttribute if (type == typeof(object)) throw ExceptionBuilder.CanNotDeserializeObjectType(); + + TypeLimiter.EnsureTypeIsAllowed(type); + if (!isBaseCLRType) { retValue = System.Activator.CreateInstance(type, true)!; diff --git a/src/libraries/System.Data.Common/src/System/Data/DataColumn.cs b/src/libraries/System.Data.Common/src/System/Data/DataColumn.cs index 1b09c0a75cbe..2547216825d5 100644 --- a/src/libraries/System.Data.Common/src/System/Data/DataColumn.cs +++ b/src/libraries/System.Data.Common/src/System/Data/DataColumn.cs @@ -143,6 +143,7 @@ public DataColumn(string? columnName, Type dataType, string? expr, MappingType t private void UpdateColumnType(Type type, StorageType typeCode) { + TypeLimiter.EnsureTypeIsAllowed(type); _dataType = type; _storageType = typeCode; if (StorageType.DateTime != typeCode) diff --git a/src/libraries/System.Data.Common/src/System/Data/DataException.cs b/src/libraries/System.Data.Common/src/System/Data/DataException.cs index 261005c21ffc..4df7e0be286e 100644 --- a/src/libraries/System.Data.Common/src/System/Data/DataException.cs +++ b/src/libraries/System.Data.Common/src/System/Data/DataException.cs @@ -350,6 +350,7 @@ private static void ThrowDataException(string error, Exception? innerException) public static Exception ArgumentOutOfRange(string paramName) => _ArgumentOutOfRange(paramName, SR.Format(SR.Data_ArgumentOutOfRange, paramName)); public static Exception BadObjectPropertyAccess(string error) => _InvalidOperation(SR.Format(SR.DataConstraint_BadObjectPropertyAccess, error)); public static Exception ArgumentContainsNull(string paramName) => _Argument(paramName, SR.Format(SR.Data_ArgumentContainsNull, paramName)); + public static Exception TypeNotAllowed(Type type) => _InvalidOperation(SR.Format(SR.Data_TypeNotAllowed, type.AssemblyQualifiedName)); // diff --git a/src/libraries/System.Data.Common/src/System/Data/DataSet.cs b/src/libraries/System.Data.Common/src/System/Data/DataSet.cs index 2c96c7ab8981..6ade9cb9fa7e 100644 --- a/src/libraries/System.Data.Common/src/System/Data/DataSet.cs +++ b/src/libraries/System.Data.Common/src/System/Data/DataSet.cs @@ -304,7 +304,9 @@ private void SerializeDataSet(SerializationInfo info, StreamingContext context, { BinaryFormatter bf = new BinaryFormatter(null, new StreamingContext(context.State, false)); MemoryStream memStream = new MemoryStream(); +#pragma warning disable MSLIB0003 // Issue https://github.com/dotnet/runtime/issues/39289 tracks finding an alternative to BinaryFormatter bf.Serialize(memStream, Tables[i]); +#pragma warning restore MSLIB0003 memStream.Position = 0; info.AddValue(string.Format(CultureInfo.InvariantCulture, "DataSet.Tables_{0}", i), memStream.GetBuffer()); } @@ -382,7 +384,9 @@ private void DeserializeDataSetSchema(SerializationInfo info, StreamingContext c MemoryStream memStream = new MemoryStream(buffer); memStream.Position = 0; BinaryFormatter bf = new BinaryFormatter(null, new StreamingContext(context.State, false)); +#pragma warning disable MSLIB0003 // Issue https://github.com/dotnet/runtime/issues/39289 tracks finding an alternative to BinaryFormatter DataTable dt = (DataTable)bf.Deserialize(memStream); +#pragma warning restore MSLIB0003 Tables.Add(dt); } @@ -1960,9 +1964,11 @@ private void WriteXmlSchema(XmlWriter? writer, SchemaFormat schemaFormat, Conver internal XmlReadMode ReadXml(XmlReader reader, bool denyResolving) { + IDisposable? restrictedScope = null; long logScopeId = DataCommonEventSource.Log.EnterScope(" {0}, denyResolving={1}", ObjectID, denyResolving); try { + restrictedScope = TypeLimiter.EnterRestrictedScope(this); DataTable.DSRowDiffIdUsageSection rowDiffIdUsage = default; try { @@ -2230,6 +2236,7 @@ internal XmlReadMode ReadXml(XmlReader reader, bool denyResolving) } finally { + restrictedScope?.Dispose(); DataCommonEventSource.Log.ExitScope(logScopeId); } } @@ -2466,9 +2473,11 @@ private void ReadXmlDiffgram(XmlReader reader) internal XmlReadMode ReadXml(XmlReader? reader, XmlReadMode mode, bool denyResolving) { + IDisposable? restictedScope = null; long logScopeId = DataCommonEventSource.Log.EnterScope(" {0}, mode={1}, denyResolving={2}", ObjectID, mode, denyResolving); try { + restictedScope = TypeLimiter.EnterRestrictedScope(this); XmlReadMode ret = mode; if (reader == null) @@ -2710,6 +2719,7 @@ internal XmlReadMode ReadXml(XmlReader? reader, XmlReadMode mode, bool denyResol } finally { + restictedScope?.Dispose(); DataCommonEventSource.Log.ExitScope(logScopeId); } } diff --git a/src/libraries/System.Data.Common/src/System/Data/DataTable.cs b/src/libraries/System.Data.Common/src/System/Data/DataTable.cs index e87718342def..851ac8900f70 100644 --- a/src/libraries/System.Data.Common/src/System/Data/DataTable.cs +++ b/src/libraries/System.Data.Common/src/System/Data/DataTable.cs @@ -5657,9 +5657,11 @@ private bool IsEmptyXml(XmlReader reader) internal XmlReadMode ReadXml(XmlReader? reader, bool denyResolving) { + IDisposable? restrictedScope = null; long logScopeId = DataCommonEventSource.Log.EnterScope(" {0}, denyResolving={1}", ObjectID, denyResolving); try { + restrictedScope = TypeLimiter.EnterRestrictedScope(this); RowDiffIdUsageSection rowDiffIdUsage = default; try { @@ -5894,15 +5896,18 @@ internal XmlReadMode ReadXml(XmlReader? reader, bool denyResolving) } finally { + restrictedScope?.Dispose(); DataCommonEventSource.Log.ExitScope(logScopeId); } } internal XmlReadMode ReadXml(XmlReader? reader, XmlReadMode mode, bool denyResolving) { + IDisposable? restrictedScope = null; RowDiffIdUsageSection rowDiffIdUsage = default; try { + restrictedScope = TypeLimiter.EnterRestrictedScope(this); bool fSchemaFound = false; bool fDataFound = false; bool fIsXdr = false; @@ -6188,6 +6193,7 @@ internal XmlReadMode ReadXml(XmlReader? reader, XmlReadMode mode, bool denyResol } finally { + restrictedScope?.Dispose(); // prepare and cleanup rowDiffId hashtable rowDiffIdUsage.Cleanup(); } diff --git a/src/libraries/System.Data.Common/src/System/Data/Filter/FunctionNode.cs b/src/libraries/System.Data.Common/src/System/Data/Filter/FunctionNode.cs index f2515033abb6..6a666e60718f 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Filter/FunctionNode.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Filter/FunctionNode.cs @@ -5,6 +5,7 @@ using System.Data.Common; using System.Data.SqlTypes; using System.Diagnostics; +using System.Runtime.Serialization; namespace System.Data { @@ -15,6 +16,7 @@ internal sealed class FunctionNode : ExpressionNode internal int _argumentCount; internal const int initialCapacity = 1; internal ExpressionNode[]? _arguments; + private readonly TypeLimiter? _capturedLimiter; private static readonly Function[] s_funcs = new Function[] { new Function("Abs", FunctionId.Abs, typeof(object), true, false, 1, typeof(object), null, null), @@ -39,6 +41,12 @@ internal sealed class FunctionNode : ExpressionNode internal FunctionNode(DataTable? table, string name) : base(table) { + // Because FunctionNode instances are created eagerly but evaluated lazily, + // we need to capture the deserialization scope here. The scope could be + // null if no deserialization is in progress. + + _capturedLimiter = TypeLimiter.Capture(); + _name = name; for (int i = 0; i < s_funcs.Length; i++) { @@ -288,6 +296,11 @@ private Type GetDataType(ExpressionNode node) throw ExprException.InvalidType(typeName); } + // ReadXml might not be on the current call stack. So we'll use the TypeLimiter + // that was captured when this FunctionNode instance was created. + + TypeLimiter.EnsureTypeIsAllowed(dataType, _capturedLimiter); + return dataType; } @@ -493,10 +506,17 @@ private object EvalFunction(FunctionId id, object[] argumentValues, DataRow? row { return SqlConvert.ChangeType2((decimal)SqlConvert.ChangeType2(argumentValues[0], StorageType.Decimal, typeof(decimal), FormatProvider), mytype, type, FormatProvider); } - return SqlConvert.ChangeType2(argumentValues[0], mytype, type, FormatProvider); } - return SqlConvert.ChangeType2(argumentValues[0], mytype, type, FormatProvider); + // The Convert function can be called lazily, outside of a previous Serialization Guard scope. + // If there was a type limiter scope on the stack at the time this Convert function was created, + // we must manually re-enter the Serialization Guard scope. + + DeserializationToken deserializationToken = (_capturedLimiter != null) ? SerializationInfo.StartDeserialization() : default; + using (deserializationToken) + { + return SqlConvert.ChangeType2(argumentValues[0], mytype, type, FormatProvider); + } } return argumentValues[0]; diff --git a/src/libraries/System.Data.Common/src/System/Data/LocalAppContextSwitches.cs b/src/libraries/System.Data.Common/src/System/Data/LocalAppContextSwitches.cs new file mode 100644 index 000000000000..ed77beaf7ba6 --- /dev/null +++ b/src/libraries/System.Data.Common/src/System/Data/LocalAppContextSwitches.cs @@ -0,0 +1,17 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +namespace System +{ + internal static partial class LocalAppContextSwitches + { + private static int s_allowArbitraryTypeInstantiation; + public static bool AllowArbitraryTypeInstantiation + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => GetCachedSwitchValue("Switch.System.Data.AllowArbitraryDataSetTypeInstantiation", ref s_allowArbitraryTypeInstantiation); + } + } +} diff --git a/src/libraries/System.Data.Common/src/System/Data/TypeLimiter.cs b/src/libraries/System.Data.Common/src/System/Data/TypeLimiter.cs new file mode 100644 index 000000000000..59258ead096a --- /dev/null +++ b/src/libraries/System.Data.Common/src/System/Data/TypeLimiter.cs @@ -0,0 +1,304 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.Data.SqlTypes; +using System.Diagnostics; +using System.Drawing; +using System.Linq; +using System.Numerics; +using System.Runtime.Serialization; + +namespace System.Data +{ + internal sealed class TypeLimiter + { + [ThreadStatic] + private static Scope? s_activeScope; + + private Scope m_instanceScope; + + private const string AppDomainDataSetDefaultAllowedTypesKey = "System.Data.DataSetDefaultAllowedTypes"; + + private TypeLimiter(Scope scope) + { + Debug.Assert(scope != null); + m_instanceScope = scope; + } + + private static bool IsTypeLimitingDisabled + => LocalAppContextSwitches.AllowArbitraryTypeInstantiation; + + /// + /// Captures the current instance so that future + /// type checks can be performed against the allow list that was active during + /// the current deserialization scope. + /// + /// + /// Returns null if no limiter is active. + /// + public static TypeLimiter? Capture() + { + Scope? activeScope = s_activeScope; + return (activeScope != null) ? new TypeLimiter(activeScope) : null; + } + + /// + /// Ensures the requested type is allowed by the rules of the active + /// deserialization scope. If a captured scope is provided, we'll use + /// that previously captured scope rather than the thread-static active + /// scope. + /// + /// + /// If is not allowed. + /// + public static void EnsureTypeIsAllowed(Type? type, TypeLimiter? capturedLimiter = null) + { + if (type is null) + { + return; // nothing to check + } + + Scope? capturedScope = capturedLimiter?.m_instanceScope ?? s_activeScope; + if (capturedScope is null) + { + return; // we're not in a restricted scope + } + + if (capturedScope.IsAllowedType(type)) + { + return; // type was explicitly allowed + } + + // We encountered a type that wasn't in the allow list. + // Throw an exception to fail the current operation. + + throw ExceptionBuilder.TypeNotAllowed(type); + } + + public static IDisposable? EnterRestrictedScope(DataSet dataSet) + { + if (IsTypeLimitingDisabled) + { + return null; // protections aren't enabled + } + + Scope newScope = new Scope(s_activeScope, GetPreviouslyDeclaredDataTypes(dataSet)); + s_activeScope = newScope; + return newScope; + } + + public static IDisposable? EnterRestrictedScope(DataTable dataTable) + { + if (IsTypeLimitingDisabled) + { + return null; // protections aren't enabled + } + + Scope newScope = new Scope(s_activeScope, GetPreviouslyDeclaredDataTypes(dataTable)); + s_activeScope = newScope; + return newScope; + } + + /// + /// Given a , returns all of the + /// values declared on the instance. + /// + private static IEnumerable GetPreviouslyDeclaredDataTypes(DataTable dataTable) + { + return (dataTable != null) + ? dataTable.Columns.Cast().Select(column => column.DataType) + : Enumerable.Empty(); + } + + /// + /// Given a , returns all of the + /// values declared on the instance. + /// + private static IEnumerable GetPreviouslyDeclaredDataTypes(DataSet dataSet) + { + return (dataSet != null) + ? dataSet.Tables.Cast().SelectMany(table => GetPreviouslyDeclaredDataTypes(table)) + : Enumerable.Empty(); + } + + private sealed class Scope : IDisposable + { + /// + /// Types which are always allowed, unconditionally. + /// + private static readonly HashSet s_allowedTypes = new HashSet() + { + /* primitives */ + typeof(bool), + typeof(char), + typeof(sbyte), + typeof(byte), + typeof(short), + typeof(ushort), + typeof(int), + typeof(uint), + typeof(long), + typeof(ulong), + typeof(float), + typeof(double), + typeof(decimal), + typeof(DateTime), + typeof(DateTimeOffset), + typeof(TimeSpan), + typeof(string), + typeof(Guid), + typeof(SqlBinary), + typeof(SqlBoolean), + typeof(SqlByte), + typeof(SqlBytes), + typeof(SqlChars), + typeof(SqlDateTime), + typeof(SqlDecimal), + typeof(SqlDouble), + typeof(SqlGuid), + typeof(SqlInt16), + typeof(SqlInt32), + typeof(SqlInt64), + typeof(SqlMoney), + typeof(SqlSingle), + typeof(SqlString), + + /* non-primitives, but common */ + typeof(object), + typeof(Type), + typeof(BigInteger), + typeof(Uri), + + /* frequently used System.Drawing types */ + typeof(Color), + typeof(Point), + typeof(PointF), + typeof(Rectangle), + typeof(RectangleF), + typeof(Size), + typeof(SizeF), + }; + + /// + /// Types which are allowed within the context of this scope. + /// + private HashSet m_allowedTypes; + + /// + /// This thread's previous scope. + /// + private readonly Scope? m_previousScope; + + /// + /// The Serialization Guard token associated with this scope. + /// + private readonly DeserializationToken m_deserializationToken; + + internal Scope(Scope? previousScope, IEnumerable allowedTypes) + { + Debug.Assert(allowedTypes != null); + + m_previousScope = previousScope; + m_allowedTypes = new HashSet(allowedTypes.Where(type => type != null)); + m_deserializationToken = SerializationInfo.StartDeserialization(); + } + + public void Dispose() + { + if (this != s_activeScope) + { + // Stacks should never be popped out of order. + // We want to trap this condition in production. + Debug.Fail("Scope was popped out of order."); + throw new ObjectDisposedException(GetType().FullName); + } + + m_deserializationToken.Dispose(); // it's a readonly struct, but Dispose still works properly + s_activeScope = m_previousScope; // could be null + } + + public bool IsAllowedType(Type type) + { + Debug.Assert(type != null); + + // Is the incoming type unconditionally allowed? + + if (IsTypeUnconditionallyAllowed(type)) + { + return true; + } + + // The incoming type is allowed if the current scope or any nested inner + // scope allowed it. + + for (Scope? currentScope = this; currentScope != null; currentScope = currentScope.m_previousScope) + { + if (currentScope.m_allowedTypes.Contains(type)) + { + return true; + } + } + + // Did the application programmatically allow this type to be deserialized? + + Type[]? appDomainAllowedTypes = (Type[]?)AppDomain.CurrentDomain.GetData(AppDomainDataSetDefaultAllowedTypesKey); + if (appDomainAllowedTypes != null) + { + for (int i = 0; i < appDomainAllowedTypes.Length; i++) + { + if (type == appDomainAllowedTypes[i]) + { + return true; + } + } + } + + // All checks failed + + return false; + } + + private static bool IsTypeUnconditionallyAllowed(Type type) + { + TryAgain: + Debug.Assert(type != null); + + // Check the list of unconditionally allowed types. + + if (s_allowedTypes.Contains(type)) + { + return true; + } + + // Enums are also always allowed, as we optimistically assume the app + // developer didn't define a dangerous enum type. + + if (type.IsEnum) + { + return true; + } + + // Allow single-dimensional arrays of any unconditionally allowed type. + + if (type.IsSZArray) + { + type = type.GetElementType()!; + goto TryAgain; + } + + // Allow generic lists of any unconditionally allowed type. + + if (type.IsGenericType && !type.IsGenericTypeDefinition && type.GetGenericTypeDefinition() == typeof(List<>)) + { + type = type.GetGenericArguments()[0]; + goto TryAgain; + } + + // All checks failed. + + return false; + } + } + } +} diff --git a/src/libraries/System.Data.Common/tests/System.Data.Common.Tests.csproj b/src/libraries/System.Data.Common/tests/System.Data.Common.Tests.csproj index 4d0933db75b0..75ae4978aa7c 100644 --- a/src/libraries/System.Data.Common/tests/System.Data.Common.Tests.csproj +++ b/src/libraries/System.Data.Common/tests/System.Data.Common.Tests.csproj @@ -1,6 +1,6 @@ - + - 0168,0169,0414,0219,0649 + $(NoWarn),0168,0169,0414,0219,0649 true $(NetCoreAppCurrent) @@ -112,6 +112,7 @@ + diff --git a/src/libraries/System.Data.Common/tests/System/Data/RestrictedTypeHandlingTests.cs b/src/libraries/System.Data.Common/tests/System/Data/RestrictedTypeHandlingTests.cs new file mode 100644 index 000000000000..54644b678a5b --- /dev/null +++ b/src/libraries/System.Data.Common/tests/System/Data/RestrictedTypeHandlingTests.cs @@ -0,0 +1,445 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.Data.SqlTypes; +using System.Drawing; +using System.IO; +using System.Numerics; +using System.Runtime.Serialization; +using System.Text; +using System.Xml; +using System.Xml.Schema; +using System.Xml.Serialization; +using Xunit; +using Xunit.Sdk; + +namespace System.Data.Tests +{ + // !! Important !! + // These tests manipulate global state, so they cannot be run in parallel with one another. + // We rely on xunit's default behavior of not parallelizing unit tests declared on the same + // test class: see https://xunit.net/docs/running-tests-in-parallel.html. + public class RestrictedTypeHandlingTests + { + private const string AppDomainDataSetDefaultAllowedTypesKey = "System.Data.DataSetDefaultAllowedTypes"; + + private static readonly Type[] _alwaysAllowedTypes = new Type[] + { + /* primitives */ + typeof(bool), + typeof(char), + typeof(sbyte), + typeof(byte), + typeof(short), + typeof(ushort), + typeof(int), + typeof(uint), + typeof(long), + typeof(ulong), + typeof(float), + typeof(double), + typeof(decimal), + typeof(DateTime), + typeof(DateTimeOffset), + typeof(TimeSpan), + typeof(string), + typeof(Guid), + typeof(SqlBinary), + typeof(SqlBoolean), + typeof(SqlByte), + typeof(SqlBytes), + typeof(SqlChars), + typeof(SqlDateTime), + typeof(SqlDecimal), + typeof(SqlDouble), + typeof(SqlGuid), + typeof(SqlInt16), + typeof(SqlInt32), + typeof(SqlInt64), + typeof(SqlMoney), + typeof(SqlSingle), + typeof(SqlString), + + /* non-primitives, but common */ + typeof(object), + typeof(Type), + typeof(BigInteger), + typeof(Uri), + + /* frequently used System.Drawing types */ + typeof(Color), + typeof(Point), + typeof(PointF), + typeof(Rectangle), + typeof(RectangleF), + typeof(Size), + typeof(SizeF), + + /* to test that enums are allowed */ + typeof(StringComparison), + }; + + public static IEnumerable AllowedTypes() + { + foreach (Type type in _alwaysAllowedTypes) + { + yield return new object[] { type }; // T + yield return new object[] { type.MakeArrayType() }; // T[] (SZArray) + yield return new object[] { type.MakeArrayType().MakeArrayType() }; // T[][] (jagged array) + yield return new object[] { typeof(List<>).MakeGenericType(type) }; // List + } + } + + public static IEnumerable ForbiddenTypes() + { + // StringBuilder isn't in the allow list + + yield return new object[] { typeof(StringBuilder) }; + yield return new object[] { typeof(StringBuilder[]) }; + + // multi-dim arrays and non-sz arrays are forbidden + + yield return new object[] { typeof(int[,]) }; + yield return new object[] { Array.CreateInstance(typeof(int), new[] { 1 }, new[] { 1 }).GetType() }; + + // HashSet isn't in the allow list + + yield return new object[] { typeof(HashSet) }; + + // DataSet / DataTable / SqlXml aren't in the allow list + + yield return new object[] { typeof(DataSet) }; + yield return new object[] { typeof(DataTable) }; + yield return new object[] { typeof(SqlXml) }; + + // Enum, Array, and other base types aren't allowed + + yield return new object[] { typeof(Enum) }; + yield return new object[] { typeof(Array) }; + yield return new object[] { typeof(ValueType) }; + yield return new object[] { typeof(void) }; + } + + [Theory] + [MemberData(nameof(AllowedTypes))] + public void DataTable_ReadXml_AllowsKnownTypes(Type type) + { + // Arrange + + DataTable table = new DataTable("MyTable"); + table.Columns.Add("MyColumn", type); + + string asXml = WriteXmlWithSchema(table.WriteXml); + + // Act + + table = ReadXml(asXml); + + // Assert + + Assert.Equal("MyTable", table.TableName); + Assert.Equal(1, table.Columns.Count); + Assert.Equal("MyColumn", table.Columns[0].ColumnName); + Assert.Equal(type, table.Columns[0].DataType); + } + + [Theory] + [MemberData(nameof(ForbiddenTypes))] + public void DataTable_ReadXml_ForbidsUnknownTypes(Type type) + { + // Arrange + + DataTable table = new DataTable("MyTable"); + table.Columns.Add("MyColumn", type); + + string asXml = WriteXmlWithSchema(table.WriteXml); + + // Act & assert + + Assert.Throws(() => ReadXml(asXml)); + } + + [Fact] + public void DataTable_ReadXml_HandlesXmlSerializableTypes() + { + // Arrange + + DataTable table = new DataTable("MyTable"); + table.Columns.Add("MyColumn", typeof(object)); + table.Rows.Add(new MyXmlSerializableClass()); + + string asXml = WriteXmlWithSchema(table.WriteXml, XmlWriteMode.IgnoreSchema); + + // Act & assert + // MyXmlSerializableClass shouldn't be allowed as a member for a column + // typed as 'object'. + + table.Rows.Clear(); + Assert.Throws(() => table.ReadXml(new StringReader(asXml))); + } + + [Theory] + [MemberData(nameof(ForbiddenTypes))] + public void DataTable_ReadXmlSchema_AllowsUnknownTypes(Type type) + { + // Arrange + + DataTable table = new DataTable("MyTable"); + table.Columns.Add("MyColumn", type); + + string asXml = WriteXmlWithSchema(table.WriteXml); + + // Act + + table = new DataTable(); + table.ReadXmlSchema(new StringReader(asXml)); + + // Assert + + Assert.Equal("MyTable", table.TableName); + Assert.Equal(1, table.Columns.Count); + Assert.Equal("MyColumn", table.Columns[0].ColumnName); + Assert.Equal(type, table.Columns[0].DataType); + } + + [Fact] + public void DataTable_HonorsGloballyDefinedAllowList() + { + // Arrange + + DataTable table = new DataTable("MyTable"); + table.Columns.Add("MyColumn", typeof(MyCustomClass)); + + string asXml = WriteXmlWithSchema(table.WriteXml); + + // Act & assert 1 + // First call should fail since MyCustomClass not allowed + + Assert.Throws(() => ReadXml(asXml)); + + // Act & assert 2 + // Deserialization should succeed since it's now in the allow list + + try + { + AppDomain.CurrentDomain.SetData(AppDomainDataSetDefaultAllowedTypesKey, new Type[] + { + typeof(MyCustomClass) + }); + + table = ReadXml(asXml); + + Assert.Equal("MyTable", table.TableName); + Assert.Equal(1, table.Columns.Count); + Assert.Equal("MyColumn", table.Columns[0].ColumnName); + Assert.Equal(typeof(MyCustomClass), table.Columns[0].DataType); + } + finally + { + AppDomain.CurrentDomain.SetData(AppDomainDataSetDefaultAllowedTypesKey, null); + } + } + + [Fact] + public void DataColumn_ConvertExpression_SubjectToAllowList_Success() + { + // Arrange + + DataTable table = new DataTable("MyTable"); + table.Columns.Add("MyColumn", typeof(object), "CONVERT('42', 'System.Int32')"); + + string asXml = WriteXmlWithSchema(table.WriteXml); + + // Act + + table = ReadXml(asXml); + + // Assert + + Assert.Equal("MyTable", table.TableName); + Assert.Equal(1, table.Columns.Count); + Assert.Equal("MyColumn", table.Columns[0].ColumnName); + Assert.Equal(typeof(object), table.Columns[0].DataType); + Assert.Equal("CONVERT('42', 'System.Int32')", table.Columns[0].Expression); + } + + [Fact] + public void DataColumn_ConvertExpression_SubjectToAllowList_Failure() + { + // Arrange + + DataTable table = new DataTable("MyTable"); + table.Columns.Add("ColumnA", typeof(object)); + table.Columns.Add("ColumnB", typeof(object), "CONVERT(ColumnA, 'System.Text.StringBuilder')"); + + string asXml = WriteXmlWithSchema(table.WriteXml); + + // Act + // 'StringBuilder' isn't in the allow list, but we're not yet hydrating the Type + // object so we won't check it just yet. + + table = ReadXml(asXml); + + // Assert - the CONVERT function node should have captured the active allow list + // at construction and should apply it now. + + Assert.Throws(() => table.Rows.Add(new StringBuilder())); + } + + [Theory] + [MemberData(nameof(AllowedTypes))] + public void DataSet_ReadXml_AllowsKnownTypes(Type type) + { + // Arrange + + DataSet set = new DataSet("MySet"); + DataTable table = new DataTable("MyTable"); + table.Columns.Add("MyColumn", type); + set.Tables.Add(table); + + string asXml = WriteXmlWithSchema(set.WriteXml); + + // Act + + table = null; + set = ReadXml(asXml); + + // Assert + + Assert.Equal("MySet", set.DataSetName); + Assert.Equal(1, set.Tables.Count); + + table = set.Tables[0]; + Assert.Equal("MyTable", table.TableName); + Assert.Equal(1, table.Columns.Count); + Assert.Equal("MyColumn", table.Columns[0].ColumnName); + Assert.Equal(type, table.Columns[0].DataType); + } + + [Theory] + [MemberData(nameof(ForbiddenTypes))] + public void DataSet_ReadXml_ForbidsUnknownTypes(Type type) + { + // Arrange + + DataSet set = new DataSet("MySet"); + DataTable table = new DataTable("MyTable"); + table.Columns.Add("MyColumn", type); + set.Tables.Add(table); + + string asXml = WriteXmlWithSchema(set.WriteXml); + + // Act & assert + + Assert.Throws(() => ReadXml(asXml)); + } + + [Theory] + [MemberData(nameof(ForbiddenTypes))] + public void DataSet_ReadXmlSchema_AllowsUnknownTypes(Type type) + { + // Arrange + + DataSet set = new DataSet("MySet"); + DataTable table = new DataTable("MyTable"); + table.Columns.Add("MyColumn", type); + set.Tables.Add(table); + + string asXml = WriteXmlWithSchema(set.WriteXml); + + // Act + + set = new DataSet(); + set.ReadXmlSchema(new StringReader(asXml)); + + // Assert + + Assert.Equal("MySet", set.DataSetName); + Assert.Equal(1, set.Tables.Count); + + table = set.Tables[0]; + Assert.Equal("MyTable", table.TableName); + Assert.Equal(1, table.Columns.Count); + Assert.Equal("MyColumn", table.Columns[0].ColumnName); + Assert.Equal(type, table.Columns[0].DataType); + } + + [Fact] + public void SerializationGuard_BlocksFileAccessOnDeserialize() + { + // Arrange + + DataTable table = new DataTable("MyTable"); + table.Columns.Add("MyColumn", typeof(MyCustomClassThatWritesToAFile)); + table.Rows.Add(new MyCustomClassThatWritesToAFile()); + + string asXml = WriteXmlWithSchema(table.WriteXml); + table.Rows.Clear(); + + // Act & assert + + Assert.Throws(() => table.ReadXml(new StringReader(asXml))); + } + + private static string WriteXmlWithSchema(Action writeMethod, XmlWriteMode xmlWriteMode = XmlWriteMode.WriteSchema) + { + StringWriter writer = new StringWriter(); + writeMethod(writer, xmlWriteMode); + return writer.ToString(); + } + + private static T ReadXml(string xml) where T : IXmlSerializable, new() + { + T newObj = new T(); + newObj.ReadXml(new XmlTextReader(new StringReader(xml)) { XmlResolver = null }); // suppress DTDs, same as runtime code + return newObj; + } + + private sealed class MyCustomClass + { + } + + public sealed class MyXmlSerializableClass : IXmlSerializable + { + public XmlSchema GetSchema() + { + return null; + } + + public void ReadXml(XmlReader reader) + { + return; // no-op + } + + public void WriteXml(XmlWriter writer) + { + writer.WriteElementString("MyElement", "MyValue"); + } + } + + private sealed class MyCustomClassThatWritesToAFile : IXmlSerializable + { + public XmlSchema GetSchema() + { + return null; + } + + public void ReadXml(XmlReader reader) + { + // This should be called within a Serialization Guard scope, so the file write + // should fail. + + string tempPath = Path.GetTempFileName(); + File.WriteAllText(tempPath, "This better not be written..."); + File.Delete(tempPath); + throw new XunitException("Unreachable code (SerializationGuard should have kicked in)"); + } + + public void WriteXml(XmlWriter writer) + { + writer.WriteElementString("MyElement", "MyValue"); + } + } + } +} diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSourceActivity.cs b/src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSourceActivity.cs index 2d308fd3ba8d..f0b93c82b407 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSourceActivity.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSourceActivity.cs @@ -33,7 +33,7 @@ public string? Id get { throw null; } } - public bool IsAllDataRequested { get { throw null; } set { throw null; }} + public bool IsAllDataRequested { get { throw null; } set { throw null; } } public System.Diagnostics.ActivityIdFormat IdFormat { get { throw null; } } public System.Diagnostics.ActivityKind Kind { get { throw null; } } public string OperationName { get { throw null; } } @@ -47,6 +47,7 @@ public string? Id public System.Diagnostics.ActivitySpanId SpanId { get { throw null; } } public System.DateTime StartTimeUtc { get { throw null; } } public System.Collections.Generic.IEnumerable> Tags { get { throw null; } } + public System.Collections.Generic.IEnumerable> TagObjects { get { throw null; } } public System.Collections.Generic.IEnumerable Events { get { throw null; } } public System.Collections.Generic.IEnumerable Links { get { throw null; } } public System.Diagnostics.ActivityTraceId TraceId { get { throw null; } } @@ -54,6 +55,8 @@ public string? Id public System.Diagnostics.Activity AddBaggage(string key, string? value) { throw null; } public System.Diagnostics.Activity AddEvent(System.Diagnostics.ActivityEvent e) { throw null; } public System.Diagnostics.Activity AddTag(string key, string? value) { throw null; } + public System.Diagnostics.Activity AddTag(string key, object value) { throw null; } + public System.Diagnostics.Activity SetTag(string key, object value) { throw null; } public string? GetBaggageItem(string key) { throw null; } public System.Diagnostics.Activity SetEndTime(System.DateTime endTimeUtc) { throw null; } public System.Diagnostics.Activity SetIdFormat(System.Diagnostics.ActivityIdFormat format) { throw null; } @@ -68,6 +71,37 @@ public string? Id public object? GetCustomProperty(string propertyName) { throw null; } public ActivityContext Context { get { throw null; } } } + public class ActivityTagsCollection : System.Collections.Generic.IDictionary + { + public ActivityTagsCollection() { throw null; } + public ActivityTagsCollection(System.Collections.Generic.IEnumerable> list) { throw null; } + public object? this[string key] { get { throw null; } set { } } + public System.Collections.Generic.ICollection Keys { get { throw null; } } + public System.Collections.Generic.ICollection Values { get { throw null; } } + public int Count { get { throw null; } } + public bool IsReadOnly { get { throw null; } } + public void Add(string key, object value) { throw null; } + public void Add(System.Collections.Generic.KeyValuePair item) { throw null; } + public void Clear() { throw null; } + public bool Contains(System.Collections.Generic.KeyValuePair item) { throw null; } + public bool ContainsKey(string key) { throw null; } + public void CopyTo(System.Collections.Generic.KeyValuePair[] array, int arrayIndex) { throw null; } + System.Collections.Generic.IEnumerator> System.Collections.Generic.IEnumerable>.GetEnumerator() { throw null; } + public bool Remove(string key) { throw null; } + public bool Remove(System.Collections.Generic.KeyValuePair item) { throw null; } + public bool TryGetValue(string key, out object value) { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + public Enumerator GetEnumerator() { throw null; } + + public struct Enumerator : System.Collections.Generic.IEnumerator>, System.Collections.IEnumerator + { + public System.Collections.Generic.KeyValuePair Current { get { throw null; } } + object System.Collections.IEnumerator.Current { get { throw null; } } + public void Dispose() { throw null; } + public bool MoveNext() { throw null; } + void System.Collections.IEnumerator.Reset() { throw null; } + } + } public enum ActivityIdFormat { Unknown = 0, @@ -101,8 +135,8 @@ public sealed class ActivitySource : IDisposable public string? Version { get { throw null; } } public bool HasListeners() { throw null; } public System.Diagnostics.Activity? StartActivity(string name, System.Diagnostics.ActivityKind kind = ActivityKind.Internal) { throw null; } - public System.Diagnostics.Activity? StartActivity(string name, System.Diagnostics.ActivityKind kind, System.Diagnostics.ActivityContext parentContext, System.Collections.Generic.IEnumerable>? tags = null, System.Collections.Generic.IEnumerable? links = null, System.DateTimeOffset startTime = default) { throw null; } - public System.Diagnostics.Activity? StartActivity(string name, System.Diagnostics.ActivityKind kind, string parentId, System.Collections.Generic.IEnumerable>? tags = null, System.Collections.Generic.IEnumerable? links = null, System.DateTimeOffset startTime = default) { throw null; } + public System.Diagnostics.Activity? StartActivity(string name, System.Diagnostics.ActivityKind kind, System.Diagnostics.ActivityContext parentContext, System.Collections.Generic.IEnumerable>? tags = null, System.Collections.Generic.IEnumerable? links = null, System.DateTimeOffset startTime = default) { throw null; } + public System.Diagnostics.Activity? StartActivity(string name, System.Diagnostics.ActivityKind kind, string parentId, System.Collections.Generic.IEnumerable>? tags = null, System.Collections.Generic.IEnumerable? links = null, System.DateTimeOffset startTime = default) { throw null; } public static void AddActivityListener(System.Diagnostics.ActivityListener listener) { throw null; } public void Dispose() { throw null; } } @@ -163,20 +197,19 @@ public enum ActivityKind public readonly struct ActivityEvent { public ActivityEvent(string name) {throw null; } - public ActivityEvent(string name, System.DateTimeOffset timestamp) { throw null; } - public ActivityEvent(string name, System.DateTimeOffset timestamp, System.Collections.Generic.IEnumerable>? attributes) { throw null; } - public ActivityEvent(string name, System.Collections.Generic.IEnumerable>? attributes) { throw null; } + public ActivityEvent(string name, System.DateTimeOffset timestamp = default, System.Diagnostics.ActivityTagsCollection? tags = null) { throw null; } public string Name { get { throw null; } } public System.DateTimeOffset Timestamp { get { throw null; } } - public System.Collections.Generic.IEnumerable> Attributes { get { throw null; } } + public System.Collections.Generic.IEnumerable> Tags { get { throw null; } } } public readonly struct ActivityContext : System.IEquatable { - public ActivityContext(System.Diagnostics.ActivityTraceId traceId, System.Diagnostics.ActivitySpanId spanId, System.Diagnostics.ActivityTraceFlags traceOptions, string? traceState = null) { throw null; } + public ActivityContext(System.Diagnostics.ActivityTraceId traceId, System.Diagnostics.ActivitySpanId spanId, System.Diagnostics.ActivityTraceFlags traceOptions, string? traceState = null, bool isRemote = false) { throw null; } public System.Diagnostics.ActivityTraceId TraceId { get { throw null; } } public System.Diagnostics.ActivitySpanId SpanId { get { throw null; } } public System.Diagnostics.ActivityTraceFlags TraceFlags { get { throw null; } } public string? TraceState { get { throw null; } } + public bool IsRemote { get { throw null; } } public static bool operator ==(System.Diagnostics.ActivityContext left, System.Diagnostics.ActivityContext right) { throw null; } public static bool operator !=(System.Diagnostics.ActivityContext left, System.Diagnostics.ActivityContext right) { throw null; } public bool Equals(System.Diagnostics.ActivityContext value) { throw null; } @@ -185,11 +218,9 @@ public readonly struct ActivityEvent } public readonly struct ActivityLink : IEquatable { - public ActivityLink(System.Diagnostics.ActivityContext context) { throw null; } - public ActivityLink(System.Diagnostics.ActivityContext context, System.Collections.Generic.IEnumerable>? attributes) { throw null; } + public ActivityLink(System.Diagnostics.ActivityContext context, System.Diagnostics.ActivityTagsCollection? tags = null) { throw null; } public System.Diagnostics.ActivityContext Context { get { throw null; } } - public System.Collections.Generic.IEnumerable>? Attributes { get { throw null; } } - + public System.Collections.Generic.IEnumerable>? Tags { get { throw null; } } public override bool Equals(object? obj) { throw null; } public bool Equals(System.Diagnostics.ActivityLink value) { throw null; } public static bool operator ==(System.Diagnostics.ActivityLink left, System.Diagnostics.ActivityLink right) { throw null; } @@ -202,18 +233,19 @@ public readonly struct ActivityCreationOptions public string Name { get { throw null; } } public System.Diagnostics.ActivityKind Kind { get { throw null; } } public T Parent { get { throw null; } } - public System.Collections.Generic.IEnumerable> Tags { get { throw null; } } + public System.Collections.Generic.IEnumerable> Tags { get { throw null; } } public System.Collections.Generic.IEnumerable Links { get { throw null; } } } public delegate System.Diagnostics.ActivityDataRequest GetRequestedData(ref System.Diagnostics.ActivityCreationOptions options); public sealed class ActivityListener : IDisposable { public ActivityListener() { throw null; } - public System.Action? ActivityStarted { get { throw null; } set { } } - public System.Action? ActivityStopped { get { throw null; } set { } } - public System.Func? ShouldListenTo { get { throw null; } set { } } - public System.Diagnostics.GetRequestedData? GetRequestedDataUsingParentId { get { throw null; } set { } } - public System.Diagnostics.GetRequestedData? GetRequestedDataUsingContext { get { throw null; } set { } } + public System.Action? ActivityStarted { get { throw null; } set { throw null; } } + public System.Action? ActivityStopped { get { throw null; } set { throw null; } } + public System.Func? ShouldListenTo { get { throw null; } set { throw null; } } + public System.Diagnostics.GetRequestedData? GetRequestedDataUsingParentId { get { throw null; } set { throw null; } } + public System.Diagnostics.GetRequestedData? GetRequestedDataUsingContext { get { throw null; } set { throw null; } } + public bool AutoGenerateRootContextTraceId { get { throw null; } set { throw null; } } public void Dispose() { throw null; } } } diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/Resources/Strings.resx b/src/libraries/System.Diagnostics.DiagnosticSource/src/Resources/Strings.resx index 1d9bff34062b..52df21c79f1e 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/Resources/Strings.resx +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/Resources/Strings.resx @@ -153,4 +153,7 @@ "StartTime is not UTC" + + "The collection already contains item with same key '{0}''" + \ No newline at end of file diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj b/src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj index f18ad5915f4a..0745b28f5a95 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj @@ -35,6 +35,7 @@ + diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs index 5382c925c2bb..5dea0482483c 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs @@ -73,7 +73,7 @@ public partial class Activity : IDisposable private byte _w3CIdFlags; - private LinkedList>? _tags; + private TagsLinkedList? _tags; private LinkedList>? _baggage; private LinkedList? _links; private LinkedList? _events; @@ -243,7 +243,19 @@ public string? RootId /// public IEnumerable> Tags { - get => _tags != null ? _tags.Enumerate() : s_emptyBaggageTags; + get => _tags?.EnumerateStringValues() ?? s_emptyBaggageTags; + } + + /// + /// List of the tags which represent information that will be logged along with the Activity to the logging system. + /// This information however is NOT passed on to the children of this activity. + /// + public IEnumerable> TagObjects + { +#if ALLOW_PARTIALLY_TRUSTED_CALLERS + [System.Security.SecuritySafeCriticalAttribute] +#endif + get => _tags?.Enumerate() ?? Unsafe.As>>(s_emptyBaggageTags); } /// @@ -340,15 +352,27 @@ public Activity(string operationName) /// /// Update the Activity to have a tag with an additional 'key' and value 'value'. - /// This shows up in the enumeration. It is meant for information that + /// This shows up in the enumeration. It is meant for information that + /// is useful to log but not needed for runtime control (for the latter, ) + /// + /// 'this' for convenient chaining + /// The tag key name + /// The tag value mapped to the input key + public Activity AddTag(string key, string? value) => AddTag(key, (object?) value); + + /// + /// Update the Activity to have a tag with an additional 'key' and value 'value'. + /// This shows up in the enumeration. It is meant for information that /// is useful to log but not needed for runtime control (for the latter, ) /// /// 'this' for convenient chaining - public Activity AddTag(string key, string? value) + /// The tag key name + /// The tag value mapped to the input key + public Activity AddTag(string key, object? value) { - KeyValuePair kvp = new KeyValuePair(key, value); + KeyValuePair kvp = new KeyValuePair(key, value); - if (_tags != null || Interlocked.CompareExchange(ref _tags, new LinkedList>(kvp), null) != null) + if (_tags != null || Interlocked.CompareExchange(ref _tags, new TagsLinkedList(kvp), null) != null) { _tags.Add(kvp); } @@ -356,6 +380,30 @@ public Activity AddTag(string key, string? value) return this; } + /// + /// Add or update the Activity tag with the input key and value. + /// If the input value is null + /// - if the collection has any tag with the same key, then this tag will get removed from the collection. + /// - otherwise, nothing will happen and the collection will not change. + /// If the input value is not null + /// - if the collection has any tag with the same key, then the value mapped to this key will get updated with the new input value. + /// - otherwise, the key and value will get added as a new tag to the collection. + /// + /// The tag key name + /// The tag value mapped to the input key + /// 'this' for convenient chaining + public Activity SetTag(string key, object value) + { + KeyValuePair kvp = new KeyValuePair(key, value); + + if (_tags != null || Interlocked.CompareExchange(ref _tags, new TagsLinkedList(kvp, set: true), null) != null) + { + _tags.Set(kvp); + } + + return this; + } + /// /// Add object to the list. /// @@ -576,9 +624,9 @@ public void Stop() SetEndTime(GetUtcNow()); } - SetCurrent(Parent); - Source.NotifyActivityStop(this); + + SetCurrent(Parent); } } @@ -872,7 +920,7 @@ public void SetCustomProperty(string propertyName, object? propertyValue) } internal static Activity CreateAndStart(ActivitySource source, string name, ActivityKind kind, string? parentId, ActivityContext parentContext, - IEnumerable>? tags, IEnumerable? links, + IEnumerable>? tags, IEnumerable? links, DateTimeOffset startTime, ActivityDataRequest request) { Activity activity = new Activity(name); @@ -929,11 +977,11 @@ internal static Activity CreateAndStart(ActivitySource source, string name, Acti if (tags != null) { - using (IEnumerator> enumerator = tags.GetEnumerator()) + using (IEnumerator> enumerator = tags.GetEnumerator()) { if (enumerator.MoveNext()) { - activity._tags = new LinkedList>(enumerator); + activity._tags = new TagsLinkedList(enumerator); } } } @@ -1227,6 +1275,135 @@ public IEnumerable Enumerate() } } + private class TagsLinkedList + { + private LinkedListNode>? _first; + private LinkedListNode>? _last; + + public TagsLinkedList(KeyValuePair firstValue, bool set = false) => _last = _first = ((set && firstValue.Value == null) ? null : new LinkedListNode>(firstValue)); + + public TagsLinkedList(IEnumerator> e) + { + _last = _first = new LinkedListNode>(e.Current); + + while (e.MoveNext()) + { + _last.Next = new LinkedListNode>(e.Current); + _last = _last.Next; + } + } + + public void Add(KeyValuePair value) + { + LinkedListNode> newNode = new LinkedListNode>(value); + + lock (this) + { + if (_first == null) + { + _first = _last = newNode; + return; + } + + Debug.Assert(_last != null); + + _last!.Next = newNode; + _last = newNode; + } + } + + public void Remove(string key) + { + if (_first == null) + { + return; + } + + lock (this) + { + if (_first.Value.Key == key) + { + _first = _first.Next; + return; + } + + LinkedListNode> previous = _first; + + while (previous.Next != null) + { + if (previous.Next.Value.Key == key) + { + previous.Next = previous.Next.Next; + return; + } + previous = previous.Next; + } + } + } + + public void Set(KeyValuePair value) + { + if (value.Value == null) + { + Remove(value.Key); + return; + } + + lock (this) + { + LinkedListNode>? current = _first; + while (current != null) + { + if (current.Value.Key == value.Key) + { + current.Value = value; + return; + } + + current = current.Next; + } + + LinkedListNode> newNode = new LinkedListNode>(value); + if (_first == null) + { + _first = _last = newNode; + return; + } + + Debug.Assert(_last != null); + + _last!.Next = newNode; + _last = newNode; + } + } + + public IEnumerable> EnumerateStringValues() + { + LinkedListNode>? current = _first; + + while (current != null) + { + if (current.Value.Value is string || current.Value.Value == null) + { + yield return new KeyValuePair(current.Value.Key, (string?) current.Value.Value); + } + + current = current.Next; + }; + } + + public IEnumerable> Enumerate() + { + LinkedListNode>? current = _first; + + while (current != null) + { + yield return current.Value; + current = current.Next; + }; + } + } + [Flags] private enum State : byte { diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityContext.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityContext.cs index 86d43ae25e2c..454eba3ab0c6 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityContext.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityContext.cs @@ -14,16 +14,21 @@ namespace System.Diagnostics /// /// Construct a new object of ActivityContext. /// - /// A trace identifier. - /// A span identifier + /// A trace identifier. + /// A span identifier. /// Contain details about the trace. - /// Carries system-specific configuration data. - public ActivityContext(ActivityTraceId traceId, ActivitySpanId spanId, ActivityTraceFlags traceFlags, string? traceState = null) + /// Carries system-specific configuration data. + /// Indicate the context is propagated from remote parent. + /// + /// isRemote is not a part of W3C specification. It is needed for the OpenTelemetry scenarios. + /// + public ActivityContext(ActivityTraceId traceId, ActivitySpanId spanId, ActivityTraceFlags traceFlags, string? traceState = null, bool isRemote = false) { TraceId = traceId; SpanId = spanId; TraceFlags = traceFlags; TraceState = traceState; + IsRemote = isRemote; } /// @@ -46,6 +51,14 @@ public ActivityContext(ActivityTraceId traceId, ActivitySpanId spanId, ActivityT /// public string? TraceState { get; } + /// + /// IsRemote indicates if the ActivityContext was propagated from a remote parent. + /// + /// + /// IsRemote is not a part of W3C specification. It is needed for the OpenTelemetry scenarios. + /// + public bool IsRemote { get; } + public bool Equals(ActivityContext value) => SpanId.Equals(value.SpanId) && TraceId.Equals(value.TraceId) && TraceFlags == value.TraceFlags && TraceState == value.TraceState; public override bool Equals(object? obj) => (obj is ActivityContext context) ? Equals(context) : false; diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityCreationOptions.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityCreationOptions.cs index b77de1dda79a..5d484594e455 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityCreationOptions.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityCreationOptions.cs @@ -19,7 +19,7 @@ public readonly struct ActivityCreationOptions /// to create the Activity object with. /// Key-value pairs list for the tags to create the Activity object with. /// list to create the Activity object with. - internal ActivityCreationOptions(ActivitySource source, string name, T parent, ActivityKind kind, IEnumerable>? tags, IEnumerable? links) + internal ActivityCreationOptions(ActivitySource source, string name, T parent, ActivityKind kind, IEnumerable>? tags, IEnumerable? links) { Source = source; Name = name; @@ -52,7 +52,7 @@ internal ActivityCreationOptions(ActivitySource source, string name, T parent, A /// /// Retrieve the tags which requested to create the Activity object with. /// - public IEnumerable>? Tags { get; } + public IEnumerable>? Tags { get; } /// /// Retrieve the list of which requested to create the Activity object with. diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityEvent.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityEvent.cs index c8abd399be70..1b1e201089f9 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityEvent.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityEvent.cs @@ -7,17 +7,17 @@ namespace System.Diagnostics { /// - /// A text annotation associated with a collection of attributes. + /// A text annotation associated with a collection of tags. /// public readonly struct ActivityEvent { - private static readonly IEnumerable> s_emptyAttributes = new Dictionary(); + private static readonly ActivityTagsCollection s_emptyTags = new ActivityTagsCollection(); /// /// Initializes a new instance of the class. /// /// Event name. - public ActivityEvent(string name) : this(name, DateTimeOffset.UtcNow, s_emptyAttributes) + public ActivityEvent(string name) : this(name, DateTimeOffset.UtcNow, s_emptyTags) { } @@ -26,29 +26,11 @@ public ActivityEvent(string name) : this(name, DateTimeOffset.UtcNow, s_emptyAtt /// /// Event name. /// Event timestamp. Timestamp MUST only be used for the events that happened in the past, not at the moment of this call. - public ActivityEvent(string name, DateTimeOffset timestamp) : this(name, timestamp, s_emptyAttributes) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// Event name. - /// Event attributes. - public ActivityEvent(string name, IEnumerable>? attributes) : this(name, default, attributes) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// Event name. - /// Event timestamp. Timestamp MUST only be used for the events that happened in the past, not at the moment of this call. - /// Event attributes. - public ActivityEvent(string name, DateTimeOffset timestamp, IEnumerable>? attributes) + /// Event Tags. + public ActivityEvent(string name, DateTimeOffset timestamp = default, ActivityTagsCollection? tags = null) { Name = name ?? string.Empty; - Attributes = attributes ?? s_emptyAttributes; + Tags = tags ?? s_emptyTags; Timestamp = timestamp != default ? timestamp : DateTimeOffset.UtcNow; } @@ -63,8 +45,8 @@ public ActivityEvent(string name, DateTimeOffset timestamp, IEnumerable - /// Gets the collection of attributes associated with the event. + /// Gets the collection of tags associated with the event. /// - public IEnumerable> Attributes { get; } + public IEnumerable> Tags { get; } } } diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityLink.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityLink.cs index d129b521bef1..d34c688ff192 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityLink.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityLink.cs @@ -17,17 +17,11 @@ namespace System.Diagnostics /// Construct a new object which can be linked to an Activity object. /// /// The trace Activity context - public ActivityLink(ActivityContext context) : this(context, null) {} - - /// - /// Construct a new object which can be linked to an Activity object. - /// - /// The trace Activity context - /// The key-value pair list of attributes which associated to the - public ActivityLink(ActivityContext context, IEnumerable>? attributes) + /// The key-value pair list of tags which associated to the + public ActivityLink(ActivityContext context, ActivityTagsCollection? tags = null) { Context = context; - Attributes = attributes; + Tags = tags; } /// @@ -36,13 +30,13 @@ public ActivityLink(ActivityContext context, IEnumerable - /// Retrieve the key-value pair list of attributes attached with the . + /// Retrieve the key-value pair list of tags attached with the . /// - public IEnumerable>? Attributes { get; } + public IEnumerable>? Tags { get; } public override bool Equals(object? obj) => (obj is ActivityLink link) && this.Equals(link); - public bool Equals(ActivityLink value) => Context == value.Context && value.Attributes == Attributes; + public bool Equals(ActivityLink value) => Context == value.Context && value.Tags == Tags; public static bool operator ==(ActivityLink left, ActivityLink right) => left.Equals(right); public static bool operator !=(ActivityLink left, ActivityLink right) => !left.Equals(right); } diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityLink.netcoreapp.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityLink.netcoreapp.cs index c2c9d57a1c10..e370bdd2f151 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityLink.netcoreapp.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityLink.netcoreapp.cs @@ -17,9 +17,9 @@ public override int GetHashCode() { HashCode hashCode = default; hashCode.Add(Context); - if (Attributes != null) + if (Tags != null) { - foreach (KeyValuePair kvp in Attributes) + foreach (KeyValuePair kvp in Tags) { hashCode.Add(kvp.Key); hashCode.Add(kvp.Value); diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityLink.netfx.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityLink.netfx.cs index 0f23122b49e9..93501800ed9d 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityLink.netfx.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityLink.netfx.cs @@ -23,9 +23,9 @@ public override int GetHashCode() // the hashing manually. int hash = 5381; hash = ((hash << 5) + hash) + this.Context.GetHashCode(); - if (Attributes != null) + if (Tags != null) { - foreach (KeyValuePair kvp in Attributes) + foreach (KeyValuePair kvp in Tags) { hash = ((hash << 5) + hash) + kvp.Key.GetHashCode(); if (kvp.Value != null) diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityListener.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityListener.cs index 804e416d6004..72ff9b29a418 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityListener.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityListener.cs @@ -47,6 +47,14 @@ public ActivityListener() /// public GetRequestedData? GetRequestedDataUsingContext { get; set; } + /// + /// Determine if the listener automatically generates a new trace Id before sampling when there is no parent context. + /// + /// + /// If this property is set to true and caused generating a new trace Id, the created object from such call will have the same generated trace Id. + /// + public bool AutoGenerateRootContextTraceId { get; set;} + /// /// Dispose will unregister this object from listeneing to events. /// diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs index 9e282ec28516..a89068f6c11b 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs @@ -87,7 +87,7 @@ public bool HasListeners() /// The optional list to initialize the created Activity object with. /// The optional start timestamp to set on the created Activity object. /// The created object or null if there is no any listener. - public Activity? StartActivity(string name, ActivityKind kind, ActivityContext parentContext, IEnumerable>? tags = null, IEnumerable? links = null, DateTimeOffset startTime = default) + public Activity? StartActivity(string name, ActivityKind kind, ActivityContext parentContext, IEnumerable>? tags = null, IEnumerable? links = null, DateTimeOffset startTime = default) => StartActivity(name, kind, parentContext, null, tags, links, startTime); /// @@ -100,10 +100,10 @@ public bool HasListeners() /// The optional list to initialize the created Activity object with. /// The optional start timestamp to set on the created Activity object. /// The created object or null if there is no any listener. - public Activity? StartActivity(string name, ActivityKind kind, string parentId, IEnumerable>? tags = null, IEnumerable? links = null, DateTimeOffset startTime = default) + public Activity? StartActivity(string name, ActivityKind kind, string parentId, IEnumerable>? tags = null, IEnumerable? links = null, DateTimeOffset startTime = default) => StartActivity(name, kind, default, parentId, tags, links, startTime); - private Activity? StartActivity(string name, ActivityKind kind, ActivityContext context, string? parentId, IEnumerable>? tags, IEnumerable? links, DateTimeOffset startTime) + private Activity? StartActivity(string name, ActivityKind kind, ActivityContext context, string? parentId, IEnumerable>? tags, IEnumerable? links, DateTimeOffset startTime) { // _listeners can get assigned to null in Dispose. SynchronizedList? listeners = _listeners; @@ -169,12 +169,18 @@ public bool HasListeners() } else { - ActivityContext initializedContext = context == default && Activity.Current != null ? Activity.Current.Context : context; - var aco = new ActivityCreationOptions(this, name, initializedContext, kind, tags, links); + ActivityContext initializedContext = context == default && Activity.Current != null ? Activity.Current.Context : context; + optionsWithContext = new ActivityCreationOptions(this, name, initializedContext, kind, tags, links); listeners.EnumWithFunc((ActivityListener listener, ref ActivityCreationOptions data, ref ActivityDataRequest request, ref bool? canUseContext, ref ActivityCreationOptions dataWithContext) => { GetRequestedData? getRequestedDataUsingContext = listener.GetRequestedDataUsingContext; if (getRequestedDataUsingContext != null) { + if (listener.AutoGenerateRootContextTraceId && !canUseContext.HasValue && data.Parent == default) + { + ActivityContext ctx = new ActivityContext(ActivityTraceId.CreateRandom(), default, default); + dataWithContext = new ActivityCreationOptions(data.Source, data.Name, ctx, data.Kind, data.Tags, data.Links); + canUseContext = true; + } ActivityDataRequest dr = getRequestedDataUsingContext(ref data); if (dr > request) { @@ -185,7 +191,7 @@ public bool HasListeners() return request != ActivityDataRequest.AllDataAndRecorded; } return true; - }, ref aco, ref dataRequest, ref useContext, ref optionsWithContext); + }, ref optionsWithContext, ref dataRequest, ref useContext, ref optionsWithContext); } if (dataRequest != ActivityDataRequest.None) diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityTagsCollection.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityTagsCollection.cs new file mode 100644 index 000000000000..74bdc49e6cd9 --- /dev/null +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivityTagsCollection.cs @@ -0,0 +1,278 @@ +// 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.Collections; +using System.Diagnostics.CodeAnalysis; + +namespace System.Diagnostics +{ + /// + /// ActivityTagsCollection is a collection class used to store tracing tags. + /// This collection will be used with classes like and . + /// This collection behaves as follows: + /// - The collection items will be ordered according to how they are added. + /// - Don't allow duplication of items with the same key. + /// - When using the indexer to store an item in the collection: + /// - If the item has a key that previously existed in the collection and the value is null, the collection item matching the key will be removed from the collection. + /// - If the item has a key that previously existed in the collection and the value is not null, the new item value will replace the old value stored in the collection. + /// - Otherwise, the item will be added to the collection. + /// - Add method will add a new item to the collection if an item doesn't already exist with the same key. Otherwise, it will throw an exception. + /// + public class ActivityTagsCollection : IDictionary + { + private List> _list = new List>(); + + /// + /// Create a new instance of the collection. + /// + public ActivityTagsCollection() + { + } + + /// + /// Create a new instance of the collection and store the input list items in the collection. + /// + /// Initial list to store in the collection. + public ActivityTagsCollection(IEnumerable> list) + { + if (list == null) + { + throw new ArgumentNullException(nameof(list)); + } + + foreach (KeyValuePair kvp in list) + { + if (kvp.Key != null) + { + this[kvp.Key] = kvp.Value; + } + } + } + + /// + /// Get or set collection item + /// When setting a value to this indexer property, the following behavior will be observed: + /// - If the key previously existed in the collection and the value is null, the collection item matching the key will get removed from the collection. + /// - If the key previously existed in the collection and the value is not null, the value will replace the old value stored in the collection. + /// - Otherwise, a new item will get added to the collection. + /// + /// Object mapped to the key + public object this[string key] + { + get + { + int index = _list.FindIndex(kvp => kvp.Key == key); + return index < 0 ? null! : _list[index].Value; + } + + set + { + if (key == null) + { + throw new ArgumentNullException(nameof(key)); + } + + int index = _list.FindIndex(kvp => kvp.Key == key); + if (value == null) + { + if (index >= 0) + { + _list.RemoveAt(index); + } + return; + } + + if (index >= 0) + { + _list[index] = new KeyValuePair(key, value); + } + else + { + _list.Add(new KeyValuePair(key, value)); + } + } + } + + /// + /// Get the list of the keys of all stored tags. + /// + public ICollection Keys + { + get + { + List list = new List(_list.Count); + foreach (KeyValuePair kvp in _list) + { + list.Add(kvp.Key); + } + return list; + } + } + + /// + /// Get the list of the values of all stored tags. + /// + public ICollection Values + { + get + { + List list = new List(_list.Count); + foreach (KeyValuePair kvp in _list) + { + list.Add(kvp.Value); + } + return list; + } + } + + /// + /// Gets a value indicating whether the collection is read-only. + /// + public bool IsReadOnly => false; + + /// + /// Gets the number of elements contained in the collection. + /// + public int Count => _list.Count; + + /// + /// Adds a tag with the provided key and value to the collection. + /// This collection doesn't allow adding two tags with the same key. + /// + /// The tag key. + /// The tag value. + public void Add(string key, object value) + { + if (key == null) + { + throw new ArgumentNullException(nameof(key)); + } + + int index = _list.FindIndex(kvp => kvp.Key == key); + if (index >= 0) + { + throw new InvalidOperationException(SR.Format(SR.KeyAlreadyExist, key)); + } + + _list.Add(new KeyValuePair(key, value)); + } + + /// + /// Adds an item to the collection + /// + /// Key and value pair of the tag to add to the collection. + public void Add(KeyValuePair item) + { + if (item.Key == null) + { + throw new ArgumentNullException(nameof(item)); + } + + int index = _list.FindIndex(kvp => kvp.Key == item.Key); + if (index >= 0) + { + throw new InvalidOperationException(SR.Format(SR.KeyAlreadyExist, item.Key)); + } + + _list.Add(item); + } + + /// + /// Removes all items from the collection. + /// + public void Clear() => _list.Clear(); + + public bool Contains(KeyValuePair item) => _list.Contains(item); + + /// + /// Determines whether the collection contains an element with the specified key. + /// + /// + /// True if the collection contains tag with that key. False otherwise. + public bool ContainsKey(string key) => _list.FindIndex(kvp => kvp.Key == key) >= 0; + + /// + /// Copies the elements of the collection to an array, starting at a particular array index. + /// + /// The array that is the destination of the elements copied from collection. + /// The zero-based index in array at which copying begins. + public void CopyTo(KeyValuePair[] array, int arrayIndex) => _list.CopyTo(array, arrayIndex); + + /// + /// Returns an enumerator that iterates through the collection. + /// + IEnumerator> IEnumerable>.GetEnumerator() => new Enumerator(_list); + + /// + /// Returns an enumerator that iterates through the collection. + /// + public Enumerator GetEnumerator() => new Enumerator(_list); + + /// + /// Returns an enumerator that iterates through the collection. + /// + IEnumerator IEnumerable.GetEnumerator() => new Enumerator(_list); + + /// + /// Removes the tag with the specified key from the collection. + /// + /// The tag key + /// True if the item existed and removed. False otherwise. + public bool Remove(string key) + { + if (key == null) + { + throw new ArgumentNullException(nameof(key)); + } + + int index = _list.FindIndex(kvp => kvp.Key == key); + if (index >= 0) + { + _list.RemoveAt(index); + return true; + } + + return false; + } + + /// + /// Removes the first occurrence of a specific item from the collection. + /// + /// The tag key value pair to remove. + /// True if item was successfully removed from the collection; otherwise, false. This method also returns false if item is not found in the original collection. + public bool Remove(KeyValuePair item) => _list.Remove(item); + + /// + /// Gets the value associated with the specified key. + /// + /// The tag key. + /// The tag value. + /// When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. + public bool TryGetValue(string key, [MaybeNullWhen(false)] out object value) + { + int index = _list.FindIndex(kvp => kvp.Key == key); + if (index >= 0) + { + value = _list[index].Value; + return true; + } + + value = null; + return false; + } + + public struct Enumerator : IEnumerator>, IEnumerator + { + private List>.Enumerator _enumerator; + internal Enumerator(List> list) => _enumerator = list.GetEnumerator(); + + public KeyValuePair Current => _enumerator.Current; + object IEnumerator.Current => ((IEnumerator)_enumerator).Current; + public void Dispose() => _enumerator.Dispose(); + public bool MoveNext() => _enumerator.MoveNext(); + void IEnumerator.Reset() => ((IEnumerator)_enumerator).Reset(); + } + } +} \ No newline at end of file diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivitySourceTests.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivitySourceTests.cs index fdd3365d78d7..2f3be9de4957 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivitySourceTests.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivitySourceTests.cs @@ -318,10 +318,10 @@ public void TestActivityCreationProperties() links.Add(new ActivityLink(new ActivityContext(ActivityTraceId.CreateRandom(), ActivitySpanId.CreateRandom(), ActivityTraceFlags.None, "key1-value1"))); links.Add(new ActivityLink(new ActivityContext(ActivityTraceId.CreateRandom(), ActivitySpanId.CreateRandom(), ActivityTraceFlags.None, "key2-value2"))); - List> attributes = new List>(); - attributes.Add(new KeyValuePair("tag1", "tagValue1")); - attributes.Add(new KeyValuePair("tag2", "tagValue2")); - attributes.Add(new KeyValuePair("tag3", "tagValue3")); + List> attributes = new List>(); + attributes.Add(new KeyValuePair("tag1", "tagValue1")); + attributes.Add(new KeyValuePair("tag2", "tagValue2")); + attributes.Add(new KeyValuePair("tag3", "tagValue3")); using (Activity activity = source.StartActivity("a1", ActivityKind.Client, ctx, attributes, links)) { @@ -336,7 +336,7 @@ public void TestActivityCreationProperties() Assert.Equal(ctx.TraceState, activity.TraceStateString); Assert.Equal(ActivityIdFormat.W3C, activity.IdFormat); - foreach (KeyValuePair pair in attributes) + foreach (KeyValuePair pair in attributes) { Assert.NotEqual(default, activity.Tags.FirstOrDefault((p) => pair.Key == p.Key && pair.Value == pair.Value)); } @@ -434,6 +434,133 @@ public void TestCreatingActivityUsingDifferentParentIds() }).Dispose(); } + [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] + public void TestActivityContextIsRemote() + { + RemoteExecutor.Invoke(() => { + ActivityContext ctx = new ActivityContext(ActivityTraceId.CreateRandom(), ActivitySpanId.CreateRandom(), default); + Assert.False(ctx.IsRemote); + + bool isRemote = false; + + using ActivitySource aSource = new ActivitySource("RemoteContext"); + using ActivityListener listener = new ActivityListener(); + listener.ShouldListenTo = (activitySource) => activitySource.Name == "RemoteContext"; + + listener.GetRequestedDataUsingContext = (ref ActivityCreationOptions activityOptions) => + { + isRemote = activityOptions.Parent.IsRemote; + return ActivityDataRequest.AllData; + }; + + ActivitySource.AddActivityListener(listener); + + foreach (bool b in new bool[] { true, false }) + { + ctx = new ActivityContext(ActivityTraceId.CreateRandom(), ActivitySpanId.CreateRandom(), default, default, b); + Assert.Equal(b, ctx.IsRemote); + + aSource.StartActivity("a1", default, ctx); + Assert.Equal(b , isRemote); + } + }).Dispose(); + } + + [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] + public void TestTraceIdAutoGeneration() + { + RemoteExecutor.Invoke(() => { + + using ActivitySource aSource = new ActivitySource("TraceIdAutoGeneration"); + using ActivityListener listener = new ActivityListener(); + listener.ShouldListenTo = (activitySource) => activitySource.Name == "TraceIdAutoGeneration"; + + ActivityContext ctx = default; + + listener.GetRequestedDataUsingContext = (ref ActivityCreationOptions activityOptions) => + { + ctx = activityOptions.Parent; + return ActivityDataRequest.AllData; + }; + + ActivitySource.AddActivityListener(listener); + + using (aSource.StartActivity("a1", default, ctx)) + { + Assert.Equal(default, ctx); + } + + listener.AutoGenerateRootContextTraceId = true; + + Activity activity = aSource.StartActivity("a2", default, ctx); + + Assert.NotNull(activity); + Assert.NotEqual(default, ctx); + Assert.Equal(ctx.TraceId, activity.TraceId); + Assert.Equal(ctx.SpanId.ToHexString(), activity.ParentSpanId.ToHexString()); + Assert.Equal(default(ActivitySpanId).ToHexString(), ctx.SpanId.ToHexString()); + }).Dispose(); + } + + [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] + public void TestTraceIdAutoGenerationWithNullParentId() + { + RemoteExecutor.Invoke(() => { + + using ActivitySource aSource = new ActivitySource("TraceIdAutoGenerationWithNullParent"); + using ActivityListener listener = new ActivityListener(); + listener.ShouldListenTo = (activitySource) => activitySource.Name == "TraceIdAutoGenerationWithNullParent"; + + ActivityContext ctx = default; + + listener.GetRequestedDataUsingContext = (ref ActivityCreationOptions activityOptions) => + { + ctx = activityOptions.Parent; + return ActivityDataRequest.AllData; + }; + + listener.AutoGenerateRootContextTraceId = true; + ActivitySource.AddActivityListener(listener); + + Activity activity = aSource.StartActivity("a2", default, null); + + Assert.NotNull(activity); + Assert.NotEqual(default, ctx); + Assert.Equal(ctx.TraceId, activity.TraceId); + Assert.Equal(ctx.SpanId.ToHexString(), activity.ParentSpanId.ToHexString()); + Assert.Equal(default(ActivitySpanId).ToHexString(), ctx.SpanId.ToHexString()); + }).Dispose(); + } + + [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] + public void TestEventNotificationOrder() + { + RemoteExecutor.Invoke(() => { + + Activity parent = Activity.Current; + Activity child = null; + + using ActivitySource aSource = new ActivitySource("EventNotificationOrder"); + using ActivityListener listener = new ActivityListener(); + + listener.ShouldListenTo = (activitySource) => activitySource.Name == "EventNotificationOrder"; + listener.GetRequestedDataUsingContext = (ref ActivityCreationOptions activityOptions) => ActivityDataRequest.AllData; + listener.ActivityStopped = a => Assert.Equal(child, Activity.Current); + + ActivitySource.AddActivityListener(listener); + + using (child = aSource.StartActivity("a1")) + { + Assert.NotNull(child); + // by the end of this block, the stop event notification will fire and ActivityListener.ActivityStopped will get called. + // assert there that the created activity is still set as Current activity. + } + + // Now the Current should be restored back. + Assert.Equal(parent, Activity.Current); + }).Dispose(); + } + public void Dispose() => Activity.Current = null; } } diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTagsCollectionTests.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTagsCollectionTests.cs new file mode 100644 index 000000000000..eb27d13c1f4c --- /dev/null +++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTagsCollectionTests.cs @@ -0,0 +1,200 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading; +using System.Reflection; +using System.Threading.Tasks; +using Microsoft.DotNet.RemoteExecutor; +using Xunit; + +namespace System.Diagnostics.Tests +{ + public class ActivityTagsCollectionTests : IDisposable + { + private readonly static KeyValuePair [] s_list = new KeyValuePair[] + { + new KeyValuePair("Key1", "Value1"), + new KeyValuePair("Key2", "Value2"), + new KeyValuePair("Key3", "Value3"), + new KeyValuePair("Key4", "Value4"), + + // Duplicate Keys to replace the old one + new KeyValuePair("Key3", 3), + new KeyValuePair("Key4", true), + + // null values is not allowed. + new KeyValuePair("Key5", null), + }; + + + [Fact] + public void TestDefaultConstructor() + { + ActivityTagsCollection tags = new ActivityTagsCollection(); + Assert.Equal(0, tags.Count); + Assert.Equal(0, tags.Keys.Count); + Assert.Equal(0, tags.Values.Count); + Assert.False(tags.Remove("")); + Assert.False(tags.Remove(new KeyValuePair("", null))); + Assert.False(tags.TryGetValue("", out object _)); + Assert.False(tags.Contains(new KeyValuePair("", null))); + Assert.False(tags.ContainsKey("")); + Assert.False(tags.IsReadOnly); + Assert.Null(tags[""]); + } + + [Fact] + public void TestNonDefaultConstructor() + { + ActivityTagsCollection tags = new ActivityTagsCollection(s_list); + + Assert.Equal(4, tags.Count); + Assert.Equal(4, tags.Keys.Count); + Assert.Equal(4, tags.Values.Count); + + Assert.Equal(3, tags["Key3"]); + Assert.True((bool) tags["Key4"]); + } + + [Fact] + public void TestAdd() + { + ActivityTagsCollection tags = new ActivityTagsCollection(); + tags.Add("k1", "v1"); + tags.Add("k2", 2); + tags.Add("k3", new List()); + + Assert.Equal(3, tags.Count); + Assert.Equal("v1", tags["k1"]); + Assert.Equal(2, tags["k2"]); + Assert.True(tags["k3"] is List); + Assert.Null(tags["k4"]); + + AssertExtensions.Throws(() => tags.Add(null, "v")); + AssertExtensions.Throws(() => tags.Add("k1", "v")); + } + + [Fact] + public void TestTryGetValue() + { + ActivityTagsCollection tags = new ActivityTagsCollection(); + tags.Add("k1", "v1"); + tags.Add("k2", 2); + + var list = new List(); + tags.Add("k3", list); + + Assert.True(tags.TryGetValue("k1", out object o)); + Assert.Equal("v1", o); + + Assert.True(tags.TryGetValue("k2", out o)); + Assert.Equal(2, o); + + Assert.True(tags.TryGetValue("k3", out o)); + Assert.Equal(list, tags["k3"]); + + Assert.False(tags.TryGetValue("k4", out o)); + } + + [Fact] + public void TestIndexer() + { + ActivityTagsCollection tags = new ActivityTagsCollection(); + Assert.Null(tags["k1"]); + Assert.Equal(0, tags.Count); + + tags["k1"] = "v1"; + Assert.Equal("v1", tags["k1"]); + Assert.Equal(1, tags.Count); + + tags["k1"] = "v2"; + Assert.Equal("v2", tags["k1"]); + Assert.Equal(1, tags.Count); + + tags["k1"] = null; + Assert.Null(tags["k1"]); + Assert.Equal(0, tags.Count); + + AssertExtensions.Throws(() => tags[null] = ""); + } + + [Fact] + public void TestContains() + { + ActivityTagsCollection tags = new ActivityTagsCollection(s_list); + Assert.True(tags.ContainsKey("Key1")); + Assert.True(tags.Contains(s_list[0])); + + Assert.True(tags.ContainsKey("Key2")); + Assert.True(tags.Contains(s_list[1])); + + Assert.True(tags.ContainsKey("Key3")); + Assert.False(tags.Contains(s_list[2])); + Assert.True(tags.Contains(s_list[4])); + + Assert.True(tags.ContainsKey("Key4")); + Assert.False(tags.Contains(s_list[3])); + Assert.True(tags.Contains(s_list[5])); + } + + [Fact] + public void TestRemove() + { + ActivityTagsCollection tags = new ActivityTagsCollection(s_list); + Assert.True(tags.ContainsKey("Key1")); + Assert.True(tags.Remove("Key1")); + Assert.False(tags.ContainsKey("Key1")); + + Assert.True(tags.ContainsKey("Key2")); + Assert.True(tags.Remove(new KeyValuePair("Key2", "Value2"))); + Assert.False(tags.ContainsKey("Key2")); + + Assert.True(tags.Contains(new KeyValuePair("Key3", 3))); + Assert.False(tags.Remove(new KeyValuePair("Key3", 4))); + Assert.True(tags.Remove(new KeyValuePair("Key3", 3))); + } + + [Fact] + public void TestEnumeration() + { + var list = new KeyValuePair[20]; + for (int i = 0; i < list.Length; i++) + { + list[i] = new KeyValuePair(i.ToString(), i); + } + + ActivityTagsCollection tags = new ActivityTagsCollection(list); + + int index = 0; + foreach (KeyValuePair kvp in tags) + { + Assert.Equal(new KeyValuePair(index.ToString(), index), kvp); + index++; + } + Assert.Equal(list.Length, index); + + index = 0; + foreach (string key in tags.Keys) + { + Assert.Equal(index.ToString(), key); + index++; + } + Assert.Equal(list.Length, index); + + index = 0; + foreach (object value in tags.Values) + { + Assert.Equal(index, value); + index++; + } + Assert.Equal(list.Length, index); + } + + + public void Dispose() => Activity.Current = null; + } +} diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTests.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTests.cs index 8af17417a0b0..a085d3103bdb 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTests.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTests.cs @@ -1411,11 +1411,11 @@ public void TestEvent() Assert.Equal(2, activity.Events.Count()); Assert.Equal("Event1", activity.Events.ElementAt(0).Name); Assert.Equal(ts1, activity.Events.ElementAt(0).Timestamp); - Assert.Equal(0, activity.Events.ElementAt(0).Attributes.Count()); + Assert.Equal(0, activity.Events.ElementAt(0).Tags.Count()); Assert.Equal("Event2", activity.Events.ElementAt(1).Name); Assert.Equal(ts2, activity.Events.ElementAt(1).Timestamp); - Assert.Equal(0, activity.Events.ElementAt(1).Attributes.Count()); + Assert.Equal(0, activity.Events.ElementAt(1).Tags.Count()); } [Fact] @@ -1428,6 +1428,86 @@ public void TestIsAllDataRequested() Assert.Equal(1, a1.Tags.Count()); } + [Fact] + public void TestTagObjects() + { + Activity activity = new Activity("TagObjects"); + Assert.Equal(0, activity.Tags.Count()); + Assert.Equal(0, activity.TagObjects.Count()); + + activity.AddTag("s1", "s1").AddTag("s2", "s2").AddTag("s3", null); + Assert.Equal(3, activity.Tags.Count()); + Assert.Equal(3, activity.TagObjects.Count()); + + KeyValuePair[] tags = activity.Tags.ToArray(); + KeyValuePair[] tagObjects = activity.TagObjects.ToArray(); + Assert.Equal(tags.Length, tagObjects.Length); + + for (int i = 0; i < tagObjects.Length; i++) + { + Assert.Equal(tags[i].Key, tagObjects[i].Key); + Assert.Equal(tags[i].Value, tagObjects[i].Value); + } + + activity.AddTag("s4", (object) null); + Assert.Equal(4, activity.Tags.Count()); + Assert.Equal(4, activity.TagObjects.Count()); + tags = activity.Tags.ToArray(); + tagObjects = activity.TagObjects.ToArray(); + Assert.Equal(tags[3].Key, tagObjects[3].Key); + Assert.Equal(tags[3].Value, tagObjects[3].Value); + + activity.AddTag("s5", 5); + Assert.Equal(4, activity.Tags.Count()); + Assert.Equal(5, activity.TagObjects.Count()); + tagObjects = activity.TagObjects.ToArray(); + Assert.Equal(5, tagObjects[4].Value); + + activity.AddTag(null, null); // we allow that and we keeping the behavior for the compatability reason + Assert.Equal(5, activity.Tags.Count()); + Assert.Equal(6, activity.TagObjects.Count()); + + activity.SetTag("s6", "s6"); + Assert.Equal(6, activity.Tags.Count()); + Assert.Equal(7, activity.TagObjects.Count()); + + activity.SetTag("s5", "s6"); + Assert.Equal(7, activity.Tags.Count()); + Assert.Equal(7, activity.TagObjects.Count()); + + activity.SetTag("s3", null); // remove the tag + Assert.Equal(6, activity.Tags.Count()); + Assert.Equal(6, activity.TagObjects.Count()); + + tags = activity.Tags.ToArray(); + tagObjects = activity.TagObjects.ToArray(); + for (int i = 0; i < tagObjects.Length; i++) + { + Assert.Equal(tags[i].Key, tagObjects[i].Key); + Assert.Equal(tags[i].Value, tagObjects[i].Value); + } + } + + [Theory] + [InlineData("key1", null, true, 1)] + [InlineData("key2", null, false, 0)] + [InlineData("key3", "v1", true, 1)] + [InlineData("key4", "v2", false, 1)] + public void TestInsertingFirstTag(string key, object value, bool add, int resultCount) + { + Activity a = new Activity("SetFirstTag"); + if (add) + { + a.AddTag(key, value); + } + else + { + a.SetTag(key, value); + } + + Assert.Equal(resultCount, a.TagObjects.Count()); + } + public void Dispose() { Activity.Current = null; diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/System.Diagnostics.DiagnosticSource.Tests.csproj b/src/libraries/System.Diagnostics.DiagnosticSource/tests/System.Diagnostics.DiagnosticSource.Tests.csproj index ed8d7de3079d..d06639f76f9c 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/System.Diagnostics.DiagnosticSource.Tests.csproj +++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/System.Diagnostics.DiagnosticSource.Tests.csproj @@ -10,13 +10,12 @@ + - - + + \ No newline at end of file diff --git a/src/libraries/System.Diagnostics.EventLog/Directory.Build.props b/src/libraries/System.Diagnostics.EventLog/Directory.Build.props index bdcfca3b543c..2f8a8940e012 100644 --- a/src/libraries/System.Diagnostics.EventLog/Directory.Build.props +++ b/src/libraries/System.Diagnostics.EventLog/Directory.Build.props @@ -2,5 +2,6 @@ Open + true \ No newline at end of file diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/Directory.Build.props b/src/libraries/System.Diagnostics.PerformanceCounter/Directory.Build.props index bdcfca3b543c..2f8a8940e012 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/Directory.Build.props +++ b/src/libraries/System.Diagnostics.PerformanceCounter/Directory.Build.props @@ -2,5 +2,6 @@ Open + true \ No newline at end of file diff --git a/src/libraries/System.Diagnostics.Process/Directory.Build.props b/src/libraries/System.Diagnostics.Process/Directory.Build.props index 465e1110d6b0..42c6eafce67e 100644 --- a/src/libraries/System.Diagnostics.Process/Directory.Build.props +++ b/src/libraries/System.Diagnostics.Process/Directory.Build.props @@ -3,5 +3,6 @@ Microsoft true + true \ No newline at end of file diff --git a/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs b/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs index 2f414aac45a8..60808eea784a 100644 --- a/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs +++ b/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs @@ -41,8 +41,8 @@ public Process() { } public System.Diagnostics.ProcessModule? MainModule { get { throw null; } } public System.IntPtr MainWindowHandle { get { throw null; } } public string MainWindowTitle { get { throw null; } } - public System.IntPtr MaxWorkingSet { get { throw null; } set { } } - public System.IntPtr MinWorkingSet { get { throw null; } set { } } + public System.IntPtr MaxWorkingSet { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } } + public System.IntPtr MinWorkingSet { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } } public System.Diagnostics.ProcessModuleCollection Modules { get { throw null; } } [System.ObsoleteAttribute("This property has been deprecated. Please use System.Diagnostics.Process.NonpagedSystemMemorySize64 instead. https://go.microsoft.com/fwlink/?linkid=14202")] public int NonpagedSystemMemorySize { get { throw null; } } @@ -116,8 +116,10 @@ public void Refresh() { } public static System.Diagnostics.Process Start(string fileName) { throw null; } public static System.Diagnostics.Process Start(string fileName, string arguments) { throw null; } [System.CLSCompliantAttribute(false)] + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static System.Diagnostics.Process Start(string fileName, string userName, System.Security.SecureString password, string domain) { throw null; } [System.CLSCompliantAttribute(false)] + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static System.Diagnostics.Process Start(string fileName, string arguments, string userName, System.Security.SecureString password, string domain) { throw null; } public override string ToString() { throw null; } public void WaitForExit() { } @@ -163,15 +165,19 @@ public ProcessStartInfo(string fileName, string arguments) { } public System.Collections.ObjectModel.Collection ArgumentList { get { throw null; } } public string Arguments { get { throw null; } set { } } public bool CreateNoWindow { get { throw null; } set { } } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public string Domain { get { throw null; } set { } } public System.Collections.Generic.IDictionary Environment { get { throw null; } } public System.Collections.Specialized.StringDictionary EnvironmentVariables { get { throw null; } } public bool ErrorDialog { get { throw null; } set { } } public System.IntPtr ErrorDialogParentHandle { get { throw null; } set { } } public string FileName { get { throw null; } set { } } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public bool LoadUserProfile { get { throw null; } set { } } [System.CLSCompliantAttribute(false)] + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public System.Security.SecureString? Password { get { throw null; } set { } } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public string? PasswordInClearText { get { throw null; } set { } } public bool RedirectStandardError { get { throw null; } set { } } public bool RedirectStandardInput { get { throw null; } set { } } @@ -196,8 +202,9 @@ internal ProcessThread() { } public int Id { get { throw null; } } public int IdealProcessor { set { } } public bool PriorityBoostEnabled { get { throw null; } set { } } - public System.Diagnostics.ThreadPriorityLevel PriorityLevel { get { throw null; } set { } } + public System.Diagnostics.ThreadPriorityLevel PriorityLevel { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } } public System.TimeSpan PrivilegedProcessorTime { get { throw null; } } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public System.IntPtr ProcessorAffinity { set { } } public System.IntPtr StartAddress { get { throw null; } } public System.DateTime StartTime { get { throw null; } } diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs index 131912f5729f..845c054930dd 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs @@ -9,6 +9,7 @@ using System.Security; using System.Text; using System.Threading; +using System.Runtime.Versioning; namespace System.Diagnostics { @@ -41,12 +42,14 @@ public static void LeaveDebugMode() } [CLSCompliant(false)] + [MinimumOSPlatform("windows7.0")] public static Process Start(string fileName, string userName, SecureString password, string domain) { throw new PlatformNotSupportedException(SR.ProcessStartWithPasswordAndDomainNotSupported); } [CLSCompliant(false)] + [MinimumOSPlatform("windows7.0")] public static Process Start(string fileName, string arguments, string userName, SecureString password, string domain) { throw new PlatformNotSupportedException(SR.ProcessStartWithPasswordAndDomainNotSupported); diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Windows.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Windows.cs index 34e17620dca7..f56571300cea 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Windows.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Windows.cs @@ -6,6 +6,7 @@ using System.ComponentModel; using System.IO; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using System.Security; using System.Text; using System.Threading; @@ -46,6 +47,7 @@ public static Process[] GetProcessesByName(string? processName, string machineNa } [CLSCompliant(false)] + [MinimumOSPlatform("windows7.0")] public static Process? Start(string fileName, string userName, SecureString password, string domain) { ProcessStartInfo startInfo = new ProcessStartInfo(fileName); @@ -57,6 +59,7 @@ public static Process[] GetProcessesByName(string? processName, string machineNa } [CLSCompliant(false)] + [MinimumOSPlatform("windows7.0")] public static Process? Start(string fileName, string arguments, string userName, SecureString password, string domain) { ProcessStartInfo startInfo = new ProcessStartInfo(fileName, arguments); diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs index e47cac99ac81..17b665eb5dd0 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs @@ -10,6 +10,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; +using System.Runtime.Versioning; namespace System.Diagnostics { @@ -264,6 +265,7 @@ public IntPtr MaxWorkingSet EnsureWorkingSetLimits(); return _maxWorkingSet; } + [MinimumOSPlatform("windows7.0")] set { SetWorkingSetLimits(null, value); @@ -283,6 +285,7 @@ public IntPtr MinWorkingSet EnsureWorkingSetLimits(); return _minWorkingSet; } + [MinimumOSPlatform("windows7.0")] set { SetWorkingSetLimits(value, null); diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.Unix.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.Unix.cs index 339e87248a81..1af5bb923dc9 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.Unix.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.Unix.cs @@ -3,6 +3,7 @@ using System; using System.Security; +using System.Runtime.Versioning; namespace System.Diagnostics { @@ -13,18 +14,21 @@ public sealed partial class ProcessStartInfo { private const bool CaseSensitiveEnvironmentVariables = true; + [MinimumOSPlatform("windows7.0")] public string PasswordInClearText { get { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(PasswordInClearText))); } set { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(PasswordInClearText))); } } + [MinimumOSPlatform("windows7.0")] public string Domain { get { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(Domain))); } set { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(Domain))); } } + [MinimumOSPlatform("windows7.0")] public bool LoadUserProfile { get { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(LoadUserProfile))); } @@ -36,6 +40,7 @@ public bool LoadUserProfile public string[] Verbs => Array.Empty(); [CLSCompliant(false)] + [MinimumOSPlatform("windows7.0")] public SecureString Password { get { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(Password))); } diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.Windows.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.Windows.cs index 465cd0b5ed87..5545b0590f4c 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.Windows.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.Windows.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Security; +using System.Runtime.Versioning; namespace System.Diagnostics { @@ -11,17 +12,21 @@ public sealed partial class ProcessStartInfo private const bool CaseSensitiveEnvironmentVariables = false; + [MinimumOSPlatform("windows7.0")] public string? PasswordInClearText { get; set; } + [MinimumOSPlatform("windows7.0")] public string Domain { get => _domain ?? string.Empty; set => _domain = value; } + [MinimumOSPlatform("windows7.0")] public bool LoadUserProfile { get; set; } [CLSCompliant(false)] + [MinimumOSPlatform("windows7.0")] public SecureString? Password { get; set; } } } diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.Unix.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.Unix.cs index cca6089914ed..ac65c2dffb87 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.Unix.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.Unix.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Runtime.Versioning; + namespace System.Diagnostics { public partial class ProcessThread @@ -39,6 +41,7 @@ private bool PriorityBoostEnabledCore /// two, etc. For example, the value 1 means run on processor one, 2 means run on /// processor two, 3 means run on processor one or two. /// + [MinimumOSPlatform("windows7.0")] public IntPtr ProcessorAffinity { set { throw new PlatformNotSupportedException(); } // No ability to change the affinity of a thread in an arbitrary process diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.Windows.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.Windows.cs index 99fd7415725a..450a1d77edf3 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.Windows.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.Windows.cs @@ -3,6 +3,7 @@ using Microsoft.Win32.SafeHandles; using System.ComponentModel; +using System.Runtime.Versioning; namespace System.Diagnostics { @@ -99,6 +100,7 @@ private ThreadPriorityLevel PriorityLevelCore /// two, etc. For example, the value 1 means run on processor one, 2 means run on /// processor two, 3 means run on processor one or two. /// + [MinimumOSPlatform("windows7.0")] public IntPtr ProcessorAffinity { set diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs index 4d68dd2233c3..b4ad10f029c5 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.ComponentModel; +using System.Runtime.Versioning; namespace System.Diagnostics { @@ -94,6 +95,7 @@ public ThreadPriorityLevel PriorityLevel } return _priorityLevel.Value; } + [MinimumOSPlatform("windows7.0")] set { PriorityLevelCore = value; diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessWaitState.Unix.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessWaitState.Unix.cs index 12246367d29b..03e93a725c4b 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessWaitState.Unix.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessWaitState.Unix.cs @@ -500,7 +500,7 @@ internal bool WaitForExit(int millisecondsTimeout) /// Spawns an asynchronous polling loop for process completion. /// A token to monitor to exit the polling loop. /// The task representing the loop. - private Task WaitForExitAsync(CancellationToken cancellationToken = default(CancellationToken)) + private Task WaitForExitAsync(CancellationToken cancellationToken = default) { Debug.Assert(Monitor.IsEntered(_gate)); Debug.Assert(_waitInProgress == null); @@ -549,7 +549,7 @@ internal bool WaitForExit(int millisecondsTimeout) _waitInProgress = null; } } - }); + }, cancellationToken); } private bool TryReapChild() diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs index 3e860543950a..6aca35f46032 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs @@ -33,7 +33,7 @@ private void TestWindowApisUnix() } [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] - public void MainWindowHandle_GetUnix_ThrowsPlatformNotSupportedException() + public void MainWindowHandle_GetUnix_ReturnsDefaultValue() { CreateDefaultProcess(); diff --git a/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameExtensionsTests.cs b/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameExtensionsTests.cs index a8572840bfac..aaecae6e7fb2 100644 --- a/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameExtensionsTests.cs +++ b/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameExtensionsTests.cs @@ -6,6 +6,7 @@ namespace System.Diagnostics.Tests { + [ActiveIssue("https://github.com/dotnet/runtime/issues/39223", TestPlatforms.Browser)] public class StackFrameExtensionsTests { public static IEnumerable StackFrame_TestData() diff --git a/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameTests.cs b/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameTests.cs index e80c6b950960..445ae86ca6f1 100644 --- a/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameTests.cs +++ b/src/libraries/System.Diagnostics.StackTrace/tests/StackFrameTests.cs @@ -8,6 +8,7 @@ namespace System.Diagnostics.Tests { + [ActiveIssue("https://github.com/dotnet/runtime/issues/39223", TestPlatforms.Browser)] public class StackFrameTests { [Fact] diff --git a/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceSymbolsTests.cs b/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceSymbolsTests.cs index e65b7587e8ce..ba291aeb1d95 100644 --- a/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceSymbolsTests.cs +++ b/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceSymbolsTests.cs @@ -7,6 +7,7 @@ namespace System.Diagnostics.SymbolStore.Tests { + [ActiveIssue("https://github.com/dotnet/runtime/issues/39223", TestPlatforms.Browser)] public class StackTraceSymbolsTests { [Fact] diff --git a/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceTests.cs b/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceTests.cs index 894374ba29b4..67119f9799cf 100644 --- a/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceTests.cs +++ b/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceTests.cs @@ -29,6 +29,7 @@ public static StackTrace MethodWithException() namespace System.Diagnostics.Tests { + [ActiveIssue("https://github.com/dotnet/runtime/issues/39223", TestPlatforms.Browser)] public class StackTraceTests { [Fact] diff --git a/src/libraries/System.Diagnostics.TextWriterTraceListener/src/System/Diagnostics/XmlWriterTraceListener.cs b/src/libraries/System.Diagnostics.TextWriterTraceListener/src/System/Diagnostics/XmlWriterTraceListener.cs index cf38c8d85395..bf97f5fe8418 100644 --- a/src/libraries/System.Diagnostics.TextWriterTraceListener/src/System/Diagnostics/XmlWriterTraceListener.cs +++ b/src/libraries/System.Diagnostics.TextWriterTraceListener/src/System/Diagnostics/XmlWriterTraceListener.cs @@ -258,8 +258,15 @@ private void WriteEndHeader() string? processName = s_processName; if (processName is null) { - using Process process = Process.GetCurrentProcess(); - s_processName = processName = process.ProcessName; + try + { + using Process process = Process.GetCurrentProcess(); + s_processName = processName = process.ProcessName; + } + catch (PlatformNotSupportedException) // Process isn't supported on Browser + { + s_processName = processName = string.Empty; + } } InternalWrite("\" />"); diff --git a/src/libraries/System.Diagnostics.TextWriterTraceListener/tests/XmlWriterTraceListenerTests.cs b/src/libraries/System.Diagnostics.TextWriterTraceListener/tests/XmlWriterTraceListenerTests.cs index efcfb6f8a563..d71818e9fd09 100644 --- a/src/libraries/System.Diagnostics.TextWriterTraceListener/tests/XmlWriterTraceListenerTests.cs +++ b/src/libraries/System.Diagnostics.TextWriterTraceListener/tests/XmlWriterTraceListenerTests.cs @@ -18,9 +18,16 @@ public class XmlWriterTraceListenerTests : FileCleanupTestBase public XmlWriterTraceListenerTests() { - using (var process = Process.GetCurrentProcess()) + try { - _processName = process.ProcessName; + using (var process = Process.GetCurrentProcess()) + { + _processName = process.ProcessName; + } + } + catch (PlatformNotSupportedException) // Process isn't supported on Browser + { + _processName = string.Empty; } } diff --git a/src/libraries/System.Diagnostics.TraceSource/ref/System.Diagnostics.TraceSource.cs b/src/libraries/System.Diagnostics.TraceSource/ref/System.Diagnostics.TraceSource.cs index cdd2767aec4e..f8877f9c2b80 100644 --- a/src/libraries/System.Diagnostics.TraceSource/ref/System.Diagnostics.TraceSource.cs +++ b/src/libraries/System.Diagnostics.TraceSource/ref/System.Diagnostics.TraceSource.cs @@ -212,7 +212,7 @@ protected TraceListener(string? name) { } public int IndentLevel { get { throw null; } set { } } public int IndentSize { get { throw null; } set { } } public virtual bool IsThreadSafe { get { throw null; } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public virtual string Name { get { throw null; } set { } } protected bool NeedIndent { get { throw null; } set { } } public System.Diagnostics.TraceOptions TraceOutputOptions { get { throw null; } set { } } diff --git a/src/libraries/System.Diagnostics.TraceSource/tests/TraceClassTests.cs b/src/libraries/System.Diagnostics.TraceSource/tests/TraceClassTests.cs index 05a6891e31cf..b74f30dbb3e1 100644 --- a/src/libraries/System.Diagnostics.TraceSource/tests/TraceClassTests.cs +++ b/src/libraries/System.Diagnostics.TraceSource/tests/TraceClassTests.cs @@ -11,8 +11,6 @@ namespace System.Diagnostics.TraceSourceTests public class TraceClassTests : IDisposable { - private readonly string TestRunnerAssemblyName = Assembly.GetEntryAssembly().GetName().Name; - void IDisposable.Dispose() { TraceTestHelper.ResetState(); @@ -339,11 +337,12 @@ public void TraceTest01() Trace.IndentLevel = 0; Trace.WriteLine("Message end."); textTL.Flush(); + string testRunnerAssemblyName = Assembly.GetEntryAssembly()?.GetName().Name ?? string.Empty; string newLine = Environment.NewLine; var expected = string.Format( "Message start." + newLine + " This message should be indented.{0} Error: 0 : This error not be indented." + newLine + " {0} Error: 0 : This error is indented" + newLine + " {0} Warning: 0 : This warning is indented" + newLine + " {0} Warning: 0 : This warning is also indented" + newLine + " {0} Information: 0 : This information in indented" + newLine + " {0} Information: 0 : This information is also indented" + newLine + "Message end." + newLine + "", - TestRunnerAssemblyName + testRunnerAssemblyName ); Assert.Equal(expected, textTL.Output); diff --git a/src/libraries/System.Diagnostics.TraceSource/tests/TraceEventCacheClassTests.cs b/src/libraries/System.Diagnostics.TraceSource/tests/TraceEventCacheClassTests.cs index 6933d0323dae..680f8b620a12 100644 --- a/src/libraries/System.Diagnostics.TraceSource/tests/TraceEventCacheClassTests.cs +++ b/src/libraries/System.Diagnostics.TraceSource/tests/TraceEventCacheClassTests.cs @@ -48,6 +48,7 @@ public void TimestampTest() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39223", TestPlatforms.Browser)] public void CallstackTest_NotEmpty() { var cache = new TraceEventCache(); @@ -55,6 +56,7 @@ public void CallstackTest_NotEmpty() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39223", TestPlatforms.Browser)] public void CallstackTest_ContainsExpectedFrames() { var cache = new TraceEventCache(); diff --git a/src/libraries/System.Diagnostics.TraceSource/tests/TraceListenerClassTests.cs b/src/libraries/System.Diagnostics.TraceSource/tests/TraceListenerClassTests.cs index 08668fdd7321..fbe119351426 100644 --- a/src/libraries/System.Diagnostics.TraceSource/tests/TraceListenerClassTests.cs +++ b/src/libraries/System.Diagnostics.TraceSource/tests/TraceListenerClassTests.cs @@ -313,6 +313,7 @@ public void WriteFooterTest(TraceOptions opts, int flagCount) } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39223", TestPlatforms.Browser)] [MethodImpl(MethodImplOptions.NoInlining)] public void WriteFooterTest_Callstack() { diff --git a/src/libraries/System.DirectoryServices.AccountManagement/Directory.Build.props b/src/libraries/System.DirectoryServices.AccountManagement/Directory.Build.props index 2a7de3529ba7..e6b3574d5687 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/Directory.Build.props +++ b/src/libraries/System.DirectoryServices.AccountManagement/Directory.Build.props @@ -6,5 +6,6 @@ to a different assembly. --> 4.0.0.0 ECMA + true \ No newline at end of file diff --git a/src/libraries/System.DirectoryServices.AccountManagement/ref/System.DirectoryServices.AccountManagement.cs b/src/libraries/System.DirectoryServices.AccountManagement/ref/System.DirectoryServices.AccountManagement.cs index 246ff7242490..d64ef98f18e3 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/ref/System.DirectoryServices.AccountManagement.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/ref/System.DirectoryServices.AccountManagement.cs @@ -173,8 +173,8 @@ public abstract partial class Principal : System.IDisposable { protected Principal() { } public System.DirectoryServices.AccountManagement.PrincipalContext Context { get { throw null; } } - [System.ComponentModel.Browsable(false)] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [System.ComponentModel.BrowsableAttribute(false)] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected internal System.DirectoryServices.AccountManagement.PrincipalContext ContextRaw { get { throw null; } set { } } public System.DirectoryServices.AccountManagement.ContextType ContextType { get { throw null; } } public string Description { get { throw null; } set { } } diff --git a/src/libraries/System.DirectoryServices/Directory.Build.props b/src/libraries/System.DirectoryServices/Directory.Build.props index 131fb6770cd1..d5f3585d0abb 100644 --- a/src/libraries/System.DirectoryServices/Directory.Build.props +++ b/src/libraries/System.DirectoryServices/Directory.Build.props @@ -6,5 +6,6 @@ to a different assembly. --> 4.0.0.0 Microsoft + true \ No newline at end of file diff --git a/src/libraries/System.Formats.Asn1/src/System.Formats.Asn1.csproj b/src/libraries/System.Formats.Asn1/src/System.Formats.Asn1.csproj index ddd7a52c3e5f..501a4f5ad368 100644 --- a/src/libraries/System.Formats.Asn1/src/System.Formats.Asn1.csproj +++ b/src/libraries/System.Formats.Asn1/src/System.Formats.Asn1.csproj @@ -2,7 +2,8 @@ true enable - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true @@ -50,4 +51,10 @@ + + + + + + diff --git a/src/libraries/System.Globalization.Calendars/tests/TaiwanCalendar/TaiwanCalendarDaysAndMonths.cs b/src/libraries/System.Globalization.Calendars/tests/TaiwanCalendar/TaiwanCalendarDaysAndMonths.cs index 0f96a592bf50..cb901d27f56a 100644 --- a/src/libraries/System.Globalization.Calendars/tests/TaiwanCalendar/TaiwanCalendarDaysAndMonths.cs +++ b/src/libraries/System.Globalization.Calendars/tests/TaiwanCalendar/TaiwanCalendarDaysAndMonths.cs @@ -9,6 +9,7 @@ namespace System.Globalization.Tests public class TaiwanCalendarDaysAndMonths { [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39285", TestPlatforms.Browser)] public void DayNames_MonthNames() { string[] expectedDayNames = diff --git a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoCalendarWeekRule.cs b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoCalendarWeekRule.cs index a0dc8afc4adc..2d0bd120bd30 100644 --- a/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoCalendarWeekRule.cs +++ b/src/libraries/System.Globalization/tests/DateTimeFormatInfo/DateTimeFormatInfoCalendarWeekRule.cs @@ -12,7 +12,16 @@ public static IEnumerable CalendarWeekRule_Get_TestData() { yield return new object[] { DateTimeFormatInfo.InvariantInfo, CalendarWeekRule.FirstDay }; yield return new object[] { new CultureInfo("en-US").DateTimeFormat, CalendarWeekRule.FirstDay }; - yield return new object[] { new CultureInfo("br-FR").DateTimeFormat, DateTimeFormatInfoData.BrFRCalendarWeekRule() }; + + if (PlatformDetection.IsNotBrowser) + { + yield return new object[] { new CultureInfo("br-FR").DateTimeFormat, DateTimeFormatInfoData.BrFRCalendarWeekRule() }; + } + else + { + // "br-FR" is not presented in Browser's ICU. Let's test ru-RU instead. + yield return new object[] { new CultureInfo("ru-RU").DateTimeFormat, CalendarWeekRule.FirstFourDayWeek }; + } } [Theory] diff --git a/src/libraries/System.Globalization/tests/Invariant/InvariantMode.cs b/src/libraries/System.Globalization/tests/Invariant/InvariantMode.cs index 940da7970f11..dccc2db90ded 100644 --- a/src/libraries/System.Globalization/tests/Invariant/InvariantMode.cs +++ b/src/libraries/System.Globalization/tests/Invariant/InvariantMode.cs @@ -1029,6 +1029,12 @@ public void TestRune(int original, int expectedToUpper, int expectedToLower) Assert.Equal(expectedToLower, Rune.ToLower(originalRune, CultureInfo.GetCultureInfo("tr-TR")).Value); } + [Fact] + public void TestGetCultureInfo_PredefinedOnly_ReturnsSame() + { + Assert.Equal(CultureInfo.GetCultureInfo("en-US"), CultureInfo.GetCultureInfo("en-US", predefinedOnly: true)); + } + private static byte[] GetExpectedInvariantOrdinalSortKey(ReadOnlySpan input) { MemoryStream memoryStream = new MemoryStream(); diff --git a/src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoCurrencyGroupSizes.cs b/src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoCurrencyGroupSizes.cs index aa283d47e7c0..261edc3fb0d2 100644 --- a/src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoCurrencyGroupSizes.cs +++ b/src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoCurrencyGroupSizes.cs @@ -13,7 +13,7 @@ public static IEnumerable CurrencyGroupSizes_TestData() yield return new object[] { NumberFormatInfo.InvariantInfo, new int[] { 3 } }; yield return new object[] { CultureInfo.GetCultureInfo("en-US").NumberFormat, new int[] { 3 } }; - if (!PlatformDetection.IsUbuntu && !PlatformDetection.IsWindows7 && !PlatformDetection.IsWindows8x && !PlatformDetection.IsFedora) + if (PlatformDetection.IsNotBrowser && !PlatformDetection.IsUbuntu && !PlatformDetection.IsWindows7 && !PlatformDetection.IsWindows8x && !PlatformDetection.IsFedora) { yield return new object[] { CultureInfo.GetCultureInfo("ur-IN").NumberFormat, new int[] { 3, 2 } }; } diff --git a/src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoCurrencyNegativePattern.cs b/src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoCurrencyNegativePattern.cs index e33d39ddea3e..76653b6d68af 100644 --- a/src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoCurrencyNegativePattern.cs +++ b/src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoCurrencyNegativePattern.cs @@ -22,14 +22,24 @@ public void CurrencyNegativePattern_Get_ReturnsExpected(NumberFormatInfo format, Assert.Contains(format.CurrencyNegativePattern, acceptablePatterns); } + public static IEnumerable CurrencyNegativePatternTestLocales() + { + yield return new object[] { "en-US" }; + yield return new object[] { "en-CA" }; + yield return new object[] { "fa-IR" }; + yield return new object[] { "fr-CD" }; + yield return new object[] { "fr-CA" }; + + if (PlatformDetection.IsNotBrowser) + { + // Browser's ICU doesn't contain these locales + yield return new object[] { "as" }; + yield return new object[] { "es-BO" }; + } + } + [Theory] - [InlineData("en-US")] - [InlineData("en-CA")] - [InlineData("fa-IR")] - [InlineData("fr-CD")] - [InlineData("as")] - [InlineData("es-BO")] - [InlineData("fr-CA")] + [MemberData(nameof(CurrencyNegativePatternTestLocales))] public void CurrencyNegativePattern_Get_ReturnsExpected_ByLocale(string locale) { CultureInfo culture; diff --git a/src/libraries/System.Globalization/tests/System/Globalization/TextInfoTests.cs b/src/libraries/System.Globalization/tests/System/Globalization/TextInfoTests.cs index 6b1a2219ca73..099f9c24fb42 100644 --- a/src/libraries/System.Globalization/tests/System/Globalization/TextInfoTests.cs +++ b/src/libraries/System.Globalization/tests/System/Globalization/TextInfoTests.cs @@ -183,6 +183,19 @@ public static IEnumerable ToLower_TestData_netcore() } } + public static IEnumerable GetTestLocales() + { + yield return "tr"; + yield return "tr-TR"; + + if (PlatformDetection.IsNotBrowser) + { + // Browser's ICU doesn't contain these locales + yield return "az"; + yield return "az-Latn-AZ"; + } + } + public static IEnumerable ToLower_TestData() { foreach (string cultureName in s_cultureNames) @@ -226,7 +239,7 @@ public static IEnumerable ToLower_TestData() yield return new object[] { cultureName, "\u03A3", "\u03C3" }; } - foreach (string cultureName in new string[] { "tr", "tr-TR", "az", "az-Latn-AZ" }) + foreach (string cultureName in GetTestLocales()) { yield return new object[] { cultureName, "\u0130", "i" }; yield return new object[] { cultureName, "i", "i" }; @@ -349,7 +362,7 @@ public static IEnumerable ToUpper_TestData() } // Turkish i - foreach (string cultureName in new string[] { "tr", "tr-TR", "az", "az-Latn-AZ" }) + foreach (string cultureName in GetTestLocales()) { yield return new object[] { cultureName, "i", "\u0130" }; yield return new object[] { cultureName, "\u0130", "\u0130" }; diff --git a/src/libraries/System.IO.Compression.Brotli/src/System/IO/Compression/dec/BrotliStream.Decompress.cs b/src/libraries/System.IO.Compression.Brotli/src/System/IO/Compression/dec/BrotliStream.Decompress.cs index 8b995f430850..b5c86a053a41 100644 --- a/src/libraries/System.IO.Compression.Brotli/src/System/IO/Compression/dec/BrotliStream.Decompress.cs +++ b/src/libraries/System.IO.Compression.Brotli/src/System/IO/Compression/dec/BrotliStream.Decompress.cs @@ -133,7 +133,8 @@ private async ValueTask FinishReadAsyncMemory(Memory buffer, Cancella _bufferOffset = 0; int numRead = 0; - while (_bufferCount < _buffer.Length && ((numRead = await _stream.ReadAsync(new Memory(_buffer, _bufferCount, _buffer.Length - _bufferCount)).ConfigureAwait(false)) > 0)) + while (_bufferCount < _buffer.Length && + ((numRead = await _stream.ReadAsync(new Memory(_buffer, _bufferCount, _buffer.Length - _bufferCount), cancellationToken).ConfigureAwait(false)) > 0)) { _bufferCount += numRead; if (_bufferCount > _buffer.Length) diff --git a/src/libraries/System.IO.FileSystem.AccessControl/Directory.Build.props b/src/libraries/System.IO.FileSystem.AccessControl/Directory.Build.props index 8c72c62fd593..27a4a5522a27 100644 --- a/src/libraries/System.IO.FileSystem.AccessControl/Directory.Build.props +++ b/src/libraries/System.IO.FileSystem.AccessControl/Directory.Build.props @@ -4,5 +4,6 @@ Microsoft true false + true \ No newline at end of file diff --git a/src/libraries/System.IO.FileSystem.AccessControl/src/System.IO.FileSystem.AccessControl.csproj b/src/libraries/System.IO.FileSystem.AccessControl/src/System.IO.FileSystem.AccessControl.csproj index ac6c8e8a6690..3d496a69c3f2 100644 --- a/src/libraries/System.IO.FileSystem.AccessControl/src/System.IO.FileSystem.AccessControl.csproj +++ b/src/libraries/System.IO.FileSystem.AccessControl/src/System.IO.FileSystem.AccessControl.csproj @@ -12,7 +12,8 @@ SR.PlatformNotSupported_AccessControl - + diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/Directory.Build.props b/src/libraries/System.IO.FileSystem.DriveInfo/Directory.Build.props index 465e1110d6b0..42c6eafce67e 100644 --- a/src/libraries/System.IO.FileSystem.DriveInfo/Directory.Build.props +++ b/src/libraries/System.IO.FileSystem.DriveInfo/Directory.Build.props @@ -3,5 +3,6 @@ Microsoft true + true \ No newline at end of file diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/ref/System.IO.FileSystem.DriveInfo.cs b/src/libraries/System.IO.FileSystem.DriveInfo/ref/System.IO.FileSystem.DriveInfo.cs index d1bf4c8d4397..cc5e3b773569 100644 --- a/src/libraries/System.IO.FileSystem.DriveInfo/ref/System.IO.FileSystem.DriveInfo.cs +++ b/src/libraries/System.IO.FileSystem.DriveInfo/ref/System.IO.FileSystem.DriveInfo.cs @@ -17,8 +17,8 @@ public DriveInfo(string driveName) { } public System.IO.DirectoryInfo RootDirectory { get { throw null; } } public long TotalFreeSpace { get { throw null; } } public long TotalSize { get { throw null; } } - [System.Diagnostics.CodeAnalysis.AllowNull] - public string VolumeLabel { get { throw null; } set { } } + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] + public string VolumeLabel { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } } public static System.IO.DriveInfo[] GetDrives() { throw null; } void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public override string ToString() { throw null; } diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/src/System.IO.FileSystem.DriveInfo.csproj b/src/libraries/System.IO.FileSystem.DriveInfo/src/System.IO.FileSystem.DriveInfo.csproj index 1329619b978e..fdc1f7b5f018 100644 --- a/src/libraries/System.IO.FileSystem.DriveInfo/src/System.IO.FileSystem.DriveInfo.csproj +++ b/src/libraries/System.IO.FileSystem.DriveInfo/src/System.IO.FileSystem.DriveInfo.csproj @@ -49,7 +49,8 @@ - + + @@ -66,6 +67,10 @@ + + + + diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.Browser.cs b/src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.Browser.cs new file mode 100644 index 000000000000..894c0a29a641 --- /dev/null +++ b/src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.Browser.cs @@ -0,0 +1,20 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Security; + +namespace System.IO +{ + public sealed partial class DriveInfo + { + public DriveType DriveType => DriveType.Unknown; + public string DriveFormat => "memfs"; + public long AvailableFreeSpace => 0; + public long TotalFreeSpace => 0; + public long TotalSize => 0; + + private static string[] GetMountPoints() => Environment.GetLogicalDrives(); + } +} diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.Unix.cs b/src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.Unix.cs index 5fa41b1b9639..bc696ef7b572 100644 --- a/src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.Unix.cs +++ b/src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.Unix.cs @@ -9,31 +9,6 @@ namespace System.IO { public sealed partial class DriveInfo { - public static DriveInfo[] GetDrives() - { - string[] mountPoints = Interop.Sys.GetAllMountPoints(); - DriveInfo[] info = new DriveInfo[mountPoints.Length]; - for (int i = 0; i < info.Length; i++) - { - info[i] = new DriveInfo(mountPoints[i]); - } - - return info; - } - - private static string NormalizeDriveName(string driveName) - { - if (driveName.Contains("\0")) // string.Contains(char) is .NetCore2.1+ specific - { - throw new ArgumentException(SR.Format(SR.Arg_InvalidDriveChars, driveName), nameof(driveName)); - } - if (driveName.Length == 0) - { - throw new ArgumentException(SR.Arg_MustBeNonEmptyDriveName, nameof(driveName)); - } - return driveName; - } - public DriveType DriveType { get @@ -104,19 +79,6 @@ public long TotalSize } } - [AllowNull] - public string VolumeLabel - { - get - { - return Name; - } - set - { - throw new PlatformNotSupportedException(); - } - } - private void CheckStatfsResultAndThrowIfNecessary(int result) { if (result != 0) @@ -132,5 +94,7 @@ private void CheckStatfsResultAndThrowIfNecessary(int result) } } } + + private static string[] GetMountPoints() => Interop.Sys.GetAllMountPoints(); } } diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.UnixOrBrowser.cs b/src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.UnixOrBrowser.cs new file mode 100644 index 000000000000..89ac3ae7ad5f --- /dev/null +++ b/src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.UnixOrBrowser.cs @@ -0,0 +1,52 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Security; +using System.Runtime.Versioning; + +namespace System.IO +{ + public sealed partial class DriveInfo + { + public static DriveInfo[] GetDrives() + { + string[] mountPoints = GetMountPoints(); + DriveInfo[] info = new DriveInfo[mountPoints.Length]; + for (int i = 0; i < info.Length; i++) + { + info[i] = new DriveInfo(mountPoints[i]); + } + + return info; + } + + private static string NormalizeDriveName(string driveName) + { + if (driveName.Contains("\0")) // string.Contains(char) is .NetCore2.1+ specific + { + throw new ArgumentException(SR.Format(SR.Arg_InvalidDriveChars, driveName), nameof(driveName)); + } + if (driveName.Length == 0) + { + throw new ArgumentException(SR.Arg_MustBeNonEmptyDriveName, nameof(driveName)); + } + return driveName; + } + + [AllowNull] + public string VolumeLabel + { + get + { + return Name; + } + [MinimumOSPlatform("windows7.0")] + set + { + throw new PlatformNotSupportedException(); + } + } + } +} diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.Windows.cs b/src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.Windows.cs index 8d93728bf7df..df7eadd5e1e5 100644 --- a/src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.Windows.cs +++ b/src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.Windows.cs @@ -6,6 +6,7 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using System.Text; +using System.Runtime.Versioning; namespace System.IO { @@ -138,6 +139,7 @@ public unsafe string VolumeLabel return new string(volumeName); } + [MinimumOSPlatform("windows7.0")] set { uint oldMode; diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs b/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs index 00910c68e7bf..c52c10c8da66 100644 --- a/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs +++ b/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs @@ -41,7 +41,7 @@ public void TestGetDrives() } [Fact] - [PlatformSpecific(TestPlatforms.AnyUnix)] + [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Browser)] public void PropertiesOfInvalidDrive() { string invalidDriveName = "NonExistentDriveName"; @@ -64,16 +64,26 @@ public void PropertiesOfInvalidDrive() public void PropertiesOfValidDrive() { var root = new DriveInfo("/"); - Assert.True(root.AvailableFreeSpace > 0); var format = root.DriveFormat; - Assert.Equal(DriveType.Fixed, root.DriveType); + Assert.Equal(PlatformDetection.IsBrowser ? DriveType.Unknown : DriveType.Fixed, root.DriveType); Assert.True(root.IsReady); Assert.Equal("/", root.Name); Assert.Equal("/", root.ToString()); Assert.Equal("/", root.RootDirectory.FullName); - Assert.True(root.TotalFreeSpace > 0); - Assert.True(root.TotalSize > 0); Assert.Equal("/", root.VolumeLabel); + + if (PlatformDetection.IsBrowser) + { + Assert.True(root.AvailableFreeSpace == 0); + Assert.True(root.TotalFreeSpace == 0); + Assert.True(root.TotalSize == 0); + } + else + { + Assert.True(root.AvailableFreeSpace > 0); + Assert.True(root.TotalFreeSpace > 0); + Assert.True(root.TotalSize > 0); + } } [Fact] diff --git a/src/libraries/System.IO.FileSystem/Directory.Build.props b/src/libraries/System.IO.FileSystem/Directory.Build.props index 465e1110d6b0..42c6eafce67e 100644 --- a/src/libraries/System.IO.FileSystem/Directory.Build.props +++ b/src/libraries/System.IO.FileSystem/Directory.Build.props @@ -3,5 +3,6 @@ Microsoft true + true \ No newline at end of file diff --git a/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.cs b/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.cs index 3b1cd74f5fbd..953c048a7943 100644 --- a/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.cs +++ b/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.cs @@ -121,8 +121,10 @@ public static void Copy(string sourceFileName, string destFileName, bool overwri public static System.IO.FileStream Create(string path, int bufferSize) { throw null; } public static System.IO.FileStream Create(string path, int bufferSize, System.IO.FileOptions options) { throw null; } public static System.IO.StreamWriter CreateText(string path) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static void Decrypt(string path) { } public static void Delete(string path) { } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static void Encrypt(string path) { } public static bool Exists(string? path) { throw null; } public static System.IO.FileAttributes GetAttributes(string path) { throw null; } diff --git a/src/libraries/System.IO.FileSystem/src/System/IO/File.cs b/src/libraries/System.IO.FileSystem/src/System/IO/File.cs index 1b6b21903575..2e5909c15a03 100644 --- a/src/libraries/System.IO.FileSystem/src/System/IO/File.cs +++ b/src/libraries/System.IO.FileSystem/src/System/IO/File.cs @@ -7,6 +7,7 @@ using System.Diagnostics; using System.IO; using System.Runtime.ExceptionServices; +using System.Runtime.Versioning; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -645,11 +646,13 @@ public static void Move(string sourceFileName, string destFileName, bool overwri FileSystem.MoveFile(fullSourceFileName, fullDestFileName, overwrite); } + [MinimumOSPlatform("windows7.0")] public static void Encrypt(string path) { FileSystem.Encrypt(path ?? throw new ArgumentNullException(nameof(path))); } + [MinimumOSPlatform("windows7.0")] public static void Decrypt(string path) { FileSystem.Decrypt(path ?? throw new ArgumentNullException(nameof(path))); diff --git a/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFileStream.cs b/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFileStream.cs index 731150354e34..54f0f83375d4 100644 --- a/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFileStream.cs +++ b/src/libraries/System.IO.IsolatedStorage/src/System/IO/IsolatedStorage/IsolatedStorageFileStream.cs @@ -236,7 +236,7 @@ public override void Flush(bool flushToDisk) public override Task FlushAsync(CancellationToken cancellationToken) { - return _fs.FlushAsync(); + return _fs.FlushAsync(cancellationToken); } public override void SetLength(long value) diff --git a/src/libraries/System.IO.MemoryMappedFiles/Directory.Build.props b/src/libraries/System.IO.MemoryMappedFiles/Directory.Build.props index 465e1110d6b0..42c6eafce67e 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/Directory.Build.props +++ b/src/libraries/System.IO.MemoryMappedFiles/Directory.Build.props @@ -3,5 +3,6 @@ Microsoft true + true \ No newline at end of file diff --git a/src/libraries/System.IO.MemoryMappedFiles/ref/System.IO.MemoryMappedFiles.cs b/src/libraries/System.IO.MemoryMappedFiles/ref/System.IO.MemoryMappedFiles.cs index 4808e3f0e1d1..4748d3acb85b 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/ref/System.IO.MemoryMappedFiles.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/ref/System.IO.MemoryMappedFiles.cs @@ -33,8 +33,11 @@ internal MemoryMappedFile() { } public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateNew(string? mapName, long capacity) { throw null; } public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateNew(string? mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access) { throw null; } public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateNew(string? mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access, System.IO.MemoryMappedFiles.MemoryMappedFileOptions options, System.IO.HandleInheritability inheritability) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateOrOpen(string mapName, long capacity) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateOrOpen(string mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateOrOpen(string mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access, System.IO.MemoryMappedFiles.MemoryMappedFileOptions options, System.IO.HandleInheritability inheritability) { throw null; } public System.IO.MemoryMappedFiles.MemoryMappedViewAccessor CreateViewAccessor() { throw null; } public System.IO.MemoryMappedFiles.MemoryMappedViewAccessor CreateViewAccessor(long offset, long size) { throw null; } @@ -44,8 +47,11 @@ internal MemoryMappedFile() { } public System.IO.MemoryMappedFiles.MemoryMappedViewStream CreateViewStream(long offset, long size, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access) { throw null; } public void Dispose() { } protected virtual void Dispose(bool disposing) { } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static System.IO.MemoryMappedFiles.MemoryMappedFile OpenExisting(string mapName) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static System.IO.MemoryMappedFiles.MemoryMappedFile OpenExisting(string mapName, System.IO.MemoryMappedFiles.MemoryMappedFileRights desiredAccessRights) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static System.IO.MemoryMappedFiles.MemoryMappedFile OpenExisting(string mapName, System.IO.MemoryMappedFiles.MemoryMappedFileRights desiredAccessRights, System.IO.HandleInheritability inheritability) { throw null; } } public enum MemoryMappedFileAccess diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.cs b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.cs index 3d26335acb31..aed549229ae1 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.cs @@ -3,6 +3,7 @@ using Microsoft.Win32.SafeHandles; using System.Diagnostics; +using System.Runtime.Versioning; namespace System.IO.MemoryMappedFiles { @@ -43,16 +44,19 @@ private MemoryMappedFile(SafeMemoryMappedFileHandle handle, FileStream fileStrea // the first override of this method. Note: having ReadWrite access to the object does not mean that we // have ReadWrite access to the pages mapping the file. The OS will check against the access on the pages // when a view is created. + [MinimumOSPlatform("windows7.0")] public static MemoryMappedFile OpenExisting(string mapName) { return OpenExisting(mapName, MemoryMappedFileRights.ReadWrite, HandleInheritability.None); } + [MinimumOSPlatform("windows7.0")] public static MemoryMappedFile OpenExisting(string mapName, MemoryMappedFileRights desiredAccessRights) { return OpenExisting(mapName, desiredAccessRights, HandleInheritability.None); } + [MinimumOSPlatform("windows7.0")] public static MemoryMappedFile OpenExisting(string mapName, MemoryMappedFileRights desiredAccessRights, HandleInheritability inheritability) { @@ -291,18 +295,21 @@ public static MemoryMappedFile CreateNew(string? mapName, long capacity, MemoryM // memory mapped file if one exists with the same name. The capacity, options, and // memoryMappedFileSecurity arguments will be ignored in the case of the later. // This is ideal for P2P style IPC. + [MinimumOSPlatform("windows7.0")] public static MemoryMappedFile CreateOrOpen(string mapName, long capacity) { return CreateOrOpen(mapName, capacity, MemoryMappedFileAccess.ReadWrite, MemoryMappedFileOptions.None, HandleInheritability.None); } + [MinimumOSPlatform("windows7.0")] public static MemoryMappedFile CreateOrOpen(string mapName, long capacity, MemoryMappedFileAccess access) { return CreateOrOpen(mapName, capacity, access, MemoryMappedFileOptions.None, HandleInheritability.None); } + [MinimumOSPlatform("windows7.0")] public static MemoryMappedFile CreateOrOpen(string mapName, long capacity, MemoryMappedFileAccess access, MemoryMappedFileOptions options, HandleInheritability inheritability) diff --git a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateFromFile.Tests.cs b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateFromFile.Tests.cs index 548bcbc32364..d5edbbc05b29 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateFromFile.Tests.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateFromFile.Tests.cs @@ -614,6 +614,7 @@ public void FileInUse_CreateFromFile_FailsWithExistingReadWriteMap() /// Test exceptional behavior when trying to create a map for a non-shared file that's currently in use. /// [Fact] + [PlatformSpecific(~TestPlatforms.Browser)] // the emscripten implementation ignores FileShare.None public void FileInUse_CreateFromFile_FailsWithExistingNoShareFile() { // Already opened with a FileStream @@ -696,13 +697,13 @@ private void WriteToReadOnlyFile(MemoryMappedFileAccess access, bool succeeds) public void WriteToReadOnlyFile_ReadWrite(MemoryMappedFileAccess access) { WriteToReadOnlyFile(access, access == MemoryMappedFileAccess.Read || - (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && geteuid() == 0)); + (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && PlatformDetection.IsSuperUser)); } [Fact] public void WriteToReadOnlyFile_CopyOnWrite() { - WriteToReadOnlyFile(MemoryMappedFileAccess.CopyOnWrite, (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && geteuid() == 0)); + WriteToReadOnlyFile(MemoryMappedFileAccess.CopyOnWrite, (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && PlatformDetection.IsSuperUser)); } /// @@ -768,6 +769,7 @@ public void LeaveOpenRespected_OutstandingViews(bool leaveOpen) /// Test to validate we can create multiple maps from the same FileStream. /// [Fact] + [PlatformSpecific(~TestPlatforms.Browser)] // the emscripten implementation doesn't share data public void MultipleMapsForTheSameFileStream() { const int Capacity = 4096; diff --git a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Unix.cs b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Unix.cs index 6b1042ae1e4e..c754fcb8daaf 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Unix.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.Unix.cs @@ -14,6 +14,9 @@ public abstract partial class MemoryMappedFilesTestBase : FileCleanupTestBase /// Gets the system's page size. protected static Lazy s_pageSize = new Lazy(() => { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Browser)) + return Environment.SystemPageSize; + int pageSize; const int _SC_PAGESIZE_FreeBSD = 47; const int _SC_PAGESIZE_Linux = 30; @@ -31,9 +34,6 @@ public abstract partial class MemoryMappedFilesTestBase : FileCleanupTestBase [DllImport("libc", SetLastError = true)] private static extern int sysconf(int name); - [DllImport("libc", SetLastError = true)] - protected static extern int geteuid(); - /// Asserts that the handle's inheritability matches the specified value. protected static void AssertInheritability(SafeHandle handle, HandleInheritability inheritability) { diff --git a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewAccessor.Tests.cs b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewAccessor.Tests.cs index 99268f6f7d84..f96e00479ae3 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewAccessor.Tests.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewAccessor.Tests.cs @@ -334,6 +334,7 @@ public void FlushSupportedOnBothReadAndWriteAccessors(MemoryMappedFileAccess acc /// Test to validate that multiple accessors over the same map share data appropriately. /// [Fact] + [PlatformSpecific(~TestPlatforms.Browser)] // the emscripten implementation doesn't share data public void ViewsShareData() { const int MapLength = 256; diff --git a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewStream.Tests.cs b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewStream.Tests.cs index a4ab65c12636..5f98409f3fe2 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewStream.Tests.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewStream.Tests.cs @@ -264,6 +264,7 @@ public void FlushSupportedOnBothReadAndWriteAccessors(MemoryMappedFileAccess acc /// Test to validate that multiple accessors over the same map share data appropriately. /// [Fact] + [PlatformSpecific(~TestPlatforms.Browser)] // the emscripten implementation doesn't share data public void ViewsShareData() { const int MapLength = 256; diff --git a/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj b/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj index 804d66203782..545a857a9515 100644 --- a/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj +++ b/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj @@ -1,6 +1,7 @@ - $(NetCoreAppCurrent);netstandard2.0;netcoreapp3.0 + $(NetCoreAppCurrent);netstandard2.0;netcoreapp3.0;net461;$(NetFrameworkCurrent) + true true enable @@ -37,14 +38,18 @@ - + - + + + + + diff --git a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/Pipe.cs b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/Pipe.cs index 63b4b96aa8b6..a47a480ce7c9 100644 --- a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/Pipe.cs +++ b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/Pipe.cs @@ -852,6 +852,10 @@ internal ReadResult GetReadAsyncResult() finally { cancellationTokenRegistration.Dispose(); + } + + if (result.IsCanceled) + { cancellationToken.ThrowIfCancellationRequested(); } diff --git a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeAwaitable.cs b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeAwaitable.cs index 8e67f9705816..e7dbad631114 100644 --- a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeAwaitable.cs +++ b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeAwaitable.cs @@ -18,7 +18,7 @@ internal struct PipeAwaitable private SynchronizationContext? _synchronizationContext; private ExecutionContext? _executionContext; -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) private CancellationToken CancellationToken => _cancellationTokenRegistration.Token; #else private CancellationToken _cancellationToken; @@ -34,7 +34,7 @@ public PipeAwaitable(bool completed, bool useSynchronizationContext) _cancellationTokenRegistration = default; _synchronizationContext = null; _executionContext = null; -#if NETSTANDARD2_0 +#if (NETSTANDARD2_0 || NETFRAMEWORK) _cancellationToken = CancellationToken.None; #endif } @@ -53,7 +53,7 @@ public void BeginOperation(CancellationToken cancellationToken, Action // Don't register if already completed, we would immediately unregistered in ObserveCancellation if (cancellationToken.CanBeCanceled && !IsCompleted) { -#if NETSTANDARD2_0 +#if (NETSTANDARD2_0 || NETFRAMEWORK) _cancellationToken = cancellationToken; #endif _cancellationTokenRegistration = cancellationToken.UnsafeRegister(callback, state); @@ -165,7 +165,7 @@ public CancellationTokenRegistration ReleaseCancellationTokenRegistration(out Ca cancellationToken = CancellationToken; CancellationTokenRegistration cancellationTokenRegistration = _cancellationTokenRegistration; -#if NETSTANDARD2_0 +#if (NETSTANDARD2_0 || NETFRAMEWORK) _cancellationToken = default; #endif _cancellationTokenRegistration = default; diff --git a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeReaderStream.cs b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeReaderStream.cs index f7e65cc6bbae..e654113a6fec 100644 --- a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeReaderStream.cs +++ b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeReaderStream.cs @@ -67,7 +67,7 @@ public override Task ReadAsync(byte[] buffer, int offset, int count, Cancel return ReadAsyncInternal(new Memory(buffer, offset, count), cancellationToken).AsTask(); } -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) public override ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken = default) { return ReadAsyncInternal(buffer, cancellationToken); diff --git a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeWriterStream.cs b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeWriterStream.cs index 0a6dd86cb97c..915927f264c1 100644 --- a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeWriterStream.cs +++ b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeWriterStream.cs @@ -68,7 +68,7 @@ public override Task WriteAsync(byte[] buffer, int offset, int count, Cancellati return GetFlushResultAsTask(valueTask); } -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) public override ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) { ValueTask valueTask = _pipeWriter.WriteAsync(buffer, cancellationToken); diff --git a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeWriter.cs b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeWriter.cs index 096f5ed8425d..0588b1c810f4 100644 --- a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeWriter.cs +++ b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeWriter.cs @@ -236,7 +236,7 @@ public override async ValueTask CompleteAsync(Exception? exception = null) if (!_leaveOpen) { -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) await InnerStream.DisposeAsync().ConfigureAwait(false); #else InnerStream.Dispose(); @@ -355,7 +355,7 @@ private void FlushInternal(bool writeToStream) if (returnSegment.Length > 0 && writeToStream) { -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) InnerStream.Write(returnSegment.Memory.Span); #else InnerStream.Write(returnSegment.Memory); diff --git a/src/libraries/System.IO.Pipes.AccessControl/Directory.Build.props b/src/libraries/System.IO.Pipes.AccessControl/Directory.Build.props index 8c72c62fd593..27a4a5522a27 100644 --- a/src/libraries/System.IO.Pipes.AccessControl/Directory.Build.props +++ b/src/libraries/System.IO.Pipes.AccessControl/Directory.Build.props @@ -4,5 +4,6 @@ Microsoft true false + true \ No newline at end of file diff --git a/src/libraries/System.IO.Pipes/Directory.Build.props b/src/libraries/System.IO.Pipes/Directory.Build.props index 465e1110d6b0..42c6eafce67e 100644 --- a/src/libraries/System.IO.Pipes/Directory.Build.props +++ b/src/libraries/System.IO.Pipes/Directory.Build.props @@ -3,5 +3,6 @@ Microsoft true + true \ No newline at end of file diff --git a/src/libraries/System.IO.Pipes/ref/System.IO.Pipes.cs b/src/libraries/System.IO.Pipes/ref/System.IO.Pipes.cs index 52a6ea136f91..8ef9f9f5b064 100644 --- a/src/libraries/System.IO.Pipes/ref/System.IO.Pipes.cs +++ b/src/libraries/System.IO.Pipes/ref/System.IO.Pipes.cs @@ -48,6 +48,7 @@ public sealed partial class NamedPipeClientStream : System.IO.Pipes.PipeStream public NamedPipeClientStream(string serverName, string pipeName, System.IO.Pipes.PipeDirection direction, System.IO.Pipes.PipeOptions options) : base (default(System.IO.Pipes.PipeDirection), default(int)) { } public NamedPipeClientStream(string serverName, string pipeName, System.IO.Pipes.PipeDirection direction, System.IO.Pipes.PipeOptions options, System.Security.Principal.TokenImpersonationLevel impersonationLevel) : base (default(System.IO.Pipes.PipeDirection), default(int)) { } public NamedPipeClientStream(string serverName, string pipeName, System.IO.Pipes.PipeDirection direction, System.IO.Pipes.PipeOptions options, System.Security.Principal.TokenImpersonationLevel impersonationLevel, System.IO.HandleInheritability inheritability) : base (default(System.IO.Pipes.PipeDirection), default(int)) { } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public int NumberOfServerInstances { get { throw null; } } protected internal override void CheckPipePropertyOperations() { } public void Connect() { } @@ -128,6 +129,7 @@ protected void InitializeHandle(Microsoft.Win32.SafeHandles.SafePipeHandle? hand public override int ReadByte() { throw null; } public override long Seek(long offset, System.IO.SeekOrigin origin) { throw null; } public override void SetLength(long value) { } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public void WaitForPipeDrain() { } public override void Write(byte[] buffer, int offset, int count) { } public override void Write(System.ReadOnlySpan buffer) { } @@ -139,6 +141,7 @@ public override void WriteByte(byte value) { } public enum PipeTransmissionMode { Byte = 0, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] Message = 1, } } diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Unix.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Unix.cs index f8f55aa72ff0..dfb09b40cfed 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Unix.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Unix.cs @@ -8,6 +8,7 @@ using System.Net.Sockets; using System.Security; using System.Threading; +using System.Runtime.Versioning; namespace System.IO.Pipes { @@ -66,6 +67,7 @@ private bool TryConnect(int timeout, CancellationToken cancellationToken) return true; } + [MinimumOSPlatform("windows7.0")] public int NumberOfServerInstances { get diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Windows.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Windows.cs index bf2c8cfde743..730f1eab530e 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Windows.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Windows.cs @@ -6,6 +6,7 @@ using System.Security.Principal; using System.Threading; using Microsoft.Win32.SafeHandles; +using System.Runtime.Versioning; namespace System.IO.Pipes { @@ -107,6 +108,7 @@ private bool TryConnect(int timeout, CancellationToken cancellationToken) return true; } + [MinimumOSPlatform("windows7.0")] public unsafe int NumberOfServerInstances { get diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs index ce57953402ab..502829f49daa 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs @@ -10,6 +10,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using System.Runtime.Versioning; namespace System.IO.Pipes { @@ -219,6 +220,7 @@ private IOException GetIOExceptionForSocketException(SocketException e) } // Blocks until the other end of the pipe has read in all written buffer. + [MinimumOSPlatform("windows7.0")] public void WaitForPipeDrain() { CheckWriteOperations(); diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Windows.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Windows.cs index a06c0cd65a9c..030f769a762b 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Windows.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Windows.cs @@ -7,6 +7,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Win32.SafeHandles; +using System.Runtime.Versioning; namespace System.IO.Pipes { @@ -178,6 +179,7 @@ private Task WriteAsyncCore(ReadOnlyMemory buffer, CancellationToken cance } // Blocks until the other end of the pipe has read in all written buffer. + [MinimumOSPlatform("windows7.0")] public void WaitForPipeDrain() { CheckWriteOperations(); diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeTransmissionMode.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeTransmissionMode.cs index f7ba7a39e964..fbfd0ccf85ec 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeTransmissionMode.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeTransmissionMode.cs @@ -1,11 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Runtime.Versioning; + namespace System.IO.Pipes { public enum PipeTransmissionMode { Byte = 0, + [MinimumOSPlatform("windows7.0")] Message = 1, } } diff --git a/src/libraries/System.Management/Directory.Build.props b/src/libraries/System.Management/Directory.Build.props index 131fb6770cd1..d5f3585d0abb 100644 --- a/src/libraries/System.Management/Directory.Build.props +++ b/src/libraries/System.Management/Directory.Build.props @@ -6,5 +6,6 @@ to a different assembly. --> 4.0.0.0 Microsoft + true \ No newline at end of file diff --git a/src/libraries/System.Memory/ref/System.Memory.cs b/src/libraries/System.Memory/ref/System.Memory.cs index 196d7a4f909a..ec2eec1d2a4f 100644 --- a/src/libraries/System.Memory/ref/System.Memory.cs +++ b/src/libraries/System.Memory/ref/System.Memory.cs @@ -283,6 +283,7 @@ public void Rewind(long count) { } public bool TryReadTo(out System.Buffers.ReadOnlySequence sequence, System.ReadOnlySpan delimiter, bool advancePastDelimiter = true) { throw null; } public bool TryReadTo(out System.Buffers.ReadOnlySequence sequence, T delimiter, bool advancePastDelimiter = true) { throw null; } public bool TryReadTo(out System.Buffers.ReadOnlySequence sequence, T delimiter, T delimiterEscape, bool advancePastDelimiter = true) { throw null; } + public bool TryReadTo(out System.ReadOnlySpan sequence, System.ReadOnlySpan delimiter, bool advancePastDelimiter = true) { throw null; } public bool TryReadTo(out System.ReadOnlySpan span, T delimiter, bool advancePastDelimiter = true) { throw null; } public bool TryReadTo(out System.ReadOnlySpan span, T delimiter, T delimiterEscape, bool advancePastDelimiter = true) { throw null; } public bool TryReadToAny(out System.Buffers.ReadOnlySequence sequence, System.ReadOnlySpan delimiters, bool advancePastDelimiter = true) { throw null; } diff --git a/src/libraries/System.Memory/src/System/Buffers/SequenceReader.Search.cs b/src/libraries/System.Memory/src/System/Buffers/SequenceReader.Search.cs index dbc2305af53d..8f8da6a76efb 100644 --- a/src/libraries/System.Memory/src/System/Buffers/SequenceReader.Search.cs +++ b/src/libraries/System.Memory/src/System/Buffers/SequenceReader.Search.cs @@ -405,6 +405,42 @@ private bool TryReadToAnyInternal(out ReadOnlySequence sequence, ReadOnlySpan return false; } + /// + /// Try to read everything up to the given . + /// + /// The read data, if any. + /// The delimiter to look for. + /// True to move past the if found. + /// True if the was found. + public bool TryReadTo(out ReadOnlySpan span, ReadOnlySpan delimiter, bool advancePastDelimiter = true) + { + ReadOnlySpan remaining = UnreadSpan; + int index = remaining.IndexOf(delimiter); + + if (index >= 0) + { + span = remaining.Slice(0, index); + AdvanceCurrentSpan(index + (advancePastDelimiter ? delimiter.Length : 0)); + return true; + } + + // This delimiter might be skipped, go down the slow path + return TryReadToSlow(out span, delimiter, advancePastDelimiter); + } + + private bool TryReadToSlow(out ReadOnlySpan span, ReadOnlySpan delimiter, bool advancePastDelimiter) + { + if (!TryReadTo(out ReadOnlySequence sequence, delimiter, advancePastDelimiter)) + { + span = default; + return false; + } + + Debug.Assert(sequence.Length > 0); + span = sequence.IsSingleSegment ? sequence.First.Span : sequence.ToArray(); + return true; + } + /// /// Try to read data until the entire given matches. /// diff --git a/src/libraries/System.Memory/src/System/Buffers/SequenceReader.cs b/src/libraries/System.Memory/src/System/Buffers/SequenceReader.cs index acdea82e561f..ad75299ee3fb 100644 --- a/src/libraries/System.Memory/src/System/Buffers/SequenceReader.cs +++ b/src/libraries/System.Memory/src/System/Buffers/SequenceReader.cs @@ -161,7 +161,7 @@ public readonly bool TryPeek(long offset, out T value) { long remainingOffset = offset - (CurrentSpan.Length - CurrentSpanIndex); SequencePosition nextPosition = _nextPosition; - ReadOnlyMemory currentMemory = default; + ReadOnlyMemory currentMemory; while (Sequence.TryGet(ref nextPosition, out currentMemory, advance: true)) { diff --git a/src/libraries/System.Memory/tests/SequenceReader/BasicTests.cs b/src/libraries/System.Memory/tests/SequenceReader/BasicTests.cs index 023dee7f7658..33b2d12f4b27 100644 --- a/src/libraries/System.Memory/tests/SequenceReader/BasicTests.cs +++ b/src/libraries/System.Memory/tests/SequenceReader/BasicTests.cs @@ -128,7 +128,9 @@ public void DefaultState() Assert.True(sequence.IsEmpty); Assert.False(reader.TryReadTo(out sequence, array)); Assert.True(sequence.IsEmpty); - Assert.False(reader.TryReadTo(out ReadOnlySpan span, default)); + Assert.False(reader.TryReadTo(out ReadOnlySpan span, default(T))); + Assert.True(span.IsEmpty); + Assert.False(reader.TryReadTo(out span, array)); Assert.True(span.IsEmpty); Assert.False(reader.TryReadToAny(out sequence, array)); Assert.True(sequence.IsEmpty); diff --git a/src/libraries/System.Memory/tests/SequenceReader/ReadTo.cs b/src/libraries/System.Memory/tests/SequenceReader/ReadTo.cs index 74da02f7ef49..57ceb9e5985c 100644 --- a/src/libraries/System.Memory/tests/SequenceReader/ReadTo.cs +++ b/src/libraries/System.Memory/tests/SequenceReader/ReadTo.cs @@ -119,7 +119,7 @@ public void TryReadToSpan_Sequence(bool advancePastDelimiter) new byte[] { 3, 3, 4, 4, 5, 5, 6, 6 } }); - SequenceReader reader = new SequenceReader(bytes); + SequenceReader baseReader = new SequenceReader(bytes); for (byte i = 0; i < bytes.Length / 2 - 1; i++) { byte[] expected = new byte[i * 2 + 1]; @@ -129,7 +129,12 @@ public void TryReadToSpan_Sequence(bool advancePastDelimiter) } expected[i * 2] = i; ReadOnlySpan searchFor = new byte[] { i, (byte)(i + 1) }; - SequenceReader copy = reader; + SequenceReader copy = baseReader; + + Assert.True(copy.TryReadTo(out ReadOnlySpan sp, searchFor, advancePastDelimiter)); + Assert.True(sp.SequenceEqual(expected)); + + copy = baseReader; Assert.True(copy.TryReadTo(out ReadOnlySequence seq, searchFor, advancePastDelimiter)); Assert.True(seq.ToArray().AsSpan().SequenceEqual(expected)); } @@ -138,8 +143,14 @@ public void TryReadToSpan_Sequence(bool advancePastDelimiter) new byte[] { 47, 42, 66, 32, 42, 32, 66, 42, 47 } // /*b * b*/ }); - reader = new SequenceReader(bytes); - Assert.True(reader.TryReadTo(out ReadOnlySequence sequence, new byte[] { 42, 47 }, advancePastDelimiter)); // */ + baseReader = new SequenceReader(bytes); + SequenceReader copyReader = baseReader; + + Assert.True(copyReader.TryReadTo(out ReadOnlySpan span, new byte[] { 42, 47 }, advancePastDelimiter)); // */ + Assert.True(span.SequenceEqual(new byte[] { 47, 42, 66, 32, 42, 32, 66 })); + + copyReader = baseReader; + Assert.True(copyReader.TryReadTo(out ReadOnlySequence sequence, new byte[] { 42, 47 }, advancePastDelimiter)); // */ Assert.True(sequence.ToArray().AsSpan().SequenceEqual(new byte[] { 47, 42, 66, 32, 42, 32, 66 })); } @@ -181,17 +192,30 @@ public void TryReadTo_SingleDelimiter() new byte[] { 2, 3, 4, 5, 6 } }); - SequenceReader reader = new SequenceReader(bytes); + SequenceReader baseReader = new SequenceReader(bytes); + + SequenceReader spanReader = baseReader; + SequenceReader sequenceReader = baseReader; Span delimiter = new byte[] { 1 }; for (int i = 1; i < 6; i += 1) { // Also check scanning from the start. - SequenceReader resetReader = new SequenceReader(bytes); + SequenceReader resetReader = baseReader; delimiter[0] = (byte)i; - Assert.True(reader.TryReadTo(out ReadOnlySequence sequence, delimiter, advancePastDelimiter: true)); + Assert.True(spanReader.TryReadTo(out ReadOnlySpan span, delimiter, advancePastDelimiter: true)); + Assert.True(resetReader.TryReadTo(out span, delimiter, advancePastDelimiter: true)); + Assert.True(spanReader.TryPeek(out byte value)); + Assert.Equal(i + 1, value); + Assert.True(resetReader.TryPeek(out value)); + Assert.Equal(i + 1, value); + + // Also check scanning from the start. + resetReader = baseReader; + delimiter[0] = (byte)i; + Assert.True(sequenceReader.TryReadTo(out ReadOnlySequence sequence, delimiter, advancePastDelimiter: true)); Assert.True(resetReader.TryReadTo(out sequence, delimiter, advancePastDelimiter: true)); - Assert.True(reader.TryPeek(out byte value)); + Assert.True(sequenceReader.TryPeek(out value)); Assert.Equal(i + 1, value); Assert.True(resetReader.TryPeek(out value)); Assert.Equal(i + 1, value); @@ -206,7 +230,9 @@ public void TryReadTo_Span_At_Segments_Boundary() segment.Append(Text.Encoding.ASCII.GetBytes("\nWorld")); // add next segment ReadOnlySequence inputSeq = new ReadOnlySequence(segment, 0, segment, 6); // span only the first segment! SequenceReader sr = new SequenceReader(inputSeq); - bool r = sr.TryReadTo(out _, delimiter); + bool r = sr.TryReadTo(out ReadOnlySpan _, delimiter); + Assert.False(r); + r = sr.TryReadTo(out ReadOnlySequence _, delimiter); Assert.False(r); } } diff --git a/src/libraries/System.Memory/tests/Span/Reflection.cs b/src/libraries/System.Memory/tests/Span/Reflection.cs index dbdcc7dbdcd3..3da4f54013fe 100644 --- a/src/libraries/System.Memory/tests/Span/Reflection.cs +++ b/src/libraries/System.Memory/tests/Span/Reflection.cs @@ -40,6 +40,7 @@ public static void MemoryExtensions_StaticWithSpanArguments() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39311", TestPlatforms.Browser)] public static void BinaryPrimitives_StaticWithSpanArgument() { Type type = typeof(BinaryPrimitives); diff --git a/src/libraries/System.Memory/tests/System.Memory.Tests.csproj b/src/libraries/System.Memory/tests/System.Memory.Tests.csproj index d9b36dc5649f..1b310ee36a43 100644 --- a/src/libraries/System.Memory/tests/System.Memory.Tests.csproj +++ b/src/libraries/System.Memory/tests/System.Memory.Tests.csproj @@ -171,8 +171,6 @@ - diff --git a/src/libraries/System.Net.Http.Json/pkg/System.Net.Http.Json.pkgproj b/src/libraries/System.Net.Http.Json/pkg/System.Net.Http.Json.pkgproj index eba4cc39e9f9..8661c2b34181 100644 --- a/src/libraries/System.Net.Http.Json/pkg/System.Net.Http.Json.pkgproj +++ b/src/libraries/System.Net.Http.Json/pkg/System.Net.Http.Json.pkgproj @@ -1,10 +1,9 @@ - + net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks) - \ No newline at end of file diff --git a/src/libraries/System.Net.Http.Json/src/System.Net.Http.Json.csproj b/src/libraries/System.Net.Http.Json/src/System.Net.Http.Json.csproj index bb01bd45dbb1..ee6e5c6a9af4 100644 --- a/src/libraries/System.Net.Http.Json/src/System.Net.Http.Json.csproj +++ b/src/libraries/System.Net.Http.Json/src/System.Net.Http.Json.csproj @@ -1,8 +1,13 @@ - netstandard2.0;$(NetCoreAppCurrent) + netstandard2.0;$(NetCoreAppCurrent);net461;$(NetFrameworkCurrent) + true enable + + + $(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.6.1\1.0.1\lib\net461\;$(AssemblySearchPaths) + @@ -11,14 +16,16 @@ + - + + @@ -28,4 +35,9 @@ + + + + + diff --git a/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpContentJsonExtensions.cs b/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpContentJsonExtensions.cs index b666f2299446..753c0315583c 100644 --- a/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpContentJsonExtensions.cs +++ b/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpContentJsonExtensions.cs @@ -10,7 +10,7 @@ namespace System.Net.Http.Json { - public static class HttpContentJsonExtensions + public static partial class HttpContentJsonExtensions { public static Task ReadFromJsonAsync(this HttpContent content, Type type, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default) { @@ -32,16 +32,12 @@ public static Task ReadFromJsonAsync(this HttpContent content, JsonSeriali private static async Task ReadFromJsonAsyncCore(HttpContent content, Type type, Encoding? sourceEncoding, JsonSerializerOptions? options, CancellationToken cancellationToken) { - Stream contentStream = await content.ReadAsStreamAsync().ConfigureAwait(false); + Stream contentStream = await ReadHttpContentStreamAsync(content, cancellationToken).ConfigureAwait(false); // Wrap content stream into a transcoding stream that buffers the data transcoded from the sourceEncoding to utf-8. if (sourceEncoding != null && sourceEncoding != Encoding.UTF8) { -#if NETCOREAPP - contentStream = Encoding.CreateTranscodingStream(contentStream, innerStreamEncoding: sourceEncoding, outerStreamEncoding: Encoding.UTF8); -#else - contentStream = new TranscodingReadStream(contentStream, sourceEncoding); -#endif + contentStream = GetTranscodingStream(contentStream, sourceEncoding); } using (contentStream) @@ -52,16 +48,12 @@ public static Task ReadFromJsonAsync(this HttpContent content, JsonSeriali private static async Task ReadFromJsonAsyncCore(HttpContent content, Encoding? sourceEncoding, JsonSerializerOptions? options, CancellationToken cancellationToken) { - Stream contentStream = await content.ReadAsStreamAsync().ConfigureAwait(false); + Stream contentStream = await ReadHttpContentStreamAsync(content, cancellationToken).ConfigureAwait(false); // Wrap content stream into a transcoding stream that buffers the data transcoded from the sourceEncoding to utf-8. if (sourceEncoding != null && sourceEncoding != Encoding.UTF8) { -#if NETCOREAPP - contentStream = Encoding.CreateTranscodingStream(contentStream, innerStreamEncoding: sourceEncoding, outerStreamEncoding: Encoding.UTF8); -#else - contentStream = new TranscodingReadStream(contentStream, sourceEncoding); -#endif + contentStream = GetTranscodingStream(contentStream, sourceEncoding); } using (contentStream) diff --git a/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpContentJsonExtensions.netcoreapp.cs b/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpContentJsonExtensions.netcoreapp.cs new file mode 100644 index 000000000000..0abdbc95d9e2 --- /dev/null +++ b/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpContentJsonExtensions.netcoreapp.cs @@ -0,0 +1,24 @@ +// 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.IO; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace System.Net.Http.Json +{ + public static partial class HttpContentJsonExtensions + { + private static Task ReadHttpContentStreamAsync(HttpContent content, CancellationToken cancellationToken) + { + return content.ReadAsStreamAsync(cancellationToken); + } + + private static Stream GetTranscodingStream(Stream contentStream, Encoding sourceEncoding) + { + return Encoding.CreateTranscodingStream(contentStream, innerStreamEncoding: sourceEncoding, outerStreamEncoding: Encoding.UTF8); + } + } +} diff --git a/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpContentJsonExtensions.netstandard.cs b/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpContentJsonExtensions.netstandard.cs new file mode 100644 index 000000000000..4b64d0539422 --- /dev/null +++ b/src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpContentJsonExtensions.netstandard.cs @@ -0,0 +1,25 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.IO; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace System.Net.Http.Json +{ + public static partial class HttpContentJsonExtensions + { + private static Task ReadHttpContentStreamAsync(HttpContent content, CancellationToken cancellationToken) + { + // The ReadAsStreamAsync overload that takes a cancellationToken is not available in .NET Standard + return content.ReadAsStreamAsync(); + } + + private static Stream GetTranscodingStream(Stream contentStream, Encoding sourceEncoding) + { + return new TranscodingReadStream(contentStream, sourceEncoding); + } + } +} diff --git a/src/libraries/System.Net.Http.WinHttpHandler/Directory.Build.props b/src/libraries/System.Net.Http.WinHttpHandler/Directory.Build.props index 63f02a0f817e..33e65b7cb465 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/Directory.Build.props +++ b/src/libraries/System.Net.Http.WinHttpHandler/Directory.Build.props @@ -2,5 +2,6 @@ Microsoft + true \ No newline at end of file diff --git a/src/libraries/System.Net.Http.WinHttpHandler/ref/System.Net.Http.WinHttpHandler.cs b/src/libraries/System.Net.Http.WinHttpHandler/ref/System.Net.Http.WinHttpHandler.cs index 4c312fa53648..4236046359d6 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/ref/System.Net.Http.WinHttpHandler.cs +++ b/src/libraries/System.Net.Http.WinHttpHandler/ref/System.Net.Http.WinHttpHandler.cs @@ -34,6 +34,7 @@ public WinHttpHandler() { } public int MaxConnectionsPerServer { get { throw null; } set { } } public int MaxResponseDrainSize { get { throw null; } set { } } public int MaxResponseHeadersLength { get { throw null; } set { } } + public bool EnableMultipleHttp2Connections { get { throw null; } set { } } public bool PreAuthenticate { get { throw null; } set { } } public System.Collections.Generic.IDictionary Properties { get { throw null; } } public System.Net.IWebProxy? Proxy { get { throw null; } set { } } diff --git a/src/libraries/System.Net.Http.WinHttpHandler/ref/System.Net.Http.WinHttpHandler.csproj b/src/libraries/System.Net.Http.WinHttpHandler/ref/System.Net.Http.WinHttpHandler.csproj index 8eb4ef7cd0ed..69bfc2c5a79b 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/ref/System.Net.Http.WinHttpHandler.csproj +++ b/src/libraries/System.Net.Http.WinHttpHandler/ref/System.Net.Http.WinHttpHandler.csproj @@ -1,9 +1,19 @@ - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true enable + + + $(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.6.1\1.0.1\lib\net461\;$(AssemblySearchPaths) + + + + + + \ No newline at end of file diff --git a/src/libraries/System.Net.Http.WinHttpHandler/src/System.Net.Http.WinHttpHandler.csproj b/src/libraries/System.Net.Http.WinHttpHandler/src/System.Net.Http.WinHttpHandler.csproj index b302859635ba..8c06bc26a682 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/src/System.Net.Http.WinHttpHandler.csproj +++ b/src/libraries/System.Net.Http.WinHttpHandler/src/System.Net.Http.WinHttpHandler.csproj @@ -11,6 +11,8 @@ SR.PlatformNotSupported_WinHttpHandler + + $(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.6.1\1.0.1\lib\net461\;$(AssemblySearchPaths) + diff --git a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs index bd197526127d..c2b405dc3fba 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs +++ b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs @@ -55,6 +55,7 @@ public class WinHttpHandler : HttpMessageHandler private DecompressionMethods _automaticDecompression = HttpHandlerDefaults.DefaultAutomaticDecompression; private CookieUsePolicy _cookieUsePolicy = CookieUsePolicy.UseInternalCookieStoreOnly; private CookieContainer _cookieContainer; + private bool _enableMultipleHttp2Connections; private SslProtocols _sslProtocols = SslProtocols.None; // Use most secure protocols available. private Func< @@ -460,6 +461,19 @@ public int MaxResponseDrainSize } } + public bool EnableMultipleHttp2Connections + { + get + { + return _enableMultipleHttp2Connections; + } + set + { + CheckDisposedOrStarted(); + _enableMultipleHttp2Connections = value; + } + } + public IDictionary Properties { get @@ -921,6 +935,7 @@ private void SetSessionHandleOptions(SafeWinHttpHandle sessionHandle) SetSessionHandleConnectionOptions(sessionHandle); SetSessionHandleTlsOptions(sessionHandle); SetSessionHandleTimeoutOptions(sessionHandle); + SetDisableHttp2StreamQueue(sessionHandle); } private void SetSessionHandleConnectionOptions(SafeWinHttpHandle sessionHandle) @@ -1208,6 +1223,22 @@ private void SetEnableHttp2PlusClientCertificate(Uri requestUri, Version request } } + private void SetDisableHttp2StreamQueue(SafeWinHttpHandle sessionHandle) + { + if (_enableMultipleHttp2Connections) + { + uint optionData = 1; + if (Interop.WinHttp.WinHttpSetOption(sessionHandle, Interop.WinHttp.WINHTTP_OPTION_DISABLE_STREAM_QUEUE, ref optionData)) + { + if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this, "Multiple HTTP/2 connections enabled."); + } + else + { + if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this, "Multiple HTTP/2 connections cannot be enabled."); + } + } + } + internal static void SetNoClientCertificate(SafeWinHttpHandle requestHandle) { SetWinHttpOption( diff --git a/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/WinHttpHandlerTest.cs b/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/WinHttpHandlerTest.cs index 16ae99a4923d..25c6afbc0f5f 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/WinHttpHandlerTest.cs +++ b/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/WinHttpHandlerTest.cs @@ -1,11 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Collections.Generic; +using System.IO; using System.Linq; +using System.Net.Http.Functional.Tests; using System.Net.Test.Common; -using System.Text.Json; +using System.Text; using System.Threading; using System.Threading.Tasks; @@ -171,10 +172,92 @@ public async Task GetAsync_SetCookieContainerMultipleCookies_CookiesSent() }; } + [OuterLoop("Uses delays")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsWindows10Version1607OrGreater))] + public async Task SendAsync_MultipleHttp2ConnectionsEnabled_CreateAdditionalConnections() + { + // Warm up thread pool because the full .NET Framework calls synchronous Stream.Read() and we need to delay those calls thus threads will get blocked. + ThreadPool.GetMinThreads(out _, out int completionPortThreads); + ThreadPool.SetMinThreads(401, completionPortThreads); + using var handler = new WinHttpHandler(); + handler.EnableMultipleHttp2Connections = true; + handler.ServerCertificateValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; + const int maxActiveStreamsLimit = 100 * 3; + const string payloadText = "Multiple HTTP/2 connections test."; + TaskCompletionSource delaySource = new TaskCompletionSource(); + using var client = new HttpClient(handler); + List<(Task task, DelayedStream stream)> requests = new List<(Task task, DelayedStream stream)>(); + for (int i = 0; i < maxActiveStreamsLimit; i++) + { + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, Configuration.Http.Http2RemoteEchoServer) { Version = HttpVersion20.Value }; + byte[] payloadBytes = Encoding.UTF8.GetBytes(payloadText); + DelayedStream content = new DelayedStream(payloadBytes, delaySource.Task); + request.Content = new StreamContent(content); + requests.Add((client.SendAsync(request, HttpCompletionOption.ResponseContentRead), content)); + } + + HttpRequestMessage aboveLimitRequest = new HttpRequestMessage(HttpMethod.Post, Configuration.Http.Http2RemoteEchoServer) { Version = HttpVersion20.Value }; + aboveLimitRequest.Content = new StringContent($"{payloadText}-{maxActiveStreamsLimit + 1}"); + Task aboveLimitResponseTask = client.SendAsync(aboveLimitRequest, HttpCompletionOption.ResponseContentRead); + + await aboveLimitResponseTask.TimeoutAfter(TestHelper.PassingTestTimeoutMilliseconds); + await VerifyResponse(aboveLimitResponseTask, $"{payloadText}-{maxActiveStreamsLimit + 1}"); + + delaySource.SetResult(true); + + await Task.WhenAll(requests.Select(r => r.task).ToArray()).TimeoutAfter(15000); + + foreach ((Task task, DelayedStream stream) in requests) + { + Assert.True(task.IsCompleted); + HttpResponseMessage response = task.Result; + Assert.True(response.IsSuccessStatusCode); + Assert.Equal(HttpVersion20.Value, response.Version); + string responsePayload = await response.Content.ReadAsStringAsync().TimeoutAfter(TestHelper.PassingTestTimeoutMilliseconds); + Assert.Contains(payloadText, responsePayload); + } + } + + private async Task VerifyResponse(Task task, string payloadText) + { + Assert.True(task.IsCompleted); + HttpResponseMessage response = task.Result; + Assert.True(response.IsSuccessStatusCode); + Assert.Equal(HttpVersion20.Value, response.Version); + string responsePayload = await response.Content.ReadAsStringAsync().TimeoutAfter(TestHelper.PassingTestTimeoutMilliseconds); + Assert.Contains(payloadText, responsePayload); + } + public static bool JsonMessageContainsKeyValue(string message, string key, string value) { string pattern = string.Format(@"""{0}"": ""{1}""", key, value); return message.Contains(pattern); } + + private sealed class DelayedStream : MemoryStream + { + private readonly Task _delayTask; + private readonly TaskCompletionSource _waitReadSource = new TaskCompletionSource(); + private bool _delayed; + + public Task WaitRead => _waitReadSource.Task; + + public DelayedStream(byte[] buffer, Task delayTask) + : base(buffer) + { + _delayTask = delayTask; + } + + public override int Read(byte[] buffer, int offset, int count) + { + if (!_delayed) + { + _waitReadSource.SetResult(true); + _delayTask.Wait(); + _delayed = true; + } + return base.Read(buffer, offset, count); + } + } } } diff --git a/src/libraries/System.Net.Http/ref/System.Net.Http.cs b/src/libraries/System.Net.Http/ref/System.Net.Http.cs index f65651424593..dc1e77f19d7f 100644 --- a/src/libraries/System.Net.Http/ref/System.Net.Http.cs +++ b/src/libraries/System.Net.Http/ref/System.Net.Http.cs @@ -223,7 +223,7 @@ public partial class HttpResponseMessage : System.IDisposable { public HttpResponseMessage() { } public HttpResponseMessage(System.Net.HttpStatusCode statusCode) { } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public System.Net.Http.HttpContent Content { get { throw null; } set { } } public System.Net.Http.Headers.HttpResponseHeaders Headers { get { throw null; } } public bool IsSuccessStatusCode { get { throw null; } } diff --git a/src/libraries/System.Net.Http/src/System.Net.Http.csproj b/src/libraries/System.Net.Http/src/System.Net.Http.csproj index 6c03ef3c9898..65d63c045bbf 100644 --- a/src/libraries/System.Net.Http/src/System.Net.Http.csproj +++ b/src/libraries/System.Net.Http/src/System.Net.Http.csproj @@ -104,7 +104,6 @@ - + SendAsync(HttpReques { if (request.Content is StringContent) { - requestObject.SetObjectProperty("body", await request.Content.ReadAsStringAsync().ConfigureAwait(continueOnCapturedContext: true)); + requestObject.SetObjectProperty("body", await request.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: true)); } else { - using (Uint8Array uint8Buffer = Uint8Array.From(await request.Content.ReadAsByteArrayAsync().ConfigureAwait(continueOnCapturedContext: true))) + using (Uint8Array uint8Buffer = Uint8Array.From(await request.Content.ReadAsByteArrayAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: true))) { requestObject.SetObjectProperty("body", uint8Buffer); } diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/ObjectCollection.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/ObjectCollection.cs index 27dc46a10517..e7b3c4e95223 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/ObjectCollection.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/ObjectCollection.cs @@ -9,7 +9,7 @@ namespace System.Net.Http.Headers { /// An list that prohibits null elements and that is optimized for a small number of elements. [DebuggerDisplay("Count = {Count}")] - [DebuggerTypeProxy(nameof(DebugView))] + [DebuggerTypeProxy(typeof(ObjectCollection<>.DebugView))] internal sealed class ObjectCollection : ICollection where T : class { private const int DefaultSize = 4; diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/MessageProcessingHandler.cs b/src/libraries/System.Net.Http/src/System/Net/Http/MessageProcessingHandler.cs index 8455d6f3a310..dff8ab9db0f5 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/MessageProcessingHandler.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/MessageProcessingHandler.cs @@ -77,7 +77,7 @@ protected internal sealed override Task SendAsync(HttpReque if (task.IsCanceled) { - sendState.TrySetCanceled(); + sendState.TrySetCanceled(token); return; } diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/MultipartContent.cs b/src/libraries/System.Net.Http/src/System/Net/Http/MultipartContent.cs index 458591fcd220..4f1a1dd23acf 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/MultipartContent.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/MultipartContent.cs @@ -280,7 +280,7 @@ private async ValueTask CreateContentReadStreamAsyncCore(bool async, Can } else { - readStream = nestedContent.ReadAsStream(); + readStream = nestedContent.ReadAsStream(cancellationToken); } // Cannot be null, at least an empty stream is necessary. readStream ??= new MemoryStream(); @@ -292,8 +292,10 @@ private async ValueTask CreateContentReadStreamAsyncCore(bool async, Can // we fall back to the base behavior. We don't dispose of the streams already obtained // as we don't necessarily own them yet. +#pragma warning disable CA2016 // Do not pass a cancellationToken to base.CreateContentReadStreamAsync() as it would trigger an infinite loop => StackOverflow return async ? await base.CreateContentReadStreamAsync().ConfigureAwait(false) : base.CreateContentReadStream(cancellationToken); +#pragma warning restore CA2016 } streams[streamIndex++] = readStream; } diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/DecompressionHandler.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/DecompressionHandler.cs index 2fcd31d58a50..5bac88a7ba19 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/DecompressionHandler.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/DecompressionHandler.cs @@ -6,6 +6,7 @@ using System.IO; using System.IO.Compression; using System.Net.Http.Headers; +using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; @@ -164,7 +165,7 @@ private async ValueTask CreateContentReadStreamAsyncCore(bool async, Can } else { - originalStream = _originalContent.ReadAsStream(); + originalStream = _originalContent.ReadAsStream(cancellationToken); } return GetDecompressedStream(originalStream); } diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs index 11d1272ae319..e34219aac417 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs @@ -12,6 +12,7 @@ using System.Runtime.CompilerServices; using System.Text; using System.Threading; +using System.Threading.Channels; using System.Threading.Tasks; namespace System.Net.Http @@ -33,7 +34,6 @@ internal sealed partial class Http2Connection : HttpConnectionBase, IDisposable private readonly Dictionary _httpStreams; - private readonly AsyncMutex _writerLock; private readonly CreditManager _connectionWindow; private readonly CreditManager _concurrentStreams; @@ -43,7 +43,8 @@ internal sealed partial class Http2Connection : HttpConnectionBase, IDisposable private int _maxConcurrentStreams; private int _pendingWindowUpdate; private long _idleSinceTickCount; - private int _pendingWriters; + + private readonly Channel _writeChannel; private bool _lastPendingWriterShouldFlush; // This means that the pool has disposed us, but there may still be @@ -59,12 +60,6 @@ internal sealed partial class Http2Connection : HttpConnectionBase, IDisposable // This will be set when a connection IO error occurs private Exception? _abortException; - // If an in-progress write is canceled we need to be able to immediately - // report a cancellation to the user, but also block the connection until - // the write completes. We avoid actually canceling the write, as we would - // then have to close the whole connection. - private Task? _inProgressWrite; - private const int MaxStreamId = int.MaxValue; private static readonly byte[] s_http2ConnectionPreface = Encoding.ASCII.GetBytes("PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"); @@ -96,6 +91,9 @@ internal sealed partial class Http2Connection : HttpConnectionBase, IDisposable // this value, so this is not a hard maximum size. private const int UnflushedOutgoingBufferSize = 32 * 1024; + // Channel options for creating _writeChannel + private static readonly UnboundedChannelOptions s_channelOptions = new UnboundedChannelOptions() { SingleReader = true }; + public Http2Connection(HttpConnectionPool pool, Stream stream) { _pool = pool; @@ -107,10 +105,11 @@ public Http2Connection(HttpConnectionPool pool, Stream stream) _httpStreams = new Dictionary(); - _writerLock = new AsyncMutex(); _connectionWindow = new CreditManager(this, nameof(_connectionWindow), DefaultInitialWindowSize); _concurrentStreams = new CreditManager(this, nameof(_concurrentStreams), int.MaxValue); + _writeChannel = Channel.CreateUnbounded(s_channelOptions); + _nextStream = 1; _initialWindowSize = DefaultInitialWindowSize; _maxConcurrentStreams = int.MaxValue; @@ -151,24 +150,24 @@ public async ValueTask SetupAsync() _expectingSettingsAck = true; _ = ProcessIncomingFramesAsync(); + _ = ProcessOutgoingFramesAsync(); } private async Task FlushOutgoingBytesAsync() { if (NetEventSource.Log.IsEnabled()) Trace($"{nameof(_outgoingBuffer.ActiveLength)}={_outgoingBuffer.ActiveLength}"); - Debug.Assert(_outgoingBuffer.ActiveLength > 0); - try - { - await _stream.WriteAsync(_outgoingBuffer.ActiveMemory).ConfigureAwait(false); - } - catch (Exception e) - { - Abort(e); - throw; - } - finally + if (_outgoingBuffer.ActiveLength > 0) { + try + { + await _stream.WriteAsync(_outgoingBuffer.ActiveMemory).ConfigureAwait(false); + } + catch (Exception e) + { + Abort(e); + } + _lastPendingWriterShouldFlush = false; _outgoingBuffer.Discard(_outgoingBuffer.ActiveLength); } @@ -766,110 +765,138 @@ private void ProcessGoAwayFrame(FrameHeader frameHeader) } internal Task FlushAsync(CancellationToken cancellationToken) => - PerformWriteAsync(0, 0, (_, __) => FlushTiming.Now, cancellationToken); - - /// Performs a write operation serialized via the . - /// The number of bytes to be written. - /// The state to pass through to the callbacks. - /// The action to be invoked while the writer lock is held and that actually writes the data to the provided buffer. - /// The cancellation token to use while waiting. - private async Task PerformWriteAsync(int writeBytes, T state, Func, FlushTiming> lockedAction, CancellationToken cancellationToken = default) + PerformWriteAsync(0, 0, (_, __) => true, cancellationToken); + + private abstract class WriteQueueEntry : TaskCompletionSource { - if (NetEventSource.Log.IsEnabled()) Trace($"{nameof(writeBytes)}={writeBytes}"); + private readonly CancellationToken _cancellationToken; + private readonly CancellationTokenRegistration _cancellationRegistration; - // Acquire the write lock - ValueTask acquireLockTask = _writerLock.EnterAsync(cancellationToken); - if (acquireLockTask.IsCompletedSuccessfully) + public WriteQueueEntry(int writeBytes, CancellationToken cancellationToken) + : base(TaskCreationOptions.RunContinuationsAsynchronously) { - acquireLockTask.GetAwaiter().GetResult(); // to enable the value task sources to be pooled - } - else - { - Interlocked.Increment(ref _pendingWriters); - try - { - await acquireLockTask.ConfigureAwait(false); - } - catch - { - if (Interlocked.Decrement(ref _pendingWriters) == 0) - { - // If a pending waiter is canceled, we may end up in a situation where a previously written frame - // saw that there were pending writers and as such deferred its flush to them, but if/when that pending - // writer is canceled, nothing may end up flushing the deferred work (at least not promptly). To compensate, - // if a pending writer does end up being canceled, we flush asynchronously. We can't check whether there's such - // a pending operation because we failed to acquire the lock that protects that state. But we can at least only - // do the flush if our decrement caused the pending count to reach 0: if it's still higher than zero, then there's - // at least one other pending writer who can handle the flush. Worst case, we pay for a flush that ends up being - // a nop. Note: we explicitly do not pass in the cancellationToken; if we're here, it's almost certainly because - // cancellation was requested, and it's because of that cancellation that we need to flush. - LogExceptions(FlushAsync(cancellationToken: default)); - } + WriteBytes = writeBytes; - throw; - } - Interlocked.Decrement(ref _pendingWriters); + _cancellationToken = cancellationToken; + _cancellationRegistration = cancellationToken.UnsafeRegister(s => ((WriteQueueEntry)s!).OnCancellation(), this); } - // If the connection has been aborted, then fail now instead of trying to send more data. - if (_abortException != null) + public int WriteBytes { get; } + + private void OnCancellation() { - _writerLock.Exit(); - ThrowRequestAborted(_abortException); + SetCanceled(_cancellationToken); } - // Flush waiting state, then invoke the supplied action. - try + public bool TryDisableCancellation() { - // If there is a pending write that was canceled while in progress, wait for it to complete. - if (_inProgressWrite != null) - { - await new ValueTask(_inProgressWrite).ConfigureAwait(false); // await ValueTask to minimize number of awaiter fields - _inProgressWrite = null; - } + _cancellationRegistration.Dispose(); + return !Task.IsCanceled; + } - // If the buffer has already grown to 32k, does not have room for the next request, - // and is non-empty, flush the current contents to the wire. - int totalBufferLength = _outgoingBuffer.Capacity; - if (totalBufferLength >= UnflushedOutgoingBufferSize) - { - int activeBufferLength = _outgoingBuffer.ActiveLength; - if (writeBytes >= totalBufferLength - activeBufferLength && activeBufferLength > 0) - { - // We explicitly do not pass cancellationToken here, as this flush impacts more than just this operation. - await new ValueTask(FlushOutgoingBytesAsync()).ConfigureAwait(false); // await ValueTask to minimize number of awaiter fields - } - } + public abstract bool InvokeWriteAction(Memory writeBuffer); + } - // Invoke the callback with the supplied state and the target write buffer. - _outgoingBuffer.EnsureAvailableSpace(writeBytes); - FlushTiming flush = lockedAction(state, _outgoingBuffer.AvailableMemorySliced(writeBytes)); + private sealed class WriteQueueEntry : WriteQueueEntry + { + private readonly T _state; + private readonly Func, bool> _writeAction; - // Finish the write - _outgoingBuffer.Commit(writeBytes); - _lastPendingWriterShouldFlush |= flush == FlushTiming.AfterPendingWrites; - EndWrite(forceFlush: flush == FlushTiming.Now); + public WriteQueueEntry(int writeBytes, T state, Func, bool> writeAction, CancellationToken cancellationToken) + : base(writeBytes, cancellationToken) + { + _state = state; + _writeAction = writeAction; } - finally + + public override bool InvokeWriteAction(Memory writeBuffer) { - _writerLock.Exit(); + return _writeAction(_state, writeBuffer); } } - private void EndWrite(bool forceFlush) + private Task PerformWriteAsync(int writeBytes, T state, Func, bool> writeAction, CancellationToken cancellationToken = default) { - // We can't validate that we hold the mutex, but we can at least validate that someone is holding it. - Debug.Assert(_writerLock.IsHeld); + WriteQueueEntry writeEntry = new WriteQueueEntry(writeBytes, state, writeAction, cancellationToken); - // We must flush if the caller requires it or if this or a recent frame wanted to be flushed - // once there were no more pending writers that themselves could have forced the flush. - if (forceFlush || (_pendingWriters == 0 && _lastPendingWriterShouldFlush)) + if (!_writeChannel.Writer.TryWrite(writeEntry)) { - Debug.Assert(_inProgressWrite == null); - if (_outgoingBuffer.ActiveLength > 0) + Debug.Assert(_abortException is not null); + return Task.FromException(GetRequestAbortedException(_abortException)); + } + + return writeEntry.Task; + } + + private async Task ProcessOutgoingFramesAsync() + { + try + { + while (await _writeChannel.Reader.WaitToReadAsync().ConfigureAwait(false)) { - _inProgressWrite = FlushOutgoingBytesAsync(); + while (_writeChannel.Reader.TryRead(out WriteQueueEntry? writeEntry)) + { + if (writeEntry.TryDisableCancellation()) + { + if (_abortException is not null) + { + writeEntry.SetException(_abortException); + } + else + { + int writeBytes = writeEntry.WriteBytes; + + // If the buffer has already grown to 32k, does not have room for the next request, + // and is non-empty, flush the current contents to the wire. + int totalBufferLength = _outgoingBuffer.Capacity; + if (totalBufferLength >= UnflushedOutgoingBufferSize) + { + int activeBufferLength = _outgoingBuffer.ActiveLength; + if (writeBytes >= totalBufferLength - activeBufferLength) + { + await FlushOutgoingBytesAsync().ConfigureAwait(false); + } + } + + _outgoingBuffer.EnsureAvailableSpace(writeBytes); + + try + { + if (NetEventSource.Log.IsEnabled()) Trace($"{nameof(writeBytes)}={writeBytes}"); + + // Invoke the callback with the supplied state and the target write buffer. + bool flush = writeEntry.InvokeWriteAction(_outgoingBuffer.AvailableMemorySliced(writeBytes)); + + writeEntry.SetResult(); + + _outgoingBuffer.Commit(writeBytes); + _lastPendingWriterShouldFlush |= flush; + } + catch (Exception e) + { + writeEntry.SetException(e); + } + } + + } + } + + // Nothing left in the queue to process. + // Flush the write buffer if we need to. + if (_lastPendingWriterShouldFlush) + { + await FlushOutgoingBytesAsync().ConfigureAwait(false); + } } + + // Connection should be aborting at this point. + Debug.Assert(_abortException is not null); + } + catch (Exception e) + { + if (NetEventSource.Log.IsEnabled()) Trace($"Unexpected exception in {nameof(ProcessOutgoingFramesAsync)}: {e}"); + + Debug.Fail($"Unexpected exception in {nameof(ProcessOutgoingFramesAsync)}: {e}"); } } @@ -880,7 +907,7 @@ private Task SendSettingsAckAsync() => FrameHeader.WriteTo(writeBuffer.Span, 0, FrameType.Settings, FrameFlags.Ack, streamId: 0); - return FlushTiming.AfterPendingWrites; + return true; }); /// The 8-byte ping content to send, read as a big-endian integer. @@ -895,7 +922,7 @@ private Task SendPingAckAsync(long pingContent) => FrameHeader.WriteTo(span, FrameHeader.PingLength, FrameType.Ping, FrameFlags.Ack, streamId: 0); BinaryPrimitives.WriteInt64BigEndian(span.Slice(FrameHeader.Size), state.pingContent); - return FlushTiming.AfterPendingWrites; + return true; }); private Task SendRstStreamAsync(int streamId, Http2ProtocolErrorCode errorCode) => @@ -907,7 +934,7 @@ private Task SendRstStreamAsync(int streamId, Http2ProtocolErrorCode errorCode) FrameHeader.WriteTo(span, FrameHeader.RstStreamLength, FrameType.RstStream, FrameFlags.None, s.streamId); BinaryPrimitives.WriteInt32BigEndian(span.Slice(FrameHeader.Size), (int)s.errorCode); - return FlushTiming.Now; // ensure cancellation is seen as soon as possible + return true; }); private static (ReadOnlyMemory first, ReadOnlyMemory rest) SplitBuffer(ReadOnlyMemory buffer, int maxSize) => @@ -1207,18 +1234,12 @@ private async ValueTask SendHeadersAsync(HttpRequestMessage request // before taking the write lock. headerBuffer = new ArrayBuffer(InitialConnectionBufferSize, usePool: true); WriteHeaders(request, ref headerBuffer); - ReadOnlyMemory remaining = headerBuffer.ActiveMemory; - Debug.Assert(remaining.Length > 0); + ReadOnlyMemory headerBytes = headerBuffer.ActiveMemory; + Debug.Assert(headerBytes.Length > 0); // Calculate the total number of bytes we're going to use (content + headers). - int frameCount = ((remaining.Length - 1) / FrameHeader.MaxPayloadLength) + 1; - int totalSize = remaining.Length + (frameCount * FrameHeader.Size); - - ReadOnlyMemory current; - (current, remaining) = SplitBuffer(remaining, FrameHeader.MaxPayloadLength); - FrameFlags flags = - (remaining.Length == 0 ? FrameFlags.EndHeaders : FrameFlags.None) | - (request.Content == null ? FrameFlags.EndStream : FrameFlags.None); + int frameCount = ((headerBytes.Length - 1) / FrameHeader.MaxPayloadLength) + 1; + int totalSize = headerBytes.Length + (frameCount * FrameHeader.Size); // Construct and initialize the new Http2Stream instance. It's stream ID must be set below // before the instance is used and stored into the dictionary. However, we construct it here @@ -1228,70 +1249,66 @@ private async ValueTask SendHeadersAsync(HttpRequestMessage request // Start the write. This serializes access to write to the connection, and ensures that HEADERS // and CONTINUATION frames stay together, as they must do. We use the lock as well to ensure new // streams are created and started in order. - await PerformWriteAsync(totalSize, (thisRef: this, http2Stream, current, remaining, totalSize, flags, mustFlush), (s, writeBuffer) => + await PerformWriteAsync(totalSize, (thisRef: this, http2Stream, headerBytes, endStream: (request.Content == null), mustFlush), (s, writeBuffer) => { - try - { - if (NetEventSource.Log.IsEnabled()) s.thisRef.Trace(s.http2Stream.StreamId, $"Started writing. {nameof(s.totalSize)}={s.totalSize}"); + if (NetEventSource.Log.IsEnabled()) s.thisRef.Trace(s.http2Stream.StreamId, $"Started writing. Total header bytes={s.headerBytes.Length}"); - // Allocate the next available stream ID. Note that if we fail before sending the headers, - // we'll just skip this stream ID, which is fine. - lock (s.thisRef.SyncObject) + // Allocate the next available stream ID. Note that if we fail before sending the headers, + // we'll just skip this stream ID, which is fine. + lock (s.thisRef.SyncObject) + { + if (s.thisRef._nextStream == MaxStreamId || s.thisRef._disposed || s.thisRef._lastStreamId != -1) { - if (s.thisRef._nextStream == MaxStreamId || s.thisRef._disposed || s.thisRef._lastStreamId != -1) - { - // We ran out of stream IDs or we raced between acquiring the connection from the pool and shutting down. - // Throw a retryable request exception. This will cause retry logic to kick in - // and perform another connection attempt. The user should never see this exception. - s.thisRef.ThrowShutdownException(); - } + // We ran out of stream IDs or we raced between acquiring the connection from the pool and shutting down. + // Throw a retryable request exception. This will cause retry logic to kick in + // and perform another connection attempt. The user should never see this exception. + s.thisRef.ThrowShutdownException(); + } - // Now that we're holding the lock, configure the stream. The lock must be held while - // assigning the stream ID to ensure only one stream gets an ID, and it must be held - // across setting the initial window size (available credit) and storing the stream into - // collection such that window size updates are able to atomically affect all known streams. - s.http2Stream.Initialize(s.thisRef._nextStream, _initialWindowSize); + // Now that we're holding the lock, configure the stream. The lock must be held while + // assigning the stream ID to ensure only one stream gets an ID, and it must be held + // across setting the initial window size (available credit) and storing the stream into + // collection such that window size updates are able to atomically affect all known streams. + s.http2Stream.Initialize(s.thisRef._nextStream, _initialWindowSize); - // Client-initiated streams are always odd-numbered, so increase by 2. - s.thisRef._nextStream += 2; + // Client-initiated streams are always odd-numbered, so increase by 2. + s.thisRef._nextStream += 2; - // We're about to flush the HEADERS frame, so add the stream to the dictionary now. - // The lifetime of the stream is now controlled by the stream itself and the connection. - // This can fail if the connection is shutting down, in which case we will cancel sending this frame. - s.thisRef._httpStreams.Add(s.http2Stream.StreamId, s.http2Stream); - } + // We're about to flush the HEADERS frame, so add the stream to the dictionary now. + // The lifetime of the stream is now controlled by the stream itself and the connection. + // This can fail if the connection is shutting down, in which case we will cancel sending this frame. + s.thisRef._httpStreams.Add(s.http2Stream.StreamId, s.http2Stream); + } - Span span = writeBuffer.Span; + Span span = writeBuffer.Span; + + // Copy the HEADERS frame. + ReadOnlyMemory current, remaining; + (current, remaining) = SplitBuffer(s.headerBytes, FrameHeader.MaxPayloadLength); + FrameFlags flags = (remaining.Length == 0 ? FrameFlags.EndHeaders : FrameFlags.None); + flags |= (s.endStream ? FrameFlags.EndStream : FrameFlags.None); + FrameHeader.WriteTo(span, current.Length, FrameType.Headers, flags, s.http2Stream.StreamId); + span = span.Slice(FrameHeader.Size); + current.Span.CopyTo(span); + span = span.Slice(current.Length); + if (NetEventSource.Log.IsEnabled()) s.thisRef.Trace(s.http2Stream.StreamId, $"Wrote HEADERS frame. Length={current.Length}, flags={flags}"); + + // Copy CONTINUATION frames, if any. + while (remaining.Length > 0) + { + (current, remaining) = SplitBuffer(remaining, FrameHeader.MaxPayloadLength); + flags = remaining.Length == 0 ? FrameFlags.EndHeaders : FrameFlags.None; - // Copy the HEADERS frame. - FrameHeader.WriteTo(span, s.current.Length, FrameType.Headers, s.flags, s.http2Stream.StreamId); + FrameHeader.WriteTo(span, current.Length, FrameType.Continuation, flags, s.http2Stream.StreamId); span = span.Slice(FrameHeader.Size); - s.current.Span.CopyTo(span); - span = span.Slice(s.current.Length); - if (NetEventSource.Log.IsEnabled()) s.thisRef.Trace(s.http2Stream.StreamId, $"Wrote HEADERS frame. Length={s.current.Length}, flags={s.flags}"); - - // Copy CONTINUATION frames, if any. - while (s.remaining.Length > 0) - { - (s.current, s.remaining) = SplitBuffer(s.remaining, FrameHeader.MaxPayloadLength); - s.flags = s.remaining.Length == 0 ? FrameFlags.EndHeaders : FrameFlags.None; - - FrameHeader.WriteTo(span, s.current.Length, FrameType.Continuation, s.flags, s.http2Stream.StreamId); - span = span.Slice(FrameHeader.Size); - s.current.Span.CopyTo(span); - span = span.Slice(s.current.Length); - if (NetEventSource.Log.IsEnabled()) s.thisRef.Trace(s.http2Stream.StreamId, $"Wrote CONTINUATION frame. Length={s.current.Length}, flags={s.flags}"); - } + current.Span.CopyTo(span); + span = span.Slice(current.Length); + if (NetEventSource.Log.IsEnabled()) s.thisRef.Trace(s.http2Stream.StreamId, $"Wrote CONTINUATION frame. Length={current.Length}, flags={flags}"); + } - Debug.Assert(span.Length == 0); + Debug.Assert(span.Length == 0); - return s.mustFlush || (s.flags & FrameFlags.EndStream) != 0 ? FlushTiming.AfterPendingWrites : FlushTiming.Eventually; - } - catch - { - s.thisRef.EndWrite(forceFlush: false); - throw; - } + return s.mustFlush || s.endStream; }, cancellationToken).ConfigureAwait(false); return http2Stream; } @@ -1328,7 +1345,7 @@ await PerformWriteAsync(FrameHeader.Size + current.Length, (thisRef: this, strea FrameHeader.WriteTo(writeBuffer.Span, s.current.Length, FrameType.Data, FrameFlags.None, s.streamId); s.current.CopyTo(writeBuffer.Slice(FrameHeader.Size)); - return FlushTiming.Eventually; // no need to flush, as the request content may do so explicitly, or worst case we'll do so as part of the end data frame + return false; // no need to flush, as the request content may do so explicitly, or worst case we'll do so as part of the end data frame }, cancellationToken).ConfigureAwait(false); } catch @@ -1347,7 +1364,7 @@ private Task SendEndStreamAsync(int streamId) => FrameHeader.WriteTo(writeBuffer.Span, 0, FrameType.Data, FrameFlags.EndStream, s.streamId); - return FlushTiming.AfterPendingWrites; // finished sending request body, so flush soon (but ok to wait for pending packets) + return true; // finished sending request body, so flush soon (but ok to wait for pending packets) }); private Task SendWindowUpdateAsync(int streamId, int amount) @@ -1362,7 +1379,7 @@ private Task SendWindowUpdateAsync(int streamId, int amount) FrameHeader.WriteTo(span, FrameHeader.WindowUpdateLength, FrameType.WindowUpdate, FrameFlags.None, s.streamId); BinaryPrimitives.WriteInt32BigEndian(span.Slice(FrameHeader.Size), s.amount); - return FlushTiming.Now; // make sure window updates are seen as soon as possible + return true; }); } @@ -1395,14 +1412,30 @@ private void ExtendWindow(int amount) private void Abort(Exception abortException) { // The connection has failed, e.g. failed IO or a connection-level frame error. - if (Interlocked.CompareExchange(ref _abortException, abortException, null) != null && - NetEventSource.Log.IsEnabled() && - !ReferenceEquals(_abortException, abortException)) + bool alreadyAborting = false; + lock (SyncObject) { - // Lost the race to set the field to another exception, so just trace this one. - Trace($"{nameof(abortException)}=={abortException}"); + if (_abortException is null) + { + _abortException = abortException; + } + else + { + alreadyAborting = true; + } } + if (alreadyAborting) + { + if (NetEventSource.Log.IsEnabled()) Trace($"Abort called while already aborting. {nameof(abortException)}=={abortException}"); + + return; + } + + if (NetEventSource.Log.IsEnabled()) Trace($"Abort initiated. {nameof(abortException)}=={abortException}"); + + _writeChannel.Writer.Complete(); + AbortStreams(_abortException); } @@ -1665,17 +1698,6 @@ private enum SettingId : ushort MaxHeaderListSize = 0x6 } - /// Specifies when the data written needs to be flushed. - private enum FlushTiming - { - /// No specific requirement. This can be used when the caller knows another operation will soon force a flush. - Eventually, - /// The data needs to be flushed soon, but it's ok to wait briefly for pending writes to further populate the buffer. - AfterPendingWrites, - /// The data must be flushed immediately. - Now - } - // Note that this is safe to be called concurrently by multiple threads. public sealed override async Task SendAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken) @@ -1802,9 +1824,12 @@ internal void Trace(int streamId, string message, [CallerMemberName] string? mem private static void ThrowRetry(string message, Exception innerException) => throw new HttpRequestException(message, innerException, allowRetry: RequestRetryType.RetryOnSameOrNextProxy); + private static Exception GetRequestAbortedException(Exception? innerException = null) => + new IOException(SR.net_http_request_aborted, innerException); + [DoesNotReturn] private static void ThrowRequestAborted(Exception? innerException = null) => - throw new IOException(SR.net_http_request_aborted, innerException); + throw GetRequestAbortedException(innerException); [DoesNotReturn] private static void ThrowProtocolError() => diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs index ce545615c715..52f2363700b7 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs @@ -145,7 +145,7 @@ public async Task SendAsync(CancellationToken cancellationT { // Flush to ensure we get a response. // TODO: MsQuic may not need any flushing. - await _stream.FlushAsync().ConfigureAwait(false); + await _stream.FlushAsync(cancellationToken).ConfigureAwait(false); } else { diff --git a/src/libraries/System.Net.Http/src/System/Threading/AsyncMutex.cs b/src/libraries/System.Net.Http/src/System/Threading/AsyncMutex.cs deleted file mode 100644 index 03c6226d0dc3..000000000000 --- a/src/libraries/System.Net.Http/src/System/Threading/AsyncMutex.cs +++ /dev/null @@ -1,294 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Collections.Concurrent; -using System.Diagnostics; -using System.Runtime.CompilerServices; -using System.Runtime.ExceptionServices; -using System.Threading.Tasks; -using System.Threading.Tasks.Sources; - -namespace System.Threading -{ - /// Provides an async mutex. - /// - /// This could be achieved with a constructed with an initial - /// and max limit of 1. However, this implementation is optimized to the needs of HTTP/2, - /// where the mutex is held for a very short period of time, when it is held any other - /// attempts to access it must wait asynchronously, where it's only binary rather than counting, and where - /// we want to minimize contention that a releaser incurs while trying to unblock a waiter. The primary - /// value-add is the fast-path interlocked checks that minimize contention for these use cases (essentially - /// making it an async futex), and then as long as we're wrapping something and we know exactly how all - /// consumers use the type, we can offer a ValueTask-based implementation that reuses waiter nodes. - /// - internal sealed class AsyncMutex - { - /// Fast-path gate count tracking access to the mutex. - /// - /// If the value is 1, the mutex can be entered atomically with an interlocked operation. - /// If the value is less than or equal to 0, the mutex is held and requires fallback to enter it. - /// - private int _gate = 1; - /// Secondary check guarded by the lock to indicate whether the mutex is acquired. - /// - /// This is only meaningful after having updated via interlockeds and taken the appropriate path. - /// If after decrementing we end up with a negative count, the mutex is contended, hence - /// starting as true. The primary purpose of this field - /// is to handle the race condition between one thread acquiring the mutex, then another thread trying to acquire - /// and getting as far as completing the interlocked operation, and then the original thread releasing; at that point - /// it'll hit the lock and we need to store that the mutex is available to enter. If we instead used a - /// SemaphoreSlim as the fallback from the interlockeds, this would have been its count, and it would have started - /// with an initial count of 0. - /// - private bool _lockedSemaphoreFull = true; - /// The tail of the double-linked circular waiting queue. - /// - /// Waiters are added at the tail. - /// Items are dequeued from the head (tail.Prev). - /// - private Waiter? _waitersTail; - /// A pool of waiter objects that are ready to be reused. - /// - /// There is no bound on this pool, but it ends up being implicitly bounded by the maximum number of concurrent - /// waiters there ever were, which for our uses in HTTP/2 will end up being the high-water mark of concurrent streams - /// on a single connection. - /// - private readonly ConcurrentQueue _unusedWaiters = new ConcurrentQueue(); - - /// Gets whether the mutex is currently held by some operation (not necessarily the caller). - /// This should be used only for asserts and debugging. - public bool IsHeld => _gate != 1; - - /// Objects used to synchronize operations on the instance. - private object SyncObj => _unusedWaiters; - - /// Asynchronously waits to enter the mutex. - /// The CancellationToken token to observe. - /// A task that will complete when the mutex has been entered or the enter canceled. - public ValueTask EnterAsync(CancellationToken cancellationToken) - { - // If cancellation was requested, bail immediately. - // If the mutex is not currently held nor contended, enter immediately. - // Otherwise, fall back to a more expensive likely-asynchronous wait. - return - cancellationToken.IsCancellationRequested ? ValueTask.FromCanceled(cancellationToken) : - Interlocked.Decrement(ref _gate) >= 0 ? default : - Contended(cancellationToken); - - // Everything that follows is the equivalent of: - // return _sem.WaitAsync(cancellationToken); - // if _sem were to be constructed as `new SemaphoreSlim(0)`. - - ValueTask Contended(CancellationToken cancellationToken) - { - // Get a reusable waiter object. We do this before the lock to minimize work (and especially allocation) - // done while holding the lock. It's possible we'll end up dequeuing a waiter and then under the lock - // discovering the mutex is now available, at which point we will have wasted an object. That's currently - // showing to be the better alternative (including not trying to put it back in that case). - if (!_unusedWaiters.TryDequeue(out Waiter? w)) - { - w = new Waiter(this); - } - - lock (SyncObj) - { - // Now that we're holding the lock, check to see whether the async lock is acquirable. - if (!_lockedSemaphoreFull) - { - // If we are able to acquire the lock, we're done. - _lockedSemaphoreFull = true; - return default; - } - - // The lock couldn't be acquired. - // Add the waiter to the linked list of waiters. - if (_waitersTail is null) - { - w.Next = w.Prev = w; - } - else - { - Debug.Assert(_waitersTail.Next != null && _waitersTail.Prev != null); - w.Next = _waitersTail; - w.Prev = _waitersTail.Prev; - w.Prev.Next = w.Next.Prev = w; - } - _waitersTail = w; - } - - // At this point the waiter was added to the list of waiters, so we want to - // register for cancellation in order to cancel it and remove it from the list - // if cancellation is requested. However, since we've released the lock, it's - // possible the waiter could have actually already been completed and removed - // from the list by another thread releasing the mutex. That's ok; we'll - // end up registering for cancellation here, and then when the consumer awaits - // it, the act of awaiting it will Dispose of the registration, ensuring that - // it won't run after that point, making it safe to pool that instance. - w.CancellationRegistration = cancellationToken.UnsafeRegister(s => OnCancellation(s), w); - - // Return the waiter as a value task. - return new ValueTask(w, w.Version); - - // Cancels the specified waiter if it's still in the list. - static void OnCancellation(object? state) - { - Waiter? w = (Waiter)state!; - AsyncMutex m = w.Owner; - - lock (m.SyncObj) - { - bool inList = w.Next != null; - if (inList) - { - // The waiter is in the list. - Debug.Assert(w.Prev != null); - - // The gate counter was decremented when this waiter was added. We need - // to undo that. Since the waiter is still in the list, the lock must - // still be held by someone, which means we don't need to do anything with - // the result of this increment. If it increments to < 1, then there are - // still other waiters. If it increments to 1, we're in a rare race condition - // where there are no other waiters and the owner just incremented the gate - // count; they would have seen it be < 1, so they will proceed to take the - // contended code path and synchronize on the lock we're holding... once we - // release it, they will appropriately update state. - Interlocked.Increment(ref m._gate); - - if (w.Next == w) - { - Debug.Assert(m._waitersTail == w); - m._waitersTail = null; - } - else - { - w.Next!.Prev = w.Prev; - w.Prev.Next = w.Next; - if (m._waitersTail == w) - { - m._waitersTail = w.Next; - } - } - - // Remove it from the list. - w.Next = w.Prev = null; - } - else - { - // The waiter was no longer in the list. We must not cancel it. - w = null; - } - } - - // If the waiter was in the list, we removed it under the lock and thus own - // the ability to cancel it. Do so. - w?.Cancel(); - } - } - } - - /// Releases the mutex. - /// The caller must logically own the mutex. This is not validated. - public void Exit() - { - if (Interlocked.Increment(ref _gate) < 1) - { - // This is the equivalent of: - // _sem.Release(); - // if _sem were to be constructed as `new SemaphoreSlim(0)`. - Contended(); - } - - void Contended() - { - Waiter? w; - lock (SyncObj) - { - Debug.Assert(_lockedSemaphoreFull); - - w = _waitersTail; - if (w is null) - { - _lockedSemaphoreFull = false; - } - else - { - Debug.Assert(w.Next != null && w.Prev != null); - Debug.Assert(w.Next != w || w.Prev == w); - Debug.Assert(w.Prev != w || w.Next == w); - - if (w.Next == w) - { - _waitersTail = null; - } - else - { - w = w.Prev; // get the head - Debug.Assert(w.Next != null && w.Prev != null); - Debug.Assert(w.Next != w && w.Prev != w); - - w.Next.Prev = w.Prev; - w.Prev.Next = w.Next; - } - - w.Next = w.Prev = null; - } - } - - // Either there wasn't a waiter, or we got one and successfully removed it from the list, - // at which point we own the ability to complete it. Do so. - w?.Set(); - } - } - - /// Represents a waiter for the mutex. - /// Implemented as a reusable backing source for a value task. - private sealed class Waiter : IValueTaskSource - { - private ManualResetValueTaskSourceCore _mrvtsc; // mutable struct; do not make this readonly - - public Waiter(AsyncMutex owner) - { - Owner = owner; - _mrvtsc.RunContinuationsAsynchronously = true; - } - - public AsyncMutex Owner { get; } - public CancellationTokenRegistration CancellationRegistration { get; set; } - public Waiter? Next { get; set; } - public Waiter? Prev { get; set; } - - public short Version => _mrvtsc.Version; - - public void Set() => _mrvtsc.SetResult(true); - public void Cancel() => _mrvtsc.SetException(ExceptionDispatchInfo.SetCurrentStackTrace(new OperationCanceledException(CancellationRegistration.Token))); - - void IValueTaskSource.GetResult(short token) - { - Debug.Assert(Next is null && Prev is null); - - // Dispose of the registration. It's critical that this Dispose rather than Unregister, - // so that we can be guaranteed all cancellation-related work has completed by the time - // we return the instance to the pool. Otherwise, a race condition could result in - // a cancellation request for this operation canceling another unlucky request that - // happened to reuse the same node. - Debug.Assert(!Monitor.IsEntered(Owner.SyncObj)); - CancellationRegistration.Dispose(); - - // Complete the operation, propagating any exceptions. - _mrvtsc.GetResult(token); - - // Reset the instance and return it to the pool. - // We don't bother with a try/finally to return instances - // to the pool in the case of exceptions. - _mrvtsc.Reset(); - Owner._unusedWaiters.Enqueue(this); - } - - public ValueTaskSourceStatus GetStatus(short token) => - _mrvtsc.GetStatus(token); - - public void OnCompleted(Action continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags) => - _mrvtsc.OnCompleted(continuation, state, token, flags); - } - } -} diff --git a/src/libraries/System.Net.Http/tests/UnitTests/DigestAuthenticationTests.cs b/src/libraries/System.Net.Http/tests/UnitTests/DigestAuthenticationTests.cs index a4f39be36cc5..036aa2bba8aa 100644 --- a/src/libraries/System.Net.Http/tests/UnitTests/DigestAuthenticationTests.cs +++ b/src/libraries/System.Net.Http/tests/UnitTests/DigestAuthenticationTests.cs @@ -8,6 +8,7 @@ namespace System.Net.Http.Tests { + [SkipOnMono("System.Security.Cryptography is not supported on Browser, see https://github.com/dotnet/runtime/pull/38379", TestPlatforms.Browser)] public class DigestAuthenticationTests { private static readonly List s_keyListWithCountTwo = new List { "key1", "key2" }; diff --git a/src/libraries/System.Net.HttpListener/Directory.Build.props b/src/libraries/System.Net.HttpListener/Directory.Build.props index 2b9e2844e4ee..e912bb862bfa 100644 --- a/src/libraries/System.Net.HttpListener/Directory.Build.props +++ b/src/libraries/System.Net.HttpListener/Directory.Build.props @@ -3,5 +3,6 @@ Open true + true \ No newline at end of file diff --git a/src/libraries/System.Net.HttpListener/ref/System.Net.HttpListener.cs b/src/libraries/System.Net.HttpListener/ref/System.Net.HttpListener.cs index afb9e0d70e9d..3e867fd5a07b 100644 --- a/src/libraries/System.Net.HttpListener/ref/System.Net.HttpListener.cs +++ b/src/libraries/System.Net.HttpListener/ref/System.Net.HttpListener.cs @@ -139,11 +139,11 @@ public partial class HttpListenerTimeoutManager { internal HttpListenerTimeoutManager() { } public System.TimeSpan DrainEntityBody { get { throw null; } set { } } - public System.TimeSpan EntityBody { get { throw null; } set { } } - public System.TimeSpan HeaderWait { get { throw null; } set { } } + public System.TimeSpan EntityBody { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } } + public System.TimeSpan HeaderWait { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } } public System.TimeSpan IdleConnection { get { throw null; } set { } } - public long MinSendBytesPerSecond { get { throw null; } set { } } - public System.TimeSpan RequestQueue { get { throw null; } set { } } + public long MinSendBytesPerSecond { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } } + public System.TimeSpan RequestQueue { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } } } } namespace System.Net.WebSockets diff --git a/src/libraries/System.Net.HttpListener/src/System.Net.HttpListener.csproj b/src/libraries/System.Net.HttpListener/src/System.Net.HttpListener.csproj index e1c6dbfd4530..e14f7fc02e13 100644 --- a/src/libraries/System.Net.HttpListener/src/System.Net.HttpListener.csproj +++ b/src/libraries/System.Net.HttpListener/src/System.Net.HttpListener.csproj @@ -115,6 +115,8 @@ + TimeSpan.Zero; + [MinimumOSPlatform("windows7.0")] set { ValidateTimeout(value); @@ -47,6 +50,7 @@ public TimeSpan EntityBody public TimeSpan HeaderWait { get => TimeSpan.Zero; + [MinimumOSPlatform("windows7.0")] set { ValidateTimeout(value); @@ -57,6 +61,7 @@ public TimeSpan HeaderWait public long MinSendBytesPerSecond { get => 0; + [MinimumOSPlatform("windows7.0")] set { if (value < 0 || value > uint.MaxValue) @@ -70,6 +75,7 @@ public long MinSendBytesPerSecond public TimeSpan RequestQueue { get => TimeSpan.Zero; + [MinimumOSPlatform("windows7.0")] set { ValidateTimeout(value); diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/WebSockets/HttpWebSocket.cs b/src/libraries/System.Net.HttpListener/src/System/Net/WebSockets/HttpWebSocket.cs index c8443728da3f..f89b58f38148 100644 --- a/src/libraries/System.Net.HttpListener/src/System/Net/WebSockets/HttpWebSocket.cs +++ b/src/libraries/System.Net.HttpListener/src/System/Net/WebSockets/HttpWebSocket.cs @@ -18,17 +18,12 @@ internal static partial class HttpWebSocket [SuppressMessage("Microsoft.Security", "CA5350", Justification = "SHA1 used only for hashing purposes, not for crypto.")] internal static string GetSecWebSocketAcceptString(string secWebSocketKey) { - string retVal; + string acceptString = string.Concat(secWebSocketKey, HttpWebSocket.SecWebSocketKeyGuid); + byte[] toHash = Encoding.UTF8.GetBytes(acceptString); // SHA1 used only for hashing purposes, not for crypto. Check here for FIPS compat. - using (SHA1 sha1 = SHA1.Create()) - { - string acceptString = string.Concat(secWebSocketKey, HttpWebSocket.SecWebSocketKeyGuid); - byte[] toHash = Encoding.UTF8.GetBytes(acceptString); - retVal = Convert.ToBase64String(sha1.ComputeHash(toHash)); - } - - return retVal; + byte[] hash = SHA1.HashData(toHash); + return Convert.ToBase64String(hash); } // return value here signifies if a Sec-WebSocket-Protocol header should be returned by the server. diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerTimeoutManager.Windows.cs b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerTimeoutManager.Windows.cs index d967a73df665..3de078196d9e 100644 --- a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerTimeoutManager.Windows.cs +++ b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerTimeoutManager.Windows.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Runtime.Versioning; namespace System.Net { @@ -82,6 +83,7 @@ public TimeSpan EntityBody { return GetTimeout(Interop.HttpApi.HTTP_TIMEOUT_TYPE.EntityBody); } + [MinimumOSPlatform("windows7.0")] set { SetTimespanTimeout(Interop.HttpApi.HTTP_TIMEOUT_TYPE.EntityBody, value); @@ -119,6 +121,7 @@ public TimeSpan RequestQueue { return GetTimeout(Interop.HttpApi.HTTP_TIMEOUT_TYPE.RequestQueue); } + [MinimumOSPlatform("windows7.0")] set { SetTimespanTimeout(Interop.HttpApi.HTTP_TIMEOUT_TYPE.RequestQueue, value); @@ -154,6 +157,7 @@ public TimeSpan HeaderWait { return GetTimeout(Interop.HttpApi.HTTP_TIMEOUT_TYPE.HeaderWait); } + [MinimumOSPlatform("windows7.0")] set { SetTimespanTimeout(Interop.HttpApi.HTTP_TIMEOUT_TYPE.HeaderWait, value); @@ -173,6 +177,7 @@ public long MinSendBytesPerSecond // return _minSendBytesPerSecond; } + [MinimumOSPlatform("windows7.0")] set { // diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/WebSockets/WebSocketBase.cs b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/WebSockets/WebSocketBase.cs index 2d72978d9794..e0ea87b541fd 100644 --- a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/WebSockets/WebSocketBase.cs +++ b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/WebSockets/WebSocketBase.cs @@ -1591,7 +1591,7 @@ internal async Task Process(Nullable> WebSocketProtocolComponent.WebSocketCompleteAction(_webSocket, actionContext, 0); AsyncOperationCompleted = true; ReleaseLock(_webSocket.SessionHandle, ref sessionHandleLockTaken); - await _webSocket._innerStream.FlushAsync().SuppressContextFlow(); + await _webSocket._innerStream.FlushAsync(cancellationToken).SuppressContextFlow(); Monitor.Enter(_webSocket.SessionHandle, ref sessionHandleLockTaken); break; case WebSocketProtocolComponent.Action.SendToNetwork: diff --git a/src/libraries/System.Net.HttpListener/tests/AssemblyInfo.cs b/src/libraries/System.Net.HttpListener/tests/AssemblyInfo.cs new file mode 100644 index 000000000000..5bfc6fc542f5 --- /dev/null +++ b/src/libraries/System.Net.HttpListener/tests/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Xunit; + +[assembly: SkipOnCoreClr("https://github.com/dotnet/runtime/issues/39309", RuntimeTestModes.TailcallStress)] diff --git a/src/libraries/System.Net.HttpListener/tests/System.Net.HttpListener.Tests.csproj b/src/libraries/System.Net.HttpListener/tests/System.Net.HttpListener.Tests.csproj index e1d87cb26857..ea16d78ce8d3 100644 --- a/src/libraries/System.Net.HttpListener/tests/System.Net.HttpListener.Tests.csproj +++ b/src/libraries/System.Net.HttpListener/tests/System.Net.HttpListener.Tests.csproj @@ -5,6 +5,7 @@ $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX + diff --git a/src/libraries/System.Net.Mail/ref/System.Net.Mail.cs b/src/libraries/System.Net.Mail/ref/System.Net.Mail.cs index 244eca8fe1eb..8ce1f9dd8795 100644 --- a/src/libraries/System.Net.Mail/ref/System.Net.Mail.cs +++ b/src/libraries/System.Net.Mail/ref/System.Net.Mail.cs @@ -53,7 +53,7 @@ protected AttachmentBase(System.IO.Stream contentStream, string? mediaType) { } protected AttachmentBase(string fileName) { } protected AttachmentBase(string fileName, System.Net.Mime.ContentType? contentType) { } protected AttachmentBase(string fileName, string? mediaType) { } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string ContentId { get { throw null; } set { } } public System.IO.Stream ContentStream { get { throw null; } } public System.Net.Mime.ContentType ContentType { get { throw null; } set { } } @@ -112,9 +112,9 @@ public MailAddress(string address, string? displayName, System.Text.Encoding? di public string User { get { throw null; } } public override bool Equals(object? value) { throw null; } public override int GetHashCode() { throw null; } - public static bool TryCreate(string address, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out MailAddress? result) { throw null; } - public static bool TryCreate(string address, string? displayName, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out MailAddress? result) { throw null; } - public static bool TryCreate(string address, string? displayName, System.Text.Encoding displayNameEncoding, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out MailAddress? result) { throw null; } + public static bool TryCreate(string address, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out MailAddress? result) { throw null; } + public static bool TryCreate(string address, string? displayName, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out MailAddress? result) { throw null; } + public static bool TryCreate(string address, string? displayName, System.Text.Encoding displayNameEncoding, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out MailAddress? result) { throw null; } public override string ToString() { throw null; } } public partial class MailAddressCollection : System.Collections.ObjectModel.Collection @@ -134,13 +134,13 @@ public MailMessage(string from, string to, string? subject, string? body) { } public System.Net.Mail.AlternateViewCollection AlternateViews { get { throw null; } } public System.Net.Mail.AttachmentCollection Attachments { get { throw null; } } public System.Net.Mail.MailAddressCollection Bcc { get { throw null; } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string Body { get { throw null; } set { } } public System.Text.Encoding? BodyEncoding { get { throw null; } set { } } public System.Net.Mime.TransferEncoding BodyTransferEncoding { get { throw null; } set { } } public System.Net.Mail.MailAddressCollection CC { get { throw null; } } public System.Net.Mail.DeliveryNotificationOptions DeliveryNotificationOptions { get { throw null; } set { } } - [System.Diagnostics.CodeAnalysis.DisallowNull] + [System.Diagnostics.CodeAnalysis.DisallowNullAttribute] public System.Net.Mail.MailAddress? From { get { throw null; } set { } } public System.Collections.Specialized.NameValueCollection Headers { get { throw null; } } public System.Text.Encoding? HeadersEncoding { get { throw null; } set { } } @@ -149,9 +149,9 @@ public MailMessage(string from, string to, string? subject, string? body) { } [System.ObsoleteAttribute("ReplyTo is obsoleted for this type. Please use ReplyToList instead which can accept multiple addresses. https://go.microsoft.com/fwlink/?linkid=14202")] public System.Net.Mail.MailAddress? ReplyTo { get { throw null; } set { } } public System.Net.Mail.MailAddressCollection ReplyToList { get { throw null; } } - [System.Diagnostics.CodeAnalysis.DisallowNull] + [System.Diagnostics.CodeAnalysis.DisallowNullAttribute] public System.Net.Mail.MailAddress? Sender { get { throw null; } set { } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string Subject { get { throw null; } set { } } public System.Text.Encoding? SubjectEncoding { get { throw null; } set { } } public System.Net.Mail.MailAddressCollection To { get { throw null; } } @@ -175,7 +175,7 @@ public SmtpClient(string? host, int port) { } public System.Net.Mail.SmtpDeliveryFormat DeliveryFormat { get { throw null; } set { } } public System.Net.Mail.SmtpDeliveryMethod DeliveryMethod { get { throw null; } set { } } public bool EnableSsl { get { throw null; } set { } } - [System.Diagnostics.CodeAnalysis.DisallowNull] + [System.Diagnostics.CodeAnalysis.DisallowNullAttribute] public string? Host { get { throw null; } set { } } public string? PickupDirectoryLocation { get { throw null; } set { } } public int Port { get { throw null; } set { } } @@ -298,7 +298,7 @@ public ContentType(string contentType) { } public string? Boundary { get { throw null; } set { } } public string? CharSet { get { throw null; } set { } } public string MediaType { get { throw null; } set { } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string Name { get { throw null; } set { } } public System.Collections.Specialized.StringDictionary Parameters { get { throw null; } } public override bool Equals(object? rparam) { throw null; } diff --git a/src/libraries/System.Net.Mail/src/System.Net.Mail.csproj b/src/libraries/System.Net.Mail/src/System.Net.Mail.csproj index 6df2437f7e8d..27a963384903 100644 --- a/src/libraries/System.Net.Mail/src/System.Net.Mail.csproj +++ b/src/libraries/System.Net.Mail/src/System.Net.Mail.csproj @@ -29,6 +29,10 @@ + + + + @@ -121,6 +125,8 @@ Link="Common\System\Net\Security\NetEventSource.Security.cs" /> + diff --git a/src/libraries/System.Net.Mail/src/System/Net/Base64Stream.cs b/src/libraries/System.Net.Mail/src/System/Net/Base64Stream.cs index fd5e5de68d75..69cf08edee0a 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Base64Stream.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Base64Stream.cs @@ -31,21 +31,9 @@ internal sealed class Base64Stream : DelegatedStream, IEncodableStream 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, // F }; - private static ReadOnlySpan Base64EncodeMap => new byte[] - { - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47, - 61 - }; - - private readonly int _lineLength; private readonly Base64WriteStateInfo _writeState; private ReadStateInfo? _readState; - - //the number of bytes needed to encode three bytes (see algorithm description in Encode method below) - private const int SizeOfBase64EncodedChar = 4; + private readonly IByteEncoder _encoder; //bytes with this value in the decode map are invalid private const byte InvalidBase64Value = 255; @@ -53,18 +41,18 @@ internal sealed class Base64Stream : DelegatedStream, IEncodableStream internal Base64Stream(Stream stream, Base64WriteStateInfo writeStateInfo) : base(stream) { _writeState = new Base64WriteStateInfo(); - _lineLength = writeStateInfo.MaxLineLength; + _encoder = new Base64Encoder(_writeState, writeStateInfo.MaxLineLength); } internal Base64Stream(Base64WriteStateInfo writeStateInfo) : base(new MemoryStream()) { - _lineLength = writeStateInfo.MaxLineLength; _writeState = writeStateInfo; + _encoder = new Base64Encoder(_writeState, writeStateInfo.MaxLineLength); } private ReadStateInfo ReadState => _readState ?? (_readState = new ReadStateInfo()); - internal Base64WriteStateInfo WriteState + internal WriteStateInfoBase WriteState { get { @@ -118,16 +106,7 @@ public override void Close() { if (_writeState != null && WriteState.Length > 0) { - switch (WriteState.Padding) - { - case 1: - WriteState.Append(Base64EncodeMap[WriteState.LastBits], Base64EncodeMap[64]); - break; - case 2: - WriteState.Append(Base64EncodeMap[WriteState.LastBits], Base64EncodeMap[64], Base64EncodeMap[64]); - break; - } - WriteState.Padding = 0; + _encoder.AppendPadding(); FlushInternal(); } @@ -192,114 +171,12 @@ public int EncodeBytes(byte[] buffer, int offset, int count) => internal int EncodeBytes(byte[] buffer, int offset, int count, bool dontDeferFinalBytes, bool shouldAppendSpaceToCRLF) { - Debug.Assert(buffer != null, "buffer was null"); - Debug.Assert(_writeState != null, "writestate was null"); - Debug.Assert(_writeState.Buffer != null, "writestate.buffer was null"); - - // Add Encoding header, if any. e.g. =?encoding?b? - WriteState.AppendHeader(); - - int cur = offset; - switch (WriteState.Padding) - { - case 2: - WriteState.Append(Base64EncodeMap[WriteState.LastBits | ((buffer[cur] & 0xf0) >> 4)]); - if (count == 1) - { - WriteState.LastBits = (byte)((buffer[cur] & 0x0f) << 2); - WriteState.Padding = 1; - cur++; - return cur - offset; - } - WriteState.Append(Base64EncodeMap[((buffer[cur] & 0x0f) << 2) | ((buffer[cur + 1] & 0xc0) >> 6)]); - WriteState.Append(Base64EncodeMap[(buffer[cur + 1] & 0x3f)]); - cur += 2; - count -= 2; - WriteState.Padding = 0; - break; - case 1: - WriteState.Append(Base64EncodeMap[WriteState.LastBits | ((buffer[cur] & 0xc0) >> 6)]); - WriteState.Append(Base64EncodeMap[(buffer[cur] & 0x3f)]); - cur++; - count--; - WriteState.Padding = 0; - break; - } - - int calcLength = cur + (count - (count % 3)); - - // Convert three bytes at a time to base64 notation. This will output 4 chars. - for (; cur < calcLength; cur += 3) - { - if ((_lineLength != -1) && (WriteState.CurrentLineLength + SizeOfBase64EncodedChar + _writeState.FooterLength > _lineLength)) - { - WriteState.AppendCRLF(shouldAppendSpaceToCRLF); - } - - //how we actually encode: get three bytes in the - //buffer to be encoded. Then, extract six bits at a time and encode each six bit chunk as a base-64 character. - //this means that three bytes of data will be encoded as four base64 characters. It also means that to encode - //a character, we must have three bytes to encode so if the number of bytes is not divisible by three, we - //must pad the buffer (this happens below) - WriteState.Append(Base64EncodeMap[(buffer[cur] & 0xfc) >> 2]); - WriteState.Append(Base64EncodeMap[((buffer[cur] & 0x03) << 4) | ((buffer[cur + 1] & 0xf0) >> 4)]); - WriteState.Append(Base64EncodeMap[((buffer[cur + 1] & 0x0f) << 2) | ((buffer[cur + 2] & 0xc0) >> 6)]); - WriteState.Append(Base64EncodeMap[(buffer[cur + 2] & 0x3f)]); - } - - cur = calcLength; //Where we left off before - - // See if we need to fold before writing the last section (with possible padding) - if ((count % 3 != 0) && (_lineLength != -1) && (WriteState.CurrentLineLength + SizeOfBase64EncodedChar + _writeState.FooterLength >= _lineLength)) - { - WriteState.AppendCRLF(shouldAppendSpaceToCRLF); - } - - //now pad this thing if we need to. Since it must be a number of bytes that is evenly divisble by 3, - //if there are extra bytes, pad with '=' until we have a number of bytes divisible by 3 - switch (count % 3) - { - case 2: //One character padding needed - WriteState.Append(Base64EncodeMap[(buffer[cur] & 0xFC) >> 2]); - WriteState.Append(Base64EncodeMap[((buffer[cur] & 0x03) << 4) | ((buffer[cur + 1] & 0xf0) >> 4)]); - if (dontDeferFinalBytes) - { - WriteState.Append(Base64EncodeMap[((buffer[cur + 1] & 0x0f) << 2)]); - WriteState.Append(Base64EncodeMap[64]); - WriteState.Padding = 0; - } - else - { - WriteState.LastBits = (byte)((buffer[cur + 1] & 0x0F) << 2); - WriteState.Padding = 1; - } - cur += 2; - break; - - case 1: // Two character padding needed - WriteState.Append(Base64EncodeMap[(buffer[cur] & 0xFC) >> 2]); - if (dontDeferFinalBytes) - { - WriteState.Append(Base64EncodeMap[(byte)((buffer[cur] & 0x03) << 4)]); - WriteState.Append(Base64EncodeMap[64]); - WriteState.Append(Base64EncodeMap[64]); - WriteState.Padding = 0; - } - else - { - WriteState.LastBits = (byte)((buffer[cur] & 0x03) << 4); - WriteState.Padding = 2; - } - cur++; - break; - } - - // Write out the last footer, if any. e.g. ?= - WriteState.AppendFooter(); - return cur - offset; + return _encoder.EncodeBytes(buffer, offset, count, dontDeferFinalBytes, shouldAppendSpaceToCRLF); } - public string GetEncodedString() => Encoding.ASCII.GetString(WriteState.Buffer, 0, WriteState.Length); + public int EncodeString(string value, Encoding encoding) => _encoder.EncodeString(value, encoding); + + public string GetEncodedString() => _encoder.GetEncodedString(); public override int EndRead(IAsyncResult asyncResult) { diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mail/MailAddress.cs b/src/libraries/System.Net.Mail/src/System/Net/Mail/MailAddress.cs index baab89875e75..6155c0572cce 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mail/MailAddress.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mail/MailAddress.cs @@ -282,7 +282,6 @@ internal string Encode(int charsConsumed, bool allowUnicode) { string encodedAddress = string.Empty; IEncodableStream encoder; - byte[] buffer; Debug.Assert(Address != null, "address was null"); @@ -301,8 +300,7 @@ internal string Encode(int charsConsumed, bool allowUnicode) { //encode the displayname since it's non-ascii encoder = s_encoderFactory.GetEncoderForHeader(_displayNameEncoding, false, charsConsumed); - buffer = _displayNameEncoding.GetBytes(_displayName); - encoder.EncodeBytes(buffer, 0, buffer.Length); + encoder.EncodeString(_displayName, _displayNameEncoding); encodedAddress = encoder.GetEncodedString(); } diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/Base64Encoder.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/Base64Encoder.cs new file mode 100644 index 000000000000..3ddd40bf6384 --- /dev/null +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/Base64Encoder.cs @@ -0,0 +1,153 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics; + +namespace System.Net.Mime +{ + internal class Base64Encoder : ByteEncoder + { + private static ReadOnlySpan Base64EncodeMap => new byte[] + { + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47, + 61 + }; + + //the number of bytes needed to encode three bytes + private const int SizeOfBase64EncodedBlock = 4; + + private readonly int _lineLength; + private readonly Base64WriteStateInfo _writeState; + + internal override WriteStateInfoBase WriteState + { + get + { + Debug.Assert(_writeState != null, "_writeState was null"); + return _writeState; + } + } + + internal Base64Encoder(Base64WriteStateInfo writeStateInfo, int lineLength) + { + _writeState = writeStateInfo; + _lineLength = lineLength; + } + protected override bool HasSpecialEncodingForCRLF => false; + + // no special encoding of CRLF in Base64. this method will not be used + protected override void AppendEncodedCRLF() + { + throw new InvalidOperationException(); + } + + protected override bool LineBreakNeeded(byte b) + { + return LineBreakNeeded(1); + } + + protected override bool LineBreakNeeded(byte[] bytes, int count) + { + return LineBreakNeeded(count); + } + + private bool LineBreakNeeded(int numberOfBytesToAppend) + { + if (_lineLength == -1) + { + return false; + } + + int bytesLeftInCurrentBlock; + int numberOfCharsLeftInCurrentBlock; + switch (_writeState.Padding) + { + case 2: // 1 byte was encoded from 3 + bytesLeftInCurrentBlock = 2; + numberOfCharsLeftInCurrentBlock = 3; + break; + case 1: // 2 bytes were encoded from 3 + bytesLeftInCurrentBlock = 1; + numberOfCharsLeftInCurrentBlock = 2; + break; + case 0: // all 3 bytes were encoded + bytesLeftInCurrentBlock = 0; + numberOfCharsLeftInCurrentBlock = 0; + break; + default: + Debug.Fail("paddind was not in range [0,2]"); + bytesLeftInCurrentBlock = 0; + numberOfCharsLeftInCurrentBlock = 0; + break; + } + + int numberOfBytesInNewBlock = numberOfBytesToAppend - bytesLeftInCurrentBlock; + if (numberOfBytesInNewBlock <= 0) + { + return false; + } + + int numberOfBlocksToAppend = numberOfBytesInNewBlock / 3 + (numberOfBytesInNewBlock % 3 == 0 ? 0 : 1); + int numberOfCharsToAppend = numberOfCharsLeftInCurrentBlock + numberOfBlocksToAppend * SizeOfBase64EncodedBlock; + + return WriteState.CurrentLineLength + numberOfCharsToAppend + _writeState.FooterLength > _lineLength; + } + + protected override int GetCodepointSize(string value, int i) + { + return IsSurrogatePair(value, i) ? 2 : 1; + } + + public override void AppendPadding() + { + switch (_writeState.Padding) + { + case 0: // No padding needed + break; + case 2: // 2 character padding needed (1 byte was encoded instead of 3) + _writeState.Append(Base64EncodeMap[_writeState.LastBits]); + _writeState.Append(Base64EncodeMap[64]); + _writeState.Append(Base64EncodeMap[64]); + _writeState.Padding = 0; + break; + case 1: // 1 character padding needed (2 bytes were encoded instead of 3) + _writeState.Append(Base64EncodeMap[_writeState.LastBits]); + _writeState.Append(Base64EncodeMap[64]); + _writeState.Padding = 0; + break; + default: + Debug.Fail("paddind was not in range [0,2]"); + break; + } + } + + protected override void ApppendEncodedByte(byte b) + { + // Base64 encoding transforms a group of 3 bytes into a group of 4 Base64 characters + switch (_writeState.Padding) + { + case 0: // Add first byte of 3 + _writeState.Append(Base64EncodeMap[(b & 0xfc) >> 2]); + _writeState.LastBits = (byte)((b & 0x03) << 4); + _writeState.Padding = 2; + break; + case 2: // Add second byte of 3 + _writeState.Append(Base64EncodeMap[_writeState.LastBits | ((b & 0xf0) >> 4)]); + _writeState.LastBits = (byte)((b & 0x0f) << 2); + _writeState.Padding = 1; + break; + case 1: // Add third byte of 3 + _writeState.Append(Base64EncodeMap[_writeState.LastBits | ((b & 0xc0) >> 6)]); + _writeState.Append(Base64EncodeMap[(b & 0x3f)]); + _writeState.Padding = 0; + break; + default: + Debug.Fail("paddind was not in range [0,2]"); + break; + } + } + } +} diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/ByteEncoder.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/ByteEncoder.cs new file mode 100644 index 000000000000..8c5b68e250e9 --- /dev/null +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/ByteEncoder.cs @@ -0,0 +1,143 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics; +using System.Text; + +namespace System.Net.Mime +{ + internal abstract class ByteEncoder : IByteEncoder + { + internal abstract WriteStateInfoBase WriteState { get; } + + protected abstract bool HasSpecialEncodingForCRLF { get; } + + public string GetEncodedString() => Encoding.ASCII.GetString(WriteState.Buffer, 0, WriteState.Length); + + public int EncodeBytes(byte[] buffer, int offset, int count, bool dontDeferFinalBytes, bool shouldAppendSpaceToCRLF) + { + // Add Encoding header, if any. e.g. =?encoding?b? + WriteState.AppendHeader(); + + bool _hasSpecialEncodingForCRLF = HasSpecialEncodingForCRLF; + + int cur = offset; + for (; cur < count + offset; cur++) + { + if (LineBreakNeeded(buffer[cur])) + { + AppendPadding(); + WriteState.AppendCRLF(shouldAppendSpaceToCRLF); + } + + if (_hasSpecialEncodingForCRLF && IsCRLF(buffer, cur, count + offset)) + { + AppendEncodedCRLF(); + cur++; // Transformed two chars, so shift the index to account for that + } + else + { + ApppendEncodedByte(buffer[cur]); + } + } + + if (dontDeferFinalBytes) + { + AppendPadding(); + } + + // Write out the last footer, if any. e.g. ?= + WriteState.AppendFooter(); + return cur - offset; + } + + public int EncodeString(string value, Encoding encoding) + { + Debug.Assert(value != null, "value was null"); + Debug.Assert(WriteState != null, "writestate was null"); + Debug.Assert(WriteState.Buffer != null, "writestate.buffer was null"); + + if (encoding == Encoding.Latin1) // we don't need to check for codepoints + { + byte[] buffer = encoding.GetBytes(value); + return EncodeBytes(buffer, 0, buffer.Length, true, true); + } + + // Add Encoding header, if any. e.g. =?encoding?b? + WriteState.AppendHeader(); + + bool _hasSpecialEncodingForCRLF = HasSpecialEncodingForCRLF; + + int totalBytesCount = 0; + byte[] bytes = new byte[encoding.GetMaxByteCount(2)]; + for (int i = 0; i < value.Length; ++i) + { + int codepointSize = GetCodepointSize(value, i); + Debug.Assert(codepointSize == 1 || codepointSize == 2, "codepointSize was not 1 or 2"); + + int bytesCount = encoding.GetBytes(value, i, codepointSize, bytes, 0); + if (codepointSize == 2) + { + ++i; // Transformed two chars, so shift the index to account for that + } + + if (LineBreakNeeded(bytes, bytesCount)) + { + AppendPadding(); + WriteState.AppendCRLF(true); + } + + if (_hasSpecialEncodingForCRLF && IsCRLF(bytes, bytesCount)) + { + AppendEncodedCRLF(); + } + else + { + AppendEncodedCodepoint(bytes, bytesCount); + } + totalBytesCount += bytesCount; + } + + AppendPadding(); + + // Write out the last footer, if any. e.g. ?= + WriteState.AppendFooter(); + + return totalBytesCount; + } + + protected abstract void AppendEncodedCRLF(); + + protected abstract bool LineBreakNeeded(byte b); + protected abstract bool LineBreakNeeded(byte[] bytes, int count); + + protected abstract int GetCodepointSize(string value, int i); + + public abstract void AppendPadding(); + + protected abstract void ApppendEncodedByte(byte b); + + private void AppendEncodedCodepoint(byte[] bytes, int count) + { + for (int i = 0; i < count; ++i) + { + ApppendEncodedByte(bytes[i]); + } + } + + protected bool IsSurrogatePair(string value, int i) + { + return char.IsSurrogate(value[i]) && i + 1 < value.Length && char.IsSurrogatePair(value[i], value[i + 1]); + } + + protected bool IsCRLF(byte[] bytes, int count) + { + return count == 2 && IsCRLF(bytes, 0, count); + } + + private bool IsCRLF(byte[] buffer, int i, int bufferSize) + { + return buffer[i] == '\r' && i + 1 < bufferSize && buffer[i + 1] == '\n'; + } + } +} diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/EightBitStream.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/EightBitStream.cs index 426a66b522f4..0b65f2c4c5e6 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/EightBitStream.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/EightBitStream.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.IO; +using System.Text; namespace System.Net.Mime { @@ -155,6 +156,8 @@ private void EncodeLines(byte[] buffer, int offset, int count) public int EncodeBytes(byte[] buffer, int offset, int count) { throw new NotImplementedException(); } + public int EncodeString(string value, Encoding encoding) { throw new NotImplementedException(); } + public string GetEncodedString() { throw new NotImplementedException(); } } } diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/IByteEncoder.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/IByteEncoder.cs new file mode 100644 index 000000000000..33af3546eeb7 --- /dev/null +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/IByteEncoder.cs @@ -0,0 +1,16 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Text; + +namespace System.Net.Mime +{ + internal interface IByteEncoder + { + // This method does not account for codepoint boundaries. If encoding a string, consider using EncodeString + int EncodeBytes(byte[] buffer, int offset, int count, bool dontDeferFinalBytes, bool shouldAppendSpaceToCRLF); + void AppendPadding(); + int EncodeString(string value, Encoding encoding); + string GetEncodedString(); + } +} diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/IEncodableStream.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/IEncodableStream.cs index 18d5a2e07883..43bd90210af3 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/IEncodableStream.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/IEncodableStream.cs @@ -1,13 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Text; namespace System.Net.Mime { internal interface IEncodableStream { int DecodeBytes(byte[] buffer, int offset, int count); + // This method does not account for codepoint boundaries. If encoding a string, consider using EncodeString int EncodeBytes(byte[] buffer, int offset, int count); + int EncodeString(string value, Encoding encoding); string GetEncodedString(); } } diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/MimeBasePart.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/MimeBasePart.cs index cfb64af119c7..b5e0abab0794 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/MimeBasePart.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/MimeBasePart.cs @@ -39,8 +39,7 @@ internal static string EncodeHeaderValue(string value, Encoding? encoding, bool EncodedStreamFactory factory = new EncodedStreamFactory(); IEncodableStream stream = factory.GetEncoderForHeader(encoding, base64Encoding, headerLength); - byte[] buffer = encoding.GetBytes(value); - stream.EncodeBytes(buffer, 0, buffer.Length); + stream.EncodeString(value, encoding); return stream.GetEncodedString(); } diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncodedStream.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncodedStream.cs index a1dac368b360..d5499c079405 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncodedStream.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncodedStream.cs @@ -15,8 +15,6 @@ namespace System.Net.Mime /// internal class QEncodedStream : DelegatedStream, IEncodableStream { - //folding takes up 3 characters "\r\n " - private const int SizeOfFoldingCRLF = 3; private static ReadOnlySpan HexDecodeMap => new byte[] // rely on C# compiler optimization to eliminate allocation { @@ -41,10 +39,12 @@ internal class QEncodedStream : DelegatedStream, IEncodableStream private ReadStateInfo? _readState; private readonly WriteStateInfoBase _writeState; + private readonly IByteEncoder _encoder; internal QEncodedStream(WriteStateInfoBase wsi) : base(new MemoryStream()) { _writeState = wsi; + _encoder = new QEncoder(_writeState); } private ReadStateInfo ReadState => _readState ?? (_readState = new ReadStateInfo()); @@ -195,71 +195,11 @@ public unsafe int DecodeBytes(byte[] buffer, int offset, int count) } } - public int EncodeBytes(byte[] buffer, int offset, int count) - { - // Add Encoding header, if any. e.g. =?encoding?b? - _writeState.AppendHeader(); - - // Scan one character at a time looking for chars that need to be encoded. - int cur = offset; - for (; cur < count + offset; cur++) - { - if ( // Fold if we're before a whitespace and encoding another character would be too long - ((WriteState.CurrentLineLength + SizeOfFoldingCRLF + WriteState.FooterLength >= WriteState.MaxLineLength) - && (buffer[cur] == ' ' || buffer[cur] == '\t' || buffer[cur] == '\r' || buffer[cur] == '\n')) - // Or just adding the footer would be too long. - || (WriteState.CurrentLineLength + _writeState.FooterLength >= WriteState.MaxLineLength) - ) - { - WriteState.AppendCRLF(true); - } - - // We don't need to worry about RFC 2821 4.5.2 (encoding first dot on a line), - // it is done by the underlying 7BitStream - - //always encode CRLF - if (buffer[cur] == '\r' && cur + 1 < count + offset && buffer[cur + 1] == '\n') - { - cur++; - - //the encoding for CRLF is =0D=0A - WriteState.Append((byte)'=', (byte)'0', (byte)'D', (byte)'=', (byte)'0', (byte)'A'); - } - else if (buffer[cur] == ' ') - { - //spaces should be escaped as either '_' or '=20' and - //we have chosen '_' for parity with other email client - //behavior - WriteState.Append((byte)'_'); - } - // RFC 2047 Section 5 part 3 also allows for !*+-/ but these arn't required in headers. - // Conservatively encode anything but letters or digits. - else if (IsAsciiLetterOrDigit((char)buffer[cur])) - { - // Just a regular printable ascii char. - WriteState.Append(buffer[cur]); - } - else - { - //append an = to indicate an encoded character - WriteState.Append((byte)'='); - //shift 4 to get the first four bytes only and look up the hex digit - WriteState.Append((byte)HexConverter.ToCharUpper(buffer[cur] >> 4)); - //clear the first four bytes to get the last four and look up the hex digit - WriteState.Append((byte)HexConverter.ToCharUpper(buffer[cur])); - } - } - WriteState.AppendFooter(); - return cur - offset; - } - - private static bool IsAsciiLetterOrDigit(char character) => - IsAsciiLetter(character) || (character >= '0' && character <= '9'); + public int EncodeBytes(byte[] buffer, int offset, int count) =>_encoder.EncodeBytes(buffer, offset, count, true, true); - private static bool IsAsciiLetter(char character) => - (character >= 'a' && character <= 'z') || (character >= 'A' && character <= 'Z'); + public int EncodeString(string value, Encoding encoding) => _encoder.EncodeString(value, encoding); - public string GetEncodedString() => Encoding.ASCII.GetString(WriteState.Buffer, 0, WriteState.Length); + public string GetEncodedString() => _encoder.GetEncodedString(); public override void EndWrite(IAsyncResult asyncResult) => WriteAsyncResult.End(asyncResult); diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncoder.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncoder.cs new file mode 100644 index 000000000000..76809cbd33de --- /dev/null +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncoder.cs @@ -0,0 +1,110 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Net.Mime +{ + internal class QEncoder : ByteEncoder + { + private const int SizeOfQEncodedChar = 3; // e.g. "=3A" + + private readonly WriteStateInfoBase _writeState; + + internal override WriteStateInfoBase WriteState => _writeState; + + protected override bool HasSpecialEncodingForCRLF => true; + + internal QEncoder(WriteStateInfoBase wsi) + { + _writeState = wsi; + } + + protected override void AppendEncodedCRLF() + { + //the encoding for CRLF is =0D=0A + WriteState.Append((byte)'=', (byte)'0', (byte)'D', (byte)'=', (byte)'0', (byte)'A'); + } + + protected override bool LineBreakNeeded(byte b) + { + // Fold if we're before a whitespace and encoding another character would be too long + int lengthAfterAddingCharAndFooter = WriteState.CurrentLineLength + SizeOfQEncodedChar + WriteState.FooterLength; + bool isWhitespace = b == ' ' || b == '\t' || b == '\r' || b == '\n'; + if (lengthAfterAddingCharAndFooter >= WriteState.MaxLineLength && isWhitespace) + { + return true; + } + + // Or just adding the footer would be too long. + int lengthAfterAddingFooter = WriteState.CurrentLineLength + WriteState.FooterLength; + if (lengthAfterAddingFooter >= WriteState.MaxLineLength) + { + return true; + } + + return false; + } + + protected override bool LineBreakNeeded(byte[] bytes, int count) + { + if (count == 1 || IsCRLF(bytes, count)) // preserve same behavior as in EncodeBytes + { + return LineBreakNeeded(bytes[0]); + } + + int numberOfCharsToAppend = count * SizeOfQEncodedChar; + return WriteState.CurrentLineLength + numberOfCharsToAppend + _writeState.FooterLength > WriteState.MaxLineLength; + } + + protected override int GetCodepointSize(string value, int i) + { + // specific encoding for CRLF + if (value[i] == '\r' && i + 1 < value.Length && value[i + 1] == '\n') + { + return 2; + } + + if (IsSurrogatePair(value, i)) + { + return 2; + } + + return 1; + } + + // no padding in q-encoding + public override void AppendPadding() { } + + protected override void ApppendEncodedByte(byte b) + { + if (b == ' ') + { + //spaces should be escaped as either '_' or '=20' and + //we have chosen '_' for parity with other email client + //behavior + WriteState.Append((byte)'_'); + } + // RFC 2047 Section 5 part 3 also allows for !*+-/ but these arn't required in headers. + // Conservatively encode anything but letters or digits. + else if (IsAsciiLetterOrDigit((char)b)) + { + // Just a regular printable ascii char. + WriteState.Append(b); + } + else + { + //append an = to indicate an encoded character + WriteState.Append((byte)'='); + //shift 4 to get the first four bytes only and look up the hex digit + WriteState.Append((byte)HexConverter.ToCharUpper(b >> 4)); + //clear the first four bytes to get the last four and look up the hex digit + WriteState.Append((byte)HexConverter.ToCharUpper(b)); + } + } + + private static bool IsAsciiLetterOrDigit(char character) => + IsAsciiLetter(character) || (character >= '0' && character <= '9'); + + private static bool IsAsciiLetter(char character) => + (character >= 'a' && character <= 'z') || (character >= 'A' && character <= 'Z'); + } +} diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/QuotedPrintableStream.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/QuotedPrintableStream.cs index a2aa6eb7d052..60f85e4d172d 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/QuotedPrintableStream.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/QuotedPrintableStream.cs @@ -311,6 +311,12 @@ public int EncodeBytes(byte[] buffer, int offset, int count) return cur - offset; } + public int EncodeString(string value, Encoding encoding) + { + byte[] buffer = encoding.GetBytes(value); + return EncodeBytes(buffer, 0, buffer.Length); + } + public string GetEncodedString() => Encoding.ASCII.GetString(WriteState.Buffer, 0, WriteState.Length); public override void EndWrite(IAsyncResult asyncResult) => WriteAsyncResult.End(asyncResult); diff --git a/src/libraries/System.Net.Mail/tests/Unit/Base64EncodingTest.cs b/src/libraries/System.Net.Mail/tests/Unit/Base64EncodingTest.cs index 5fa67fac522f..d441cb2bbc9a 100644 --- a/src/libraries/System.Net.Mail/tests/Unit/Base64EncodingTest.cs +++ b/src/libraries/System.Net.Mail/tests/Unit/Base64EncodingTest.cs @@ -28,6 +28,25 @@ public void Base64Stream_WithBasicAsciiString_ShouldEncodeAndDecode(string testH Assert.Equal(testHeader, Encoding.UTF8.GetString(stringToDecode, 0, result)); } + [Theory] + [InlineData("some test header to base64 encode")] + [InlineData("some test h\xE9ader to base64asdf\xE9\xE5")] + public void Base64Stream_EncodeString_WithBasicAsciiString_ShouldEncodeAndDecode(string testHeader) + { + var s = new Base64Stream(new Base64WriteStateInfo()); + s.EncodeString(testHeader, Encoding.UTF8); + + string encodedString = s.GetEncodedString(); + for (int i = 0; i < encodedString.Length; i++) + { + Assert.InRange((byte)encodedString[i], 0, 127); + } + + byte[] stringToDecode = Encoding.ASCII.GetBytes(encodedString); + int result = s.DecodeBytes(stringToDecode, 0, encodedString.Length); + Assert.Equal(testHeader, Encoding.UTF8.GetString(stringToDecode, 0, result)); + } + [Fact] public void Base64Stream_WithVerySmallBuffer_ShouldTriggerBufferResize_AndShouldEncodeProperly() { @@ -47,6 +66,24 @@ public void Base64Stream_WithVerySmallBuffer_ShouldTriggerBufferResize_AndShould Assert.Equal(TestString, Encoding.UTF8.GetString(stringToDecode, 0, result)); } + [Fact] + public void Base64Stream_EncodeString_WithVerySmallBuffer_ShouldTriggerBufferResize_AndShouldEncodeProperly() + { + var s = new Base64Stream(new Base64WriteStateInfo(10, new byte[0], new byte[0], 70, 0)); + + const string TestString = "0123456789abcdef"; + + s.EncodeString(TestString, Encoding.UTF8); + string encodedString = s.GetEncodedString(); + + Assert.Equal("MDEyMzQ1Njc4OWFiY2RlZg==", encodedString); + + byte[] stringToDecode = Encoding.ASCII.GetBytes(encodedString); + int result = s.DecodeBytes(stringToDecode, 0, encodedString.Length); + + Assert.Equal(TestString, Encoding.UTF8.GetString(stringToDecode, 0, result)); + } + [Fact] public void Base64Stream_WithVeryLongString_ShouldEncodeProperly() { @@ -63,6 +100,21 @@ public void Base64Stream_WithVeryLongString_ShouldEncodeProperly() Assert.Equal(LongString, Encoding.UTF8.GetString(stringToDecode, 0, result)); } + [Fact] + public void Base64Stream_EncodeString_WithVeryLongString_ShouldEncodeProperly() + { + var writeStateInfo = new Base64WriteStateInfo(10, new byte[0], new byte[0], 70, 0); + var s = new Base64Stream(writeStateInfo); + + s.EncodeString(LongString, Encoding.UTF8); + string encodedString = s.GetEncodedString(); + + byte[] stringToDecode = Encoding.ASCII.GetBytes(encodedString); + int result = s.DecodeBytes(stringToDecode, 0, encodedString.Length); + + Assert.Equal(LongString, Encoding.UTF8.GetString(stringToDecode, 0, result)); + } + private const string LongString = @"01234567 11234567 diff --git a/src/libraries/System.Net.Mail/tests/Unit/ByteEncodingTest.cs b/src/libraries/System.Net.Mail/tests/Unit/ByteEncodingTest.cs index 99a3df3f6d87..3486fbfe526d 100644 --- a/src/libraries/System.Net.Mail/tests/Unit/ByteEncodingTest.cs +++ b/src/libraries/System.Net.Mail/tests/Unit/ByteEncodingTest.cs @@ -61,5 +61,71 @@ public void EncoderAndDecoder_WithQEncodedString_AndNoUnicode_AndShortHeader_Sho Assert.Equal(testHeader, MimeBasePart.DecodeHeaderValue(result)); } + + [Fact] + public void EncodeHeader_Base64Encoding_ShouldSplitBetweenCodepoints() + { + // header parts split by max line length in base64 encoding = 70 with respect to codepoints + string headerPart1 = "Emoji subject : 🕐🕑🕒🕓🕔🕕"; + string headerPart2 = "🕖🕗🕘🕙🕚"; + string longEmojiHeader = headerPart1 + headerPart2; + + string encodedHeader = MimeBasePart.EncodeHeaderValue(longEmojiHeader, Encoding.UTF8, true); + + string encodedPart1 = MimeBasePart.EncodeHeaderValue(headerPart1, Encoding.UTF8, true); + string encodedPart2 = MimeBasePart.EncodeHeaderValue(headerPart2, Encoding.UTF8, true); + Assert.Equal("=?utf-8?B?RW1vamkgc3ViamVjdCA6IPCflZDwn5WR8J+VkvCflZPwn5WU8J+VlQ==?=", encodedPart1); + Assert.Equal("=?utf-8?B?8J+VlvCflZfwn5WY8J+VmfCflZo=?=", encodedPart2); + + string expectedEncodedHeader = encodedPart1 + "\r\n " + encodedPart2; + Assert.Equal(expectedEncodedHeader, encodedHeader); + } + + [Fact] + public void EncodeHeader_QEncoding_ShouldSplitBetweenCodepoints() + { + // header parts split by max line length in q-encoding = 70 with respect to codepoints + string headerPart1 = "Emoji subject : 🕐🕑🕒"; + string headerPart2 = "🕓🕔🕕🕖"; + string headerPart3 = "🕗🕘🕙🕚"; + string longEmojiHeader = headerPart1 + headerPart2 + headerPart3; + + string encodedHeader = MimeBasePart.EncodeHeaderValue(longEmojiHeader, Encoding.UTF8, false); + + string encodedPart1 = MimeBasePart.EncodeHeaderValue(headerPart1, Encoding.UTF8, false); + string encodedPart2 = MimeBasePart.EncodeHeaderValue(headerPart2, Encoding.UTF8, false); + string encodedPart3 = MimeBasePart.EncodeHeaderValue(headerPart3, Encoding.UTF8, false); + Assert.Equal("=?utf-8?Q?Emoji_subject_=3A_=F0=9F=95=90=F0=9F=95=91=F0=9F=95=92?=", encodedPart1); + Assert.Equal("=?utf-8?Q?=F0=9F=95=93=F0=9F=95=94=F0=9F=95=95=F0=9F=95=96?=", encodedPart2); + Assert.Equal("=?utf-8?Q?=F0=9F=95=97=F0=9F=95=98=F0=9F=95=99=F0=9F=95=9A?=", encodedPart3); + + string expectedEncodedHeader = encodedPart1 + "\r\n " + encodedPart2 + "\r\n " + encodedPart3; + Assert.Equal(expectedEncodedHeader, encodedHeader); + } + + [Theory] + [InlineData(false, "🕐11111111111111111111111111111111111111111111:1111")] + [InlineData(false, "🕐111111111111111111111111111111111111111111111:111")] + [InlineData(false, "🕐1111111111111111111111111111111111111111111111:11")] + [InlineData(false, "🕐11111111111111111111111111111111111111111\r\n1111")] + [InlineData(false, "🕐111111111111111111111111111111111111111111\r\n111")] + [InlineData(false, "🕐1111111111111111111111111111111111111111111\r\n11")] + [InlineData(true, "Emoji subject : 🕐🕑🕒🕓🕔🕕:11111")] + [InlineData(true, "Emoji subject : 🕐🕑🕒🕓🕔🕕\r\n11")] + public void EncodeString_IsSameAsEncodeBytes_IfOneByteCodepointOnLineWrap(bool useBase64Encoding, string value) + { + var factory = new EncodedStreamFactory(); + IEncodableStream streamForEncodeString = factory.GetEncoderForHeader(Encoding.UTF8, useBase64Encoding, 0); + IEncodableStream streamForEncodeBytes = factory.GetEncoderForHeader(Encoding.UTF8, useBase64Encoding, 0); + + streamForEncodeString.EncodeString(value, Encoding.UTF8); + string encodeStringResult = streamForEncodeString.GetEncodedString(); + + byte[] bytes = Encoding.UTF8.GetBytes(value); + streamForEncodeBytes.EncodeBytes(bytes, 0, bytes.Length); + string encodeBytesResult = streamForEncodeBytes.GetEncodedString(); + + Assert.Equal(encodeBytesResult, encodeStringResult); + } } } diff --git a/src/libraries/System.Net.Mail/tests/Unit/System.Net.Mail.Unit.Tests.csproj b/src/libraries/System.Net.Mail/tests/Unit/System.Net.Mail.Unit.Tests.csproj index 34250a03dfe5..6b9e7bd1dfa4 100644 --- a/src/libraries/System.Net.Mail/tests/Unit/System.Net.Mail.Unit.Tests.csproj +++ b/src/libraries/System.Net.Mail/tests/Unit/System.Net.Mail.Unit.Tests.csproj @@ -92,6 +92,14 @@ Link="ProductionCode\SmtpDateTime.cs" /> + + + + + diff --git a/src/libraries/System.Net.NameResolution/src/ExcludeApiList.PNSE.Browser.txt b/src/libraries/System.Net.NameResolution/src/ExcludeApiList.PNSE.Browser.txt new file mode 100644 index 000000000000..1a14a6ffdf90 --- /dev/null +++ b/src/libraries/System.Net.NameResolution/src/ExcludeApiList.PNSE.Browser.txt @@ -0,0 +1 @@ +M:System.Net.Dns.GetHostName diff --git a/src/libraries/System.Net.NameResolution/src/Resources/Strings.resx b/src/libraries/System.Net.NameResolution/src/Resources/Strings.resx index 2bd0e6280182..578cb9c5e2fb 100644 --- a/src/libraries/System.Net.NameResolution/src/Resources/Strings.resx +++ b/src/libraries/System.Net.NameResolution/src/Resources/Strings.resx @@ -72,4 +72,7 @@ IPv4 address 0.0.0.0 and IPv6 address ::0 are unspecified addresses that cannot be used as a target address. + + System.Net.NameResolution is not supported on this platform. + \ No newline at end of file diff --git a/src/libraries/System.Net.NameResolution/src/System.Net.NameResolution.csproj b/src/libraries/System.Net.NameResolution/src/System.Net.NameResolution.csproj index ad531b05c5bd..9dd965698c5d 100644 --- a/src/libraries/System.Net.NameResolution/src/System.Net.NameResolution.csproj +++ b/src/libraries/System.Net.NameResolution/src/System.Net.NameResolution.csproj @@ -5,10 +5,15 @@ $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser enable - + + SR.NameResolution_PlatformNotSupported + --exclude-api-list ExcludeApiList.PNSE.Browser.txt + + + @@ -16,6 +21,8 @@ Link="Common\System\Net\InternalException.cs" /> + @@ -69,7 +76,7 @@ - + @@ -102,6 +109,9 @@ + + + diff --git a/src/libraries/System.Net.NameResolution/src/System/Net/Dns.Browser.cs b/src/libraries/System.Net.NameResolution/src/System/Net/Dns.Browser.cs new file mode 100644 index 000000000000..094faaf69f38 --- /dev/null +++ b/src/libraries/System.Net.NameResolution/src/System/Net/Dns.Browser.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +namespace System.Net +{ + public static partial class Dns + { + public static string GetHostName() + { + return Environment.MachineName; + } + } +} diff --git a/src/libraries/System.Net.NameResolution/src/System/Net/Dns.cs b/src/libraries/System.Net.NameResolution/src/System/Net/Dns.cs index 54c6864e7e5a..98cb7ccbc0b5 100644 --- a/src/libraries/System.Net.NameResolution/src/System/Net/Dns.cs +++ b/src/libraries/System.Net.NameResolution/src/System/Net/Dns.cs @@ -1,11 +1,13 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics; using System.Globalization; using System.Net.Internals; using System.Net.Sockets; using System.Threading; using System.Threading.Tasks; +using Microsoft.Extensions.Internal; namespace System.Net { @@ -17,7 +19,22 @@ public static string GetHostName() { NameResolutionPal.EnsureSocketsAreInitialized(); - string name = NameResolutionPal.GetHostName(); + ValueStopwatch stopwatch = NameResolutionTelemetry.Log.BeforeResolution(string.Empty); + + string name; + try + { + name = NameResolutionPal.GetHostName(); + } + catch when (LogFailure(stopwatch)) + { + Debug.Fail("LogFailure should return false"); + throw; + } + + if (NameResolutionTelemetry.Log.IsEnabled()) + NameResolutionTelemetry.Log.AfterResolution(stopwatch, successful: true); + if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(null, name); return name; } @@ -293,22 +310,36 @@ private static object GetHostEntryOrAddressesCore(string hostName, bool justAddr { ValidateHostName(hostName); - SocketError errorCode = NameResolutionPal.TryGetAddrInfo(hostName, justAddresses, out string? newHostName, out string[] aliases, out IPAddress[] addresses, out int nativeErrorCode); + ValueStopwatch stopwatch = NameResolutionTelemetry.Log.BeforeResolution(hostName); - if (errorCode != SocketError.Success) + object result; + try { - if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(hostName, $"{hostName} DNS lookup failed with {errorCode}"); - throw SocketExceptionFactory.CreateSocketException(errorCode, nativeErrorCode); - } + SocketError errorCode = NameResolutionPal.TryGetAddrInfo(hostName, justAddresses, out string? newHostName, out string[] aliases, out IPAddress[] addresses, out int nativeErrorCode); - object result = justAddresses ? (object) - addresses : - new IPHostEntry + if (errorCode != SocketError.Success) { - AddressList = addresses, - HostName = newHostName!, - Aliases = aliases - }; + if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(hostName, $"{hostName} DNS lookup failed with {errorCode}"); + throw SocketExceptionFactory.CreateSocketException(errorCode, nativeErrorCode); + } + + result = justAddresses ? (object) + addresses : + new IPHostEntry + { + AddressList = addresses, + HostName = newHostName!, + Aliases = aliases + }; + } + catch when (LogFailure(stopwatch)) + { + Debug.Fail("LogFailure should return false"); + throw; + } + + if (NameResolutionTelemetry.Log.IsEnabled()) + NameResolutionTelemetry.Log.AfterResolution(stopwatch, successful: true); return result; } @@ -327,21 +358,62 @@ private static object GetHostEntryOrAddressesCore(IPAddress address, bool justAd // will only return that address and not the full list. // Do a reverse lookup to get the host name. - string? name = NameResolutionPal.TryGetNameInfo(address, out SocketError errorCode, out int nativeErrorCode); - if (errorCode != SocketError.Success) + ValueStopwatch stopwatch = NameResolutionTelemetry.Log.BeforeResolution(address); + + SocketError errorCode; + string? name; + try + { + name = NameResolutionPal.TryGetNameInfo(address, out errorCode, out int nativeErrorCode); + if (errorCode != SocketError.Success) + { + if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(address, $"{address} DNS lookup failed with {errorCode}"); + throw SocketExceptionFactory.CreateSocketException(errorCode, nativeErrorCode); + } + Debug.Assert(name != null); + } + catch when (LogFailure(stopwatch)) + { + Debug.Fail("LogFailure should return false"); + throw; + } + + if (NameResolutionTelemetry.Log.IsEnabled()) { - if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(address, $"{address} DNS lookup failed with {errorCode}"); - throw SocketExceptionFactory.CreateSocketException(errorCode, nativeErrorCode); + NameResolutionTelemetry.Log.AfterResolution(stopwatch, successful: true); + + // Do the forward lookup to get the IPs for that host name + stopwatch = NameResolutionTelemetry.Log.BeforeResolution(name); } - // Do the forward lookup to get the IPs for that host name - errorCode = NameResolutionPal.TryGetAddrInfo(name!, justAddresses, out string? hostName, out string[] aliases, out IPAddress[] addresses, out nativeErrorCode); + object result; + try + { + errorCode = NameResolutionPal.TryGetAddrInfo(name, justAddresses, out string? hostName, out string[] aliases, out IPAddress[] addresses, out int nativeErrorCode); + + if (errorCode != SocketError.Success) + { + if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(address, $"forward lookup for '{name}' failed with {errorCode}"); + } - if (errorCode != SocketError.Success) + result = justAddresses ? + (object)addresses : + new IPHostEntry + { + HostName = hostName!, + Aliases = aliases, + AddressList = addresses + }; + } + catch when (LogFailure(stopwatch)) { - if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(address, $"forward lookup for '{name}' failed with {errorCode}"); + Debug.Fail("LogFailure should return false"); + throw; } + if (NameResolutionTelemetry.Log.IsEnabled()) + NameResolutionTelemetry.Log.AfterResolution(stopwatch, successful: true); + // One of three things happened: // 1. Success. // 2. There was a ptr record in dns, but not a corollary A/AAA record. @@ -349,15 +421,7 @@ private static object GetHostEntryOrAddressesCore(IPAddress address, bool justAd // - Workaround, Check "Use this connection's dns suffix in dns registration" on that network // adapter's advanced dns settings. // Return whatever we got. - - return justAddresses ? - (object)addresses : - new IPHostEntry - { - HostName = hostName!, - Aliases = aliases, - AddressList = addresses - }; + return result; } private static Task GetHostEntryCoreAsync(string hostName, bool justReturnParsedIp, bool throwOnIIPAny) => @@ -399,7 +463,42 @@ private static Task GetHostEntryOrAddressesCoreAsync(string hostName, bool justR if (NameResolutionPal.SupportsGetAddrInfoAsync && ipAddress is null) { ValidateHostName(hostName); - return NameResolutionPal.GetAddrInfoAsync(hostName, justAddresses); + + if (NameResolutionTelemetry.Log.IsEnabled()) + { + ValueStopwatch stopwatch = NameResolutionTelemetry.Log.BeforeResolution(hostName); + + Task coreTask; + try + { + coreTask = NameResolutionPal.GetAddrInfoAsync(hostName, justAddresses); + } + catch when (LogFailure(stopwatch)) + { + Debug.Fail("LogFailure should return false"); + throw; + } + + coreTask.ContinueWith( + (task, state) => + { + NameResolutionTelemetry.Log.AfterResolution( + stopwatch: (ValueStopwatch)state!, + successful: task.IsCompletedSuccessfully); + }, + state: stopwatch, + cancellationToken: default, + TaskContinuationOptions.ExecuteSynchronously, + TaskScheduler.Default); + + // coreTask is not actually a base Task, but Task / Task + // We have to return it and not the continuation + return coreTask; + } + else + { + return NameResolutionPal.GetAddrInfoAsync(hostName, justAddresses); + } } return justAddresses ? (Task) @@ -429,5 +528,14 @@ private static void ValidateHostName(string hostName) SR.Format(SR.net_toolong, nameof(hostName), MaxHostName.ToString(NumberFormatInfo.CurrentInfo))); } } + + + private static bool LogFailure(ValueStopwatch stopwatch) + { + if (NameResolutionTelemetry.Log.IsEnabled()) + NameResolutionTelemetry.Log.AfterResolution(stopwatch, successful: false); + + return false; + } } } diff --git a/src/libraries/System.Net.NameResolution/src/System/Net/NameResolutionTelemetry.cs b/src/libraries/System.Net.NameResolution/src/System/Net/NameResolutionTelemetry.cs new file mode 100644 index 000000000000..c216dcbf96db --- /dev/null +++ b/src/libraries/System.Net.NameResolution/src/System/Net/NameResolutionTelemetry.cs @@ -0,0 +1,156 @@ +// 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.Diagnostics; +using System.Diagnostics.Tracing; +using System.Runtime.InteropServices; +using System.Threading; +using Microsoft.Extensions.Internal; + +namespace System.Net +{ + [EventSource(Name = "System.Net.NameResolution")] + internal sealed class NameResolutionTelemetry : EventSource + { + public static readonly NameResolutionTelemetry Log = new NameResolutionTelemetry(); + + private const int ResolutionStartEventId = 1; + private const int ResolutionStopEventId = 2; + private const int ResolutionFailedEventId = 3; + + private PollingCounter? _lookupsRequestedCounter; + private EventCounter? _lookupsDuration; + + private long _lookupsRequested; + + protected override void OnEventCommand(EventCommandEventArgs command) + { + if (command.Command == EventCommand.Enable) + { + // The cumulative number of name resolution requests started since events were enabled + _lookupsRequestedCounter ??= new PollingCounter("dns-lookups-requested", this, () => Interlocked.Read(ref _lookupsRequested)) + { + DisplayName = "DNS Lookups Requested" + }; + + _lookupsDuration ??= new EventCounter("dns-lookups-duration", this) + { + DisplayName = "Average DNS Lookup Duration", + DisplayUnits = "ms" + }; + } + } + + + private const int MaxIPFormattedLength = 128; + + [Event(ResolutionStartEventId, Level = EventLevel.Informational)] + private void ResolutionStart(string hostNameOrAddress) => WriteEvent(ResolutionStartEventId, hostNameOrAddress); + + [Event(ResolutionStopEventId, Level = EventLevel.Informational)] + private void ResolutionStop() => WriteEvent(ResolutionStopEventId); + + [Event(ResolutionFailedEventId, Level = EventLevel.Informational)] + private void ResolutionFailed() => WriteEvent(ResolutionFailedEventId); + + + [NonEvent] + public ValueStopwatch BeforeResolution(string hostNameOrAddress) + { + Debug.Assert(hostNameOrAddress != null); + + if (IsEnabled()) + { + Interlocked.Increment(ref _lookupsRequested); + + if (IsEnabled(EventLevel.Informational, EventKeywords.None)) + { + ResolutionStart(hostNameOrAddress); + } + + return ValueStopwatch.StartNew(); + } + + return default; + } + + [NonEvent] + public ValueStopwatch BeforeResolution(IPAddress address) + { + Debug.Assert(address != null); + + if (IsEnabled()) + { + Interlocked.Increment(ref _lookupsRequested); + + if (IsEnabled(EventLevel.Informational, EventKeywords.None)) + { + WriteEvent(ResolutionStartEventId, FormatIPAddressNullTerminated(address, stackalloc char[MaxIPFormattedLength])); + } + + return ValueStopwatch.StartNew(); + } + + return default; + } + + [NonEvent] + public void AfterResolution(ValueStopwatch stopwatch, bool successful) + { + if (stopwatch.IsActive) + { + _lookupsDuration!.WriteMetric(stopwatch.GetElapsedTime().TotalMilliseconds); + + if (IsEnabled(EventLevel.Informational, EventKeywords.None)) + { + if (!successful) + { + ResolutionFailed(); + } + + ResolutionStop(); + } + } + } + + + [NonEvent] + private static Span FormatIPAddressNullTerminated(IPAddress address, Span destination) + { + Debug.Assert(address != null); + + bool success = address.TryFormat(destination, out int charsWritten); + Debug.Assert(success); + + Debug.Assert(charsWritten < destination.Length); + destination[charsWritten] = '\0'; + + return destination.Slice(0, charsWritten + 1); + } + + + // WriteEvent overloads taking Span are imitating string arguments + // Span arguments are expected to be null-terminated + + [NonEvent] + private unsafe void WriteEvent(int eventId, Span arg1) + { + Debug.Assert(!arg1.IsEmpty && arg1.IndexOf('\0') == arg1.Length - 1, "Expecting a null-terminated ROS"); + + if (IsEnabled()) + { + fixed (char* arg1Ptr = &MemoryMarshal.GetReference(arg1)) + { + EventData descr = new EventData + { + DataPointer = (IntPtr)(arg1Ptr), + Size = arg1.Length * sizeof(char) + }; + + WriteEventCore(eventId, eventDataCount: 1, &descr); + } + } + } + } +} diff --git a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/AssemblyInfo.cs b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/AssemblyInfo.cs new file mode 100644 index 000000000000..cb9635c54427 --- /dev/null +++ b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Xunit; + +[assembly: SkipOnMono("System.Net.NameResolution is not supported on wasm.", TestPlatforms.Browser)] diff --git a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/System.Net.NameResolution.Functional.Tests.csproj b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/System.Net.NameResolution.Functional.Tests.csproj index 047766b57b87..c9984c4fc86b 100644 --- a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/System.Net.NameResolution.Functional.Tests.csproj +++ b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/System.Net.NameResolution.Functional.Tests.csproj @@ -1,8 +1,11 @@ $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser + true + true + @@ -10,6 +13,7 @@ + - \ No newline at end of file + diff --git a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/TelemetryTest.cs b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/TelemetryTest.cs new file mode 100644 index 000000000000..739ae3c39e06 --- /dev/null +++ b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/TelemetryTest.cs @@ -0,0 +1,145 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Concurrent; +using System.Diagnostics.Tracing; +using System.Linq; +using System.Net.Sockets; +using Microsoft.DotNet.RemoteExecutor; +using Xunit; + +namespace System.Net.NameResolution.Tests +{ + public class TelemetryTest + { + [Fact] + public static void EventSource_ExistsWithCorrectId() + { + Type esType = typeof(Dns).Assembly.GetType("System.Net.NameResolutionTelemetry", throwOnError: true, ignoreCase: false); + Assert.NotNull(esType); + + Assert.Equal("System.Net.NameResolution", EventSource.GetName(esType)); + Assert.Equal(Guid.Parse("4b326142-bfb5-5ed3-8585-7714181d14b0"), EventSource.GetGuid(esType)); + + Assert.NotEmpty(EventSource.GenerateManifest(esType, esType.Assembly.Location)); + } + + [OuterLoop] + [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] + public static void EventSource_ResolveValidHostName_LogsStartStop() + { + RemoteExecutor.Invoke(async () => + { + const string ValidHostName = "microsoft.com"; + + using var listener = new TestEventListener("System.Net.NameResolution", EventLevel.Informational); + + var events = new ConcurrentQueue(); + await listener.RunWithCallbackAsync(events.Enqueue, async () => + { + await Dns.GetHostEntryAsync(ValidHostName); + await Dns.GetHostAddressesAsync(ValidHostName); + + Dns.GetHostEntry(ValidHostName); + Dns.GetHostAddresses(ValidHostName); + + Dns.EndGetHostEntry(Dns.BeginGetHostEntry(ValidHostName, null, null)); + Dns.EndGetHostAddresses(Dns.BeginGetHostAddresses(ValidHostName, null, null)); + }); + + Assert.DoesNotContain(events, e => e.EventId == 0); // errors from the EventSource itself + + Assert.True(events.Count >= 2 * 6); + + EventWrittenEventArgs[] starts = events.Where(e => e.EventName == "ResolutionStart").ToArray(); + Assert.Equal(6, starts.Length); + Assert.All(starts, s => Assert.Equal(ValidHostName, Assert.Single(s.Payload).ToString())); + + EventWrittenEventArgs[] stops = events.Where(e => e.EventName == "ResolutionStop").ToArray(); + Assert.Equal(6, stops.Length); + + Assert.DoesNotContain(events, e => e.EventName == "ResolutionFailed"); + }).Dispose(); + } + + [OuterLoop] + [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] + public static void EventSource_ResolveInvalidHostName_LogsStartFailureStop() + { + RemoteExecutor.Invoke(async () => + { + const string InvalidHostName = "invalid...example.com"; + + using var listener = new TestEventListener("System.Net.NameResolution", EventLevel.Informational); + + var events = new ConcurrentQueue(); + await listener.RunWithCallbackAsync(events.Enqueue, async () => + { + await Assert.ThrowsAnyAsync(async () => await Dns.GetHostEntryAsync(InvalidHostName)); + await Assert.ThrowsAnyAsync(async () => await Dns.GetHostAddressesAsync(InvalidHostName)); + + Assert.ThrowsAny(() => Dns.GetHostEntry(InvalidHostName)); + Assert.ThrowsAny(() => Dns.GetHostAddresses(InvalidHostName)); + + Assert.ThrowsAny(() => Dns.EndGetHostEntry(Dns.BeginGetHostEntry(InvalidHostName, null, null))); + Assert.ThrowsAny(() => Dns.EndGetHostAddresses(Dns.BeginGetHostAddresses(InvalidHostName, null, null))); + }); + + Assert.DoesNotContain(events, e => e.EventId == 0); // errors from the EventSource itself + + Assert.True(events.Count >= 3 * 6); + + EventWrittenEventArgs[] starts = events.Where(e => e.EventName == "ResolutionStart").ToArray(); + Assert.Equal(6, starts.Length); + Assert.All(starts, s => Assert.Equal(InvalidHostName, Assert.Single(s.Payload).ToString())); + + EventWrittenEventArgs[] failures = events.Where(e => e.EventName == "ResolutionFailed").ToArray(); + Assert.Equal(6, failures.Length); + + EventWrittenEventArgs[] stops = events.Where(e => e.EventName == "ResolutionStop").ToArray(); + Assert.Equal(6, stops.Length); + }).Dispose(); + } + + [OuterLoop] + [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] + public static void EventSource_GetHostEntryForIP_LogsStartStop() + { + RemoteExecutor.Invoke(async () => + { + const string ValidIPAddress = "8.8.4.4"; + + using var listener = new TestEventListener("System.Net.NameResolution", EventLevel.Informational); + + var events = new ConcurrentQueue(); + await listener.RunWithCallbackAsync(events.Enqueue, async () => + { + IPAddress ipAddress = IPAddress.Parse(ValidIPAddress); + + await Dns.GetHostEntryAsync(ValidIPAddress); + await Dns.GetHostEntryAsync(ipAddress); + + Dns.GetHostEntry(ValidIPAddress); + Dns.GetHostEntry(ipAddress); + + Dns.EndGetHostEntry(Dns.BeginGetHostEntry(ValidIPAddress, null, null)); + Dns.EndGetHostEntry(Dns.BeginGetHostEntry(ipAddress, null, null)); + }); + + Assert.DoesNotContain(events, e => e.EventId == 0); // errors from the EventSource itself + + // Each GetHostEntry over an IP will yield 2 resolutions + Assert.True(events.Count >= 2 * 2 * 6); + + EventWrittenEventArgs[] starts = events.Where(e => e.EventName == "ResolutionStart").ToArray(); + Assert.Equal(12, starts.Length); + Assert.Equal(6, starts.Count(s => Assert.Single(s.Payload).ToString() == ValidIPAddress)); + + EventWrittenEventArgs[] stops = events.Where(e => e.EventName == "ResolutionStop").ToArray(); + Assert.Equal(12, stops.Length); + + Assert.DoesNotContain(events, e => e.EventName == "ResolutionFailed"); + }).Dispose(); + } + } +} diff --git a/src/libraries/System.Net.NameResolution/tests/PalTests/AssemblyInfo.cs b/src/libraries/System.Net.NameResolution/tests/PalTests/AssemblyInfo.cs new file mode 100644 index 000000000000..cb9635c54427 --- /dev/null +++ b/src/libraries/System.Net.NameResolution/tests/PalTests/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Xunit; + +[assembly: SkipOnMono("System.Net.NameResolution is not supported on wasm.", TestPlatforms.Browser)] diff --git a/src/libraries/System.Net.NameResolution/tests/PalTests/System.Net.NameResolution.Pal.Tests.csproj b/src/libraries/System.Net.NameResolution/tests/PalTests/System.Net.NameResolution.Pal.Tests.csproj index 3866d420e968..66a902b68b37 100644 --- a/src/libraries/System.Net.NameResolution/tests/PalTests/System.Net.NameResolution.Pal.Tests.csproj +++ b/src/libraries/System.Net.NameResolution/tests/PalTests/System.Net.NameResolution.Pal.Tests.csproj @@ -4,6 +4,7 @@ ../../src/Resources/Strings.resx $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser annotations + true @@ -13,6 +14,7 @@ + diff --git a/src/libraries/System.Net.NameResolution/tests/UnitTests/AssemblyInfo.cs b/src/libraries/System.Net.NameResolution/tests/UnitTests/AssemblyInfo.cs new file mode 100644 index 000000000000..cb9635c54427 --- /dev/null +++ b/src/libraries/System.Net.NameResolution/tests/UnitTests/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Xunit; + +[assembly: SkipOnMono("System.Net.NameResolution is not supported on wasm.", TestPlatforms.Browser)] diff --git a/src/libraries/System.Net.NameResolution/tests/UnitTests/Fakes/FakeNameResolutionTelemetry.cs b/src/libraries/System.Net.NameResolution/tests/UnitTests/Fakes/FakeNameResolutionTelemetry.cs new file mode 100644 index 000000000000..cd409cbc602d --- /dev/null +++ b/src/libraries/System.Net.NameResolution/tests/UnitTests/Fakes/FakeNameResolutionTelemetry.cs @@ -0,0 +1,21 @@ +// 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 Microsoft.Extensions.Internal; + +namespace System.Net +{ + internal class NameResolutionTelemetry + { + public static NameResolutionTelemetry Log => new NameResolutionTelemetry(); + + public bool IsEnabled() => false; + + public ValueStopwatch BeforeResolution(string hostNameOrAddress) => default; + + public ValueStopwatch BeforeResolution(IPAddress address) => default; + + public void AfterResolution(ValueStopwatch stopwatch, bool successful) { } + } +} diff --git a/src/libraries/System.Net.NameResolution/tests/UnitTests/System.Net.NameResolution.Unit.Tests.csproj b/src/libraries/System.Net.NameResolution/tests/UnitTests/System.Net.NameResolution.Unit.Tests.csproj index 5c8f469df3e6..7e3f969094b8 100644 --- a/src/libraries/System.Net.NameResolution/tests/UnitTests/System.Net.NameResolution.Unit.Tests.csproj +++ b/src/libraries/System.Net.NameResolution/tests/UnitTests/System.Net.NameResolution.Unit.Tests.csproj @@ -6,6 +6,7 @@ 0436 $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser annotations + true @@ -18,6 +19,7 @@ Link="ProductionCode\System\Net\Dns.cs" /> + @@ -27,6 +29,7 @@ + @@ -38,5 +41,7 @@ Link="Common\System\Net\InternalException.cs" /> + \ No newline at end of file diff --git a/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs b/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs index 79ea6f693ee6..bce36a86ce62 100644 --- a/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs +++ b/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs @@ -257,8 +257,8 @@ public IPAddress(System.ReadOnlySpan address, long scopeid) { } public static System.Net.IPAddress Parse(string ipString) { throw null; } public override string ToString() { throw null; } public bool TryFormat(System.Span destination, out int charsWritten) { throw null; } - public static bool TryParse(System.ReadOnlySpan ipString, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Net.IPAddress? address) { throw null; } - public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? ipString, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Net.IPAddress? address) { throw null; } + public static bool TryParse(System.ReadOnlySpan ipString, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Net.IPAddress? address) { throw null; } + public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? ipString, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Net.IPAddress? address) { throw null; } public bool TryWriteBytes(System.Span destination, out int bytesWritten) { throw null; } } public partial class IPEndPoint : System.Net.EndPoint @@ -277,8 +277,8 @@ public IPEndPoint(System.Net.IPAddress address, int port) { } public static System.Net.IPEndPoint Parse(string s) { throw null; } public override System.Net.SocketAddress Serialize() { throw null; } public override string ToString() { throw null; } - public static bool TryParse(System.ReadOnlySpan s, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Net.IPEndPoint result) { throw null; } - public static bool TryParse(string s, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Net.IPEndPoint? result) { throw null; } + public static bool TryParse(System.ReadOnlySpan s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Net.IPEndPoint result) { throw null; } + public static bool TryParse(string s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Net.IPEndPoint? result) { throw null; } } public partial interface IWebProxy { diff --git a/src/libraries/System.Net.Requests/ref/System.Net.Requests.cs b/src/libraries/System.Net.Requests/ref/System.Net.Requests.cs index 9b220cfb486d..fcd291d8d742 100644 --- a/src/libraries/System.Net.Requests/ref/System.Net.Requests.cs +++ b/src/libraries/System.Net.Requests/ref/System.Net.Requests.cs @@ -162,7 +162,7 @@ public override void Close() { } public partial class GlobalProxySelection { public GlobalProxySelection() { } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public static System.Net.IWebProxy Select { get { throw null; } set { } } public static System.Net.IWebProxy GetEmptyWebProxy() { throw null; } } @@ -240,8 +240,8 @@ void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Ser } public partial class HttpWebResponse : System.Net.WebResponse, System.Runtime.Serialization.ISerializable { - [System.Obsolete("This API supports the .NET infrastructure and is not intended to be used directly from your code.", true)] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("This API supports the .NET infrastructure and is not intended to be used directly from your code.", true)] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public HttpWebResponse() { } [System.ObsoleteAttribute("Serialization is obsoleted for this type. https://go.microsoft.com/fwlink/?linkid=14202")] protected HttpWebResponse(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) { } diff --git a/src/libraries/System.Net.Security/ref/System.Net.Security.cs b/src/libraries/System.Net.Security/ref/System.Net.Security.cs index 0369a60af9c7..3ef7ad8ab16f 100644 --- a/src/libraries/System.Net.Security/ref/System.Net.Security.cs +++ b/src/libraries/System.Net.Security/ref/System.Net.Security.cs @@ -104,8 +104,15 @@ public enum ProtectionLevel Sign = 1, EncryptAndSign = 2, } + public readonly struct SslClientHelloInfo + { + public string ServerName { get; } + public System.Security.Authentication.SslProtocols SslProtocols { get; } + internal SslClientHelloInfo(string serverName, System.Security.Authentication.SslProtocols sslProtocol) { throw null; } + } public delegate bool RemoteCertificateValidationCallback(object sender, System.Security.Cryptography.X509Certificates.X509Certificate? certificate, System.Security.Cryptography.X509Certificates.X509Chain? chain, System.Net.Security.SslPolicyErrors sslPolicyErrors); public delegate System.Security.Cryptography.X509Certificates.X509Certificate ServerCertificateSelectionCallback(object sender, string? hostName); + public delegate System.Threading.Tasks.ValueTask ServerOptionsSelectionCallback(SslStream stream, SslClientHelloInfo clientHelloInfo, object? state, System.Threading.CancellationToken cancellationToken); public readonly partial struct SslApplicationProtocol : System.IEquatable { private readonly object _dummy; @@ -236,6 +243,7 @@ public void Write(byte[] buffer) { } public override void Write(byte[] buffer, int offset, int count) { } public override System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; } public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public System.Threading.Tasks.Task AuthenticateAsServerAsync(ServerOptionsSelectionCallback optionsCallback, object? state, System.Threading.CancellationToken cancellationToken = default) { throw null; } } [System.CLSCompliantAttribute(false)] public enum TlsCipherSuite : ushort diff --git a/src/libraries/System.Net.Security/src/Resources/Strings.resx b/src/libraries/System.Net.Security/src/Resources/Strings.resx index 8af05ebe134c..1270f6bb3be8 100644 --- a/src/libraries/System.Net.Security/src/Resources/Strings.resx +++ b/src/libraries/System.Net.Security/src/Resources/Strings.resx @@ -443,4 +443,7 @@ CipherSuitesPolicy is not supported on this platform. + + System.Net.Security is not supported on this platform. + diff --git a/src/libraries/System.Net.Security/src/System.Net.Security.csproj b/src/libraries/System.Net.Security/src/System.Net.Security.csproj index e0edf84a0faa..1c423af89c5e 100644 --- a/src/libraries/System.Net.Security/src/System.Net.Security.csproj +++ b/src/libraries/System.Net.Security/src/System.Net.Security.csproj @@ -7,10 +7,13 @@ $(DefineConstants);PRODUCT enable + + SR.SystemNetSecurity_PlatformNotSupported + $(DefineConstants);SYSNETSECURITY_NO_OPENSSL - + @@ -23,6 +26,7 @@ + @@ -85,7 +89,7 @@ - + True True @@ -93,7 +97,7 @@ - + True True @@ -146,6 +150,8 @@ + + - + - + @@ -357,7 +365,7 @@ - + diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Linux.cs b/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Linux.cs index f99e078fced8..0cbeb85dbd33 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Linux.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Linux.cs @@ -14,9 +14,6 @@ namespace System.Net.Security { internal class CipherSuitesPolicyPal { - private static readonly byte[] RequireEncryptionDefault = - Encoding.ASCII.GetBytes("DEFAULT\0"); - private static readonly byte[] AllowNoEncryptionDefault = Encoding.ASCII.GetBytes("ALL:eNULL\0"); @@ -171,12 +168,12 @@ internal static bool WantsTls13(SslProtocols protocols) return policy.Pal._tls13CipherSuites; } - private static byte[] CipherListFromEncryptionPolicy(EncryptionPolicy policy) + private static byte[]? CipherListFromEncryptionPolicy(EncryptionPolicy policy) { switch (policy) { case EncryptionPolicy.RequireEncryption: - return RequireEncryptionDefault; + return null; case EncryptionPolicy.AllowNoEncryption: return AllowNoEncryptionDefault; case EncryptionPolicy.NoEncryption: diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslAuthenticationOptions.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslAuthenticationOptions.cs index 311346fab0f5..e229ddd0e72e 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslAuthenticationOptions.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslAuthenticationOptions.cs @@ -80,6 +80,36 @@ internal SslAuthenticationOptions(SslServerAuthenticationOptions sslServerAuthen } } + internal SslAuthenticationOptions(ServerOptionsSelectionCallback optionCallback, object? state) + { + CheckCertName = false; + TargetHost = string.Empty; + IsServer = true; + UserState = state; + ServerOptionDelegate = optionCallback; + } + + internal void UpdateOptions(SslServerAuthenticationOptions sslServerAuthenticationOptions) + { + AllowRenegotiation = sslServerAuthenticationOptions.AllowRenegotiation; + ApplicationProtocols = sslServerAuthenticationOptions.ApplicationProtocols; + EnabledSslProtocols = FilterOutIncompatibleSslProtocols(sslServerAuthenticationOptions.EnabledSslProtocols); + EncryptionPolicy = sslServerAuthenticationOptions.EncryptionPolicy; + RemoteCertRequired = sslServerAuthenticationOptions.ClientCertificateRequired; + CipherSuitesPolicy = sslServerAuthenticationOptions.CipherSuitesPolicy; + CertificateRevocationCheckMode = sslServerAuthenticationOptions.CertificateRevocationCheckMode; + if (sslServerAuthenticationOptions.ServerCertificateContext != null) + { + CertificateContext = sslServerAuthenticationOptions.ServerCertificateContext; + } + else if (sslServerAuthenticationOptions.ServerCertificate is X509Certificate2 certificateWithKey && + certificateWithKey.HasPrivateKey) + { + // given cert is X509Certificate2 with key. We can use it directly. + CertificateContext = SslStreamCertificateContext.Create(certificateWithKey); + } + } + private static SslProtocols FilterOutIncompatibleSslProtocols(SslProtocols protocols) { if (protocols.HasFlag(SslProtocols.Tls12) || protocols.HasFlag(SslProtocols.Tls13)) @@ -98,7 +128,7 @@ private static SslProtocols FilterOutIncompatibleSslProtocols(SslProtocols proto internal bool AllowRenegotiation { get; set; } internal string TargetHost { get; set; } internal X509CertificateCollection? ClientCertificates { get; set; } - internal List? ApplicationProtocols { get; } + internal List? ApplicationProtocols { get; set; } internal bool IsServer { get; set; } internal SslStreamCertificateContext? CertificateContext { get; set; } internal SslProtocols EnabledSslProtocols { get; set; } @@ -110,5 +140,7 @@ private static SslProtocols FilterOutIncompatibleSslProtocols(SslProtocols proto internal LocalCertSelectionCallback? CertSelectionDelegate { get; set; } internal ServerCertSelectionCallback? ServerCertSelectionDelegate { get; set; } internal CipherSuitesPolicy? CipherSuitesPolicy { get; set; } + internal object? UserState { get; } + internal ServerOptionsSelectionCallback? ServerOptionDelegate { get; } } } diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslClientHelloInfo.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslClientHelloInfo.cs new file mode 100644 index 000000000000..16a19935c206 --- /dev/null +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslClientHelloInfo.cs @@ -0,0 +1,23 @@ +// 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.Security.Authentication; + +namespace System.Net.Security +{ + /// + /// This struct contains information from received TLS Client Hello frame. + /// + public readonly struct SslClientHelloInfo + { + public readonly string ServerName { get; } + public readonly SslProtocols SslProtocols { get; } + + internal SslClientHelloInfo(string serverName, SslProtocols sslProtocols) + { + ServerName = serverName; + SslProtocols = sslProtocols; + } + } +} diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs index 95644169dd15..afda3eb1de5e 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs @@ -35,7 +35,7 @@ private enum Framing private TlsFrameHelper.TlsFrameInfo _lastFrame; - private readonly object _handshakeLock = new object(); + private object _handshakeLock => _sslAuthenticationOptions!; private volatile TaskCompletionSource? _handshakeWaiter; private const int FrameOverhead = 32; @@ -403,9 +403,9 @@ private async ValueTask ReceiveBlobAsync(TIOAdapter a } else if (_lastFrame.Header.Type == TlsContentType.Handshake) { - if ((_handshakeBuffer.ActiveReadOnlySpan[TlsFrameHelper.HeaderSize] == (byte)TlsHandshakeType.ClientHello && - _sslAuthenticationOptions!.ServerCertSelectionDelegate != null) || - NetEventSource.Log.IsEnabled()) + if (_handshakeBuffer.ActiveReadOnlySpan[TlsFrameHelper.HeaderSize] == (byte)TlsHandshakeType.ClientHello && + (_sslAuthenticationOptions!.ServerCertSelectionDelegate != null || + _sslAuthenticationOptions!.ServerOptionDelegate != null)) { TlsFrameHelper.ProcessingOptions options = NetEventSource.Log.IsEnabled() ? TlsFrameHelper.ProcessingOptions.All : @@ -421,6 +421,14 @@ private async ValueTask ReceiveBlobAsync(TIOAdapter a { // SNI if it exist. Even if we could not parse the hello, we can fall-back to default certificate. _sslAuthenticationOptions!.TargetHost = _lastFrame.TargetName; + + if (_sslAuthenticationOptions.ServerOptionDelegate != null) + { + SslServerAuthenticationOptions userOptions = + await _sslAuthenticationOptions.ServerOptionDelegate(this, new SslClientHelloInfo(_lastFrame.TargetName, _lastFrame.SupportedVersions), + _sslAuthenticationOptions.UserState, adapter.CancellationToken).ConfigureAwait(false); + _sslAuthenticationOptions.UpdateOptions(userOptions); + } } if (NetEventSource.Log.IsEnabled()) diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.cs index e4817767dc2a..523935e3533b 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.cs @@ -34,6 +34,8 @@ public enum EncryptionPolicy public delegate X509Certificate ServerCertificateSelectionCallback(object sender, string? hostName); + public delegate ValueTask ServerOptionsSelectionCallback(SslStream stream, SslClientHelloInfo clientHelloInfo, object? state, CancellationToken cancellationToken); + // Internal versions of the above delegates. internal delegate bool RemoteCertValidationCallback(string? host, X509Certificate2? certificate, X509Chain? chain, SslPolicyErrors sslPolicyErrors); internal delegate X509Certificate LocalCertSelectionCallback(string targetHost, X509CertificateCollection localCertificates, X509Certificate2? remoteCertificate, string[] acceptableIssuers); @@ -453,6 +455,12 @@ private Task AuthenticateAsServerApm(SslServerAuthenticationOptions sslServerAut return ProcessAuthentication(true, true, cancellationToken)!; } + public Task AuthenticateAsServerAsync(ServerOptionsSelectionCallback optionsCallback, object? state, CancellationToken cancellationToken = default) + { + ValidateCreateContext(new SslAuthenticationOptions(optionsCallback, state)); + return ProcessAuthentication(isAsync: true, isApm: false, cancellationToken)!; + } + public virtual Task ShutdownAsync() { ThrowIfExceptionalOrNotAuthenticatedOrShutdown(); diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslStreamPal.Windows.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslStreamPal.Windows.cs index 673af8175916..1056c21ec711 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslStreamPal.Windows.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslStreamPal.Windows.cs @@ -15,6 +15,11 @@ namespace System.Net.Security { internal static class SslStreamPal { + private static readonly bool UseNewCryptoApi = + // On newer Windows version we use new API to get TLS1.3. + // API is supported since Windows 10 1809 (17763) but there is no reason to use at the moment. + Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build >= 18836; + private const string SecurityPackage = "Microsoft Unified Security Protocol Provider"; private const Interop.SspiCli.ContextFlags RequiredFlags = @@ -106,6 +111,16 @@ public static SecurityStatusPal InitializeSecurityContext(ref SafeFreeCredential } public static SafeFreeCredentials AcquireCredentialsHandle(X509Certificate? certificate, SslProtocols protocols, EncryptionPolicy policy, bool isServer) + { + // New crypto API supports TLS1.3 but it does not allow to force NULL encryption. + return !UseNewCryptoApi || policy == EncryptionPolicy.NoEncryption ? + AcquireCredentialsHandleSchannelCred(certificate, protocols, policy, isServer) : + AcquireCredentialsHandleSchCredentials(certificate, protocols, policy, isServer); + } + + // This is legacy crypto API used on .NET Framework and older Windows versions. + // It only supports TLS up to 1.2 + public static SafeFreeCredentials AcquireCredentialsHandleSchannelCred(X509Certificate? certificate, SslProtocols protocols, EncryptionPolicy policy, bool isServer) { int protocolFlags = GetProtocolFlagsFromSslProtocols(protocols, isServer); Interop.SspiCli.SCHANNEL_CRED.Flags flags; @@ -144,6 +159,72 @@ public static SafeFreeCredentials AcquireCredentialsHandle(X509Certificate? cert return AcquireCredentialsHandle(direction, secureCredential); } + // This function uses new crypto API to support TLS 1.3 and beyond. + public static unsafe SafeFreeCredentials AcquireCredentialsHandleSchCredentials(X509Certificate? certificate, SslProtocols protocols, EncryptionPolicy policy, bool isServer) + { + int protocolFlags = GetProtocolFlagsFromSslProtocols(protocols, isServer); + Interop.SspiCli.SCH_CREDENTIALS.Flags flags; + Interop.SspiCli.CredentialUse direction; + + if (isServer) + { + direction = Interop.SspiCli.CredentialUse.SECPKG_CRED_INBOUND; + flags = Interop.SspiCli.SCH_CREDENTIALS.Flags.SCH_SEND_AUX_RECORD; + } + else + { + direction = Interop.SspiCli.CredentialUse.SECPKG_CRED_OUTBOUND; + flags = + Interop.SspiCli.SCH_CREDENTIALS.Flags.SCH_CRED_MANUAL_CRED_VALIDATION | + Interop.SspiCli.SCH_CREDENTIALS.Flags.SCH_CRED_NO_DEFAULT_CREDS | + Interop.SspiCli.SCH_CREDENTIALS.Flags.SCH_SEND_AUX_RECORD; + } + + if (policy == EncryptionPolicy.RequireEncryption) + { + // Always opt-in SCH_USE_STRONG_CRYPTO for TLS. + if (!isServer && ((protocolFlags & Interop.SChannel.SP_PROT_SSL3) == 0)) + { + flags |= Interop.SspiCli.SCH_CREDENTIALS.Flags.SCH_USE_STRONG_CRYPTO; + } + } + else if (policy == EncryptionPolicy.AllowNoEncryption) + { + // Allow null encryption cipher in addition to other ciphers. + flags |= Interop.SspiCli.SCH_CREDENTIALS.Flags.SCH_ALLOW_NULL_ENCRYPTION; + } + else + { + throw new ArgumentException(SR.Format(SR.net_invalid_enum, "EncryptionPolicy"), nameof(policy)); + } + + Interop.SspiCli.SCH_CREDENTIALS credential = default; + credential.dwVersion = Interop.SspiCli.SCH_CREDENTIALS.CurrentVersion; + credential.dwFlags = flags; + + IntPtr certificateHandle = IntPtr.Zero; + if (certificate != null) + { + credential.cCreds = 1; + certificateHandle = certificate.Handle; + credential.paCred = &certificateHandle; + } + + if (NetEventSource.IsEnabled) NetEventSource.Info($"flags=({flags}), ProtocolFlags=({protocolFlags}), EncryptionPolicy={policy}"); + + if (protocolFlags != 0) + { + // If we were asked to do specific protocol we need to fill TLS_PARAMETERS. + Interop.SspiCli.TLS_PARAMETERS tlsParameters = default; + tlsParameters.grbitDisabledProtocols = (uint)protocolFlags ^ uint.MaxValue; + + credential.cTlsParameters = 1; + credential.pTlsParameters = &tlsParameters; + } + + return AcquireCredentialsHandle(direction, &credential); + } + internal static byte[]? GetNegotiatedApplicationProtocol(SafeDeleteContext context) { Interop.SecPkgContext_ApplicationProtocol alpnContext = default; @@ -436,5 +517,26 @@ private static SafeFreeCredentials AcquireCredentialsHandle(Interop.SspiCli.Cred return SSPIWrapper.AcquireCredentialsHandle(GlobalSSPI.SSPISecureChannel, SecurityPackage, credUsage, secureCredential); } } + + private static unsafe SafeFreeCredentials AcquireCredentialsHandle(Interop.SspiCli.CredentialUse credUsage, Interop.SspiCli.SCH_CREDENTIALS* secureCredential) + { + // First try without impersonation, if it fails, then try the process account. + // I.E. We don't know which account the certificate context was created under. + try + { + // + // For app-compat we want to ensure the credential are accessed under >>process<< account. + // + return WindowsIdentity.RunImpersonated(SafeAccessTokenHandle.InvalidHandle, () => + { + return SSPIWrapper.AcquireCredentialsHandle(GlobalSSPI.SSPISecureChannel, SecurityPackage, credUsage, secureCredential); + }); + } + catch + { + return SSPIWrapper.AcquireCredentialsHandle(GlobalSSPI.SSPISecureChannel, SecurityPackage, credUsage, secureCredential); + } + } + } } diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/AssemblyInfo.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/AssemblyInfo.cs index 54c8a4d926e5..4b859917fd8c 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/AssemblyInfo.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/AssemblyInfo.cs @@ -4,3 +4,4 @@ using Xunit; [assembly: ActiveIssue("https://github.com/dotnet/runtime/issues/34690", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] +[assembly: SkipOnMono("System.Net.Security is not supported on Browser", TestPlatforms.Browser)] \ No newline at end of file diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs index 3425fd4f7a0f..1518cfc3fa54 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs @@ -7,6 +7,7 @@ using System.Net.Test.Common; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; +using System.Threading; using System.Threading.Tasks; using Xunit; @@ -22,6 +23,8 @@ public class ServerAsyncAuthenticateTest : IDisposable private readonly ITestOutputHelper _logVerbose; private readonly X509Certificate2 _serverCertificate; + public static bool IsNotWindows7 => !PlatformDetection.IsWindows7; + public ServerAsyncAuthenticateTest(ITestOutputHelper output) { _log = output; @@ -69,6 +72,159 @@ public async Task ServerAsyncAuthenticate_AllClientVsIndividualServerSupportedPr await ServerAsyncSslHelper(SslProtocolSupport.SupportedSslProtocols, serverProtocol); } + [Fact] + public async Task ServerAsyncAuthenticate_SimpleSniOptions_Success() + { + var state = new object(); + var serverOptions = new SslServerAuthenticationOptions() { ServerCertificate = _serverCertificate }; + var clientOptions = new SslClientAuthenticationOptions() { TargetHost = _serverCertificate.GetNameInfo(X509NameType.SimpleName, false) }; + clientOptions.RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true; + + (SslStream client, SslStream server) = TestHelper.GetConnectedSslStreams(); + using (client) + using (server) + { + Task t1 = client.AuthenticateAsClientAsync(clientOptions, CancellationToken.None); + Task t2 = server.AuthenticateAsServerAsync( + (stream, clientHelloInfo, userState, cancellationToken) => + { + Assert.Equal(server, stream); + Assert.Equal(clientOptions.TargetHost, clientHelloInfo.ServerName); + Assert.True(object.ReferenceEquals(state, userState)); + return new ValueTask(serverOptions); + }, + state, CancellationToken.None); + + await TestConfiguration.WhenAllOrAnyFailedWithTimeout(t1, t2); + } + } + + [ConditionalTheory(nameof(IsNotWindows7))] + [InlineData(SslProtocols.Tls11)] + [InlineData(SslProtocols.Tls12)] + public async Task ServerAsyncAuthenticate_SniSetVersion_Success(SslProtocols version) + { + var serverOptions = new SslServerAuthenticationOptions() { ServerCertificate = _serverCertificate, EnabledSslProtocols = version }; + var clientOptions = new SslClientAuthenticationOptions() { TargetHost = _serverCertificate.GetNameInfo(X509NameType.SimpleName, forIssuer: false) }; + clientOptions.RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true; + + (SslStream client, SslStream server) = TestHelper.GetConnectedSslStreams(); + using (client) + using (server) + { + Task t1 = client.AuthenticateAsClientAsync(clientOptions, CancellationToken.None); + Task t2 = server.AuthenticateAsServerAsync( + (stream, clientHelloInfo, userState, cancellationToken) => + { + Assert.Equal(server, stream); + Assert.Equal(clientOptions.TargetHost, clientHelloInfo.ServerName); + return new ValueTask(serverOptions); + }, + null, CancellationToken.None); + + await TestConfiguration.WhenAllOrAnyFailedWithTimeout(t1, t2); + // Verify that the SNI callback can impact version. + Assert.Equal(version, client.SslProtocol); + } + } + + private async Task FailedTask() + { + await Task.Yield(); + throw new InvalidOperationException("foo"); + } + + private async Task OptionsTask(SslServerAuthenticationOptions value) + { + await Task.Yield(); + return value; + } + + [Fact] + public async Task ServerAsyncAuthenticate_AsyncOptions_Success() + { + var state = new object(); + var serverOptions = new SslServerAuthenticationOptions() { ServerCertificate = _serverCertificate }; + var clientOptions = new SslClientAuthenticationOptions() { TargetHost = _serverCertificate.GetNameInfo(X509NameType.SimpleName, false) }; + clientOptions.RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true; + + (SslStream client, SslStream server) = TestHelper.GetConnectedSslStreams(); + using (client) + using (server) + { + Task t1 = client.AuthenticateAsClientAsync(clientOptions, CancellationToken.None); + Task t2 = server.AuthenticateAsServerAsync( + (stream, clientHelloInfo, userState, cancellationToken) => + { + Assert.Equal(server, stream); + Assert.Equal(clientOptions.TargetHost, clientHelloInfo.ServerName); + Assert.True(object.ReferenceEquals(state, userState)); + return new ValueTask(OptionsTask(serverOptions)); + }, + state, CancellationToken.None); + + await TestConfiguration.WhenAllOrAnyFailedWithTimeout(t1, t2); + } + } + + [Theory] + [InlineData(true)] + [InlineData(false)] + public async Task ServerAsyncAuthenticate_FailingOptionCallback_Throws(bool useAsync) + { + var serverOptions = new SslServerAuthenticationOptions() { ServerCertificate = _serverCertificate }; + var clientOptions = new SslClientAuthenticationOptions() { TargetHost = _serverCertificate.GetNameInfo(X509NameType.SimpleName, false) }; + clientOptions.RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true; + + (SslStream client, SslStream server) = TestHelper.GetConnectedSslStreams(); + using (client) + using (server) + { + Task t1 = client.AuthenticateAsClientAsync(clientOptions, CancellationToken.None); + Task t2 = server.AuthenticateAsServerAsync( + (stream, clientHelloInfo, userState, cancellationToken) => + { + if (useAsync) + { + return new ValueTask(FailedTask()); + } + + throw new InvalidOperationException("foo"); + }, + null, CancellationToken.None); + await Assert.ThrowsAsync(() => t2); + } + } + + [Theory] + [InlineData(true)] + [InlineData(false)] + public async Task ServerAsyncAuthenticate_NoCertificate_Throws(bool useAsync) + { + var serverOptions = new SslServerAuthenticationOptions(); + var clientOptions = new SslClientAuthenticationOptions() { TargetHost = _serverCertificate.GetNameInfo(X509NameType.SimpleName, false) }; + clientOptions.RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true; + + (SslStream client, SslStream server) = TestHelper.GetConnectedSslStreams(); + using (client) + using (server) + { + Task t1 = client.AuthenticateAsClientAsync(clientOptions, CancellationToken.None); + Task t2 = server.AuthenticateAsServerAsync( + (stream, clientHelloInfo, userState, cancellationToken) => + { + if (useAsync) + { + return new ValueTask(serverOptions); + } + + return new ValueTask(OptionsTask(serverOptions)); + }, + null, CancellationToken.None); + await Assert.ThrowsAsync(() => t2); + } + } + public static IEnumerable ProtocolMismatchData() { if (PlatformDetection.SupportsSsl3) diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamAlertsTest.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamAlertsTest.cs index 3cb3f5c5363f..96f293c76852 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamAlertsTest.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamAlertsTest.cs @@ -87,13 +87,14 @@ public async Task SslStream_StreamToStream_ServerInitiatedCloseNotify_Ok() } } - [Fact] - public async Task SslStream_StreamToStream_ClientInitiatedCloseNotify_Ok() + [Theory] + [InlineData(false)] + [InlineData(true)] + public async Task SslStream_StreamToStream_ClientInitiatedCloseNotify_Ok(bool sendData) { - VirtualNetwork network = new VirtualNetwork(); - - using (var clientStream = new VirtualNetworkStream(network, isServer: false)) - using (var serverStream = new VirtualNetworkStream(network, isServer: true)) + (Stream clientStream, Stream serverStream) = TestHelper.GetConnectedStreams(); + using (clientStream) + using (serverStream) using (var client = new SslStream(clientStream, true, AllowAnyServerCertificate)) using (var server = new SslStream(serverStream)) using (X509Certificate2 certificate = Configuration.Certificates.GetServerCertificate()) @@ -105,13 +106,21 @@ public async Task SslStream_StreamToStream_ClientInitiatedCloseNotify_Ok() await Task.WhenAll(handshake).TimeoutAfter(TestConfiguration.PassingTestTimeoutMilliseconds); + var readBuffer = new byte[1024]; + if (sendData) + { + // Send some data before shutting down. This may matter for TLS13. + handshake[0] = server.WriteAsync(readBuffer, 0, 1); + handshake[1] = client.ReadAsync(readBuffer, 0, 1); + await Task.WhenAll(handshake).TimeoutAfter(TestConfiguration.PassingTestTimeoutMilliseconds); + } + await client.ShutdownAsync(); int bytesRead = await server.ReadAsync(readBuffer, 0, readBuffer.Length); // close_notify received by the server. Assert.Equal(0, bytesRead); - await server.ShutdownAsync(); bytesRead = await client.ReadAsync(readBuffer, 0, readBuffer.Length); // close_notify received by the client. diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj b/src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj index a1e3f33b84be..3845b272ae6a 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj @@ -4,9 +4,12 @@ true $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS annotations + true + + @@ -84,7 +87,7 @@ - + @@ -94,7 +97,7 @@ - + diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/TestHelper.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/TestHelper.cs index 9de961826713..4e9a9a8ea37a 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/TestHelper.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/TestHelper.cs @@ -29,10 +29,17 @@ public static class TestHelper private static readonly X509BasicConstraintsExtension s_eeConstraints = new X509BasicConstraintsExtension(false, false, 0, false); + public static (SslStream ClientStream, SslStream ServerStream) GetConnectedSslStreams() + { + (Stream clientStream, Stream serverStream) = GetConnectedStreams(); + return (new SslStream(clientStream), new SslStream(serverStream)); + } + public static (Stream ClientStream, Stream ServerStream) GetConnectedStreams() { if (Capability.SecurityForceSocketStreams()) { + // DOTNET_TEST_NET_SECURITY_FORCE_SOCKET_STREAMS is set. return GetConnectedTcpStreams(); } diff --git a/src/libraries/System.Net.Security/tests/UnitTests/AssemblyInfo.cs b/src/libraries/System.Net.Security/tests/UnitTests/AssemblyInfo.cs new file mode 100644 index 000000000000..766d39919ff4 --- /dev/null +++ b/src/libraries/System.Net.Security/tests/UnitTests/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Xunit; + +[assembly: SkipOnMono("System.Net.Security is not supported on Browser", TestPlatforms.Browser)] \ No newline at end of file diff --git a/src/libraries/System.Net.Security/tests/UnitTests/System.Net.Security.Unit.Tests.csproj b/src/libraries/System.Net.Security/tests/UnitTests/System.Net.Security.Unit.Tests.csproj index 2323a9323b51..8379fd48c479 100644 --- a/src/libraries/System.Net.Security/tests/UnitTests/System.Net.Security.Unit.Tests.csproj +++ b/src/libraries/System.Net.Security/tests/UnitTests/System.Net.Security.Unit.Tests.csproj @@ -12,8 +12,12 @@ $(NoWarn);3021 $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS annotations + true + + + @@ -30,7 +34,7 @@ - + diff --git a/src/libraries/System.Net.Sockets/Directory.Build.props b/src/libraries/System.Net.Sockets/Directory.Build.props index 465e1110d6b0..42c6eafce67e 100644 --- a/src/libraries/System.Net.Sockets/Directory.Build.props +++ b/src/libraries/System.Net.Sockets/Directory.Build.props @@ -3,5 +3,6 @@ Microsoft true + true \ No newline at end of file diff --git a/src/libraries/System.Net.Sockets/ref/System.Net.Sockets.cs b/src/libraries/System.Net.Sockets/ref/System.Net.Sockets.cs index 0a983f426ee3..0917f00c68e0 100644 --- a/src/libraries/System.Net.Sockets/ref/System.Net.Sockets.cs +++ b/src/libraries/System.Net.Sockets/ref/System.Net.Sockets.cs @@ -8,39 +8,70 @@ namespace System.Net.Sockets { public enum IOControlCode : long { + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] EnableCircularQueuing = (long)671088642, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] Flush = (long)671088644, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] AddressListChange = (long)671088663, DataToRead = (long)1074030207, OobDataRead = (long)1074033415, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] GetBroadcastAddress = (long)1207959557, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] AddressListQuery = (long)1207959574, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] QueryTargetPnpHandle = (long)1207959576, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] AsyncIO = (long)2147772029, NonBlockingIO = (long)2147772030, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] AssociateHandle = (long)2281701377, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] MultipointLoopback = (long)2281701385, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] MulticastScope = (long)2281701386, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] SetQos = (long)2281701387, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] SetGroupQos = (long)2281701388, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] RoutingInterfaceChange = (long)2281701397, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] NamespaceChange = (long)2281701401, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] ReceiveAll = (long)2550136833, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] ReceiveAllMulticast = (long)2550136834, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] ReceiveAllIgmpMulticast = (long)2550136835, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] KeepAliveValues = (long)2550136836, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] AbsorbRouterAlert = (long)2550136837, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] UnicastInterface = (long)2550136838, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] LimitBroadcasts = (long)2550136839, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] BindToInterface = (long)2550136840, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] MulticastInterface = (long)2550136841, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] AddMulticastGroupOnInterface = (long)2550136842, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] DeleteMulticastGroupFromInterface = (long)2550136843, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] GetExtensionFunctionPointer = (long)3355443206, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] GetQos = (long)3355443207, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] GetGroupQos = (long)3355443208, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] TranslateHandle = (long)3355443213, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] RoutingInterfaceQuery = (long)3355443220, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] AddressListSort = (long)3355443225, } public partial struct IPPacketInformation @@ -294,6 +325,7 @@ public void Disconnect(bool reuseSocket) { } public bool DisconnectAsync(System.Net.Sockets.SocketAsyncEventArgs e) { throw null; } public void Dispose() { } protected virtual void Dispose(bool disposing) { } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public System.Net.Sockets.SocketInformation DuplicateAndClose(int targetProcessId) { throw null; } public System.Net.Sockets.Socket EndAccept(out byte[]? buffer, System.IAsyncResult asyncResult) { throw null; } public System.Net.Sockets.Socket EndAccept(out byte[]? buffer, out int bytesTransferred, System.IAsyncResult asyncResult) { throw null; } @@ -358,6 +390,7 @@ public void SendFile(string? fileName, byte[]? preBuffer, byte[]? postBuffer, Sy public int SendTo(byte[] buffer, System.Net.EndPoint remoteEP) { throw null; } public int SendTo(byte[] buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEP) { throw null; } public bool SendToAsync(System.Net.Sockets.SocketAsyncEventArgs e) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public void SetIPProtectionLevel(System.Net.Sockets.IPProtectionLevel level) { } public void SetRawSocketOption(int optionLevel, int optionName, System.ReadOnlySpan optionValue) { } public void SetSocketOption(System.Net.Sockets.SocketOptionLevel optionLevel, System.Net.Sockets.SocketOptionName optionName, bool optionValue) { } @@ -592,6 +625,7 @@ public TcpListener(System.Net.IPEndPoint localEP) { } public System.Threading.Tasks.Task AcceptSocketAsync() { throw null; } public System.Net.Sockets.TcpClient AcceptTcpClient() { throw null; } public System.Threading.Tasks.Task AcceptTcpClientAsync() { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public void AllowNatTraversal(bool allowed) { } public System.IAsyncResult BeginAcceptSocket(System.AsyncCallback? callback, object? state) { throw null; } public System.IAsyncResult BeginAcceptTcpClient(System.AsyncCallback? callback, object? state) { throw null; } @@ -609,8 +643,11 @@ public enum TransmitFileOptions UseDefaultWorkerThread = 0, Disconnect = 1, ReuseSocket = 2, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] WriteBehind = 4, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] UseSystemThread = 16, + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] UseKernelApc = 32, } public partial class UdpClient : System.IDisposable @@ -629,6 +666,7 @@ public UdpClient(string hostname, int port) { } public bool ExclusiveAddressUse { get { throw null; } set { } } public bool MulticastLoopback { get { throw null; } set { } } public short Ttl { get { throw null; } set { } } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public void AllowNatTraversal(bool allowed) { } public System.IAsyncResult BeginReceive(System.AsyncCallback? requestCallback, object? state) { throw null; } public System.IAsyncResult BeginSend(byte[] datagram, int bytes, System.AsyncCallback? requestCallback, object? state) { throw null; } diff --git a/src/libraries/System.Net.Sockets/src/Resources/Strings.resx b/src/libraries/System.Net.Sockets/src/Resources/Strings.resx index 62f9bb2b41db..c2b2e397211b 100644 --- a/src/libraries/System.Net.Sockets/src/Resources/Strings.resx +++ b/src/libraries/System.Net.Sockets/src/Resources/Strings.resx @@ -262,4 +262,7 @@ Null is not a valid value for {0}. - \ No newline at end of file + + System.Net.Sockets is not supported on this platform. + + diff --git a/src/libraries/System.Net.Sockets/src/System.Net.Sockets.csproj b/src/libraries/System.Net.Sockets/src/System.Net.Sockets.csproj index 66c10683b872..211dd8a0eafd 100644 --- a/src/libraries/System.Net.Sockets/src/System.Net.Sockets.csproj +++ b/src/libraries/System.Net.Sockets/src/System.Net.Sockets.csproj @@ -5,15 +5,19 @@ $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser enable + + SR.Sockets_PlatformNotSupported + $(DefineConstants);SYSTEM_NET_SOCKETS_DLL - + + @@ -188,7 +192,7 @@ - + @@ -316,7 +320,7 @@ - + diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/IOControlCode.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/IOControlCode.cs index 7ba90cc6fd9e..fc1d69159bab 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/IOControlCode.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/IOControlCode.cs @@ -1,43 +1,76 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Runtime.Versioning; + namespace System.Net.Sockets { public enum IOControlCode : long { + [MinimumOSPlatform("windows7.0")] AsyncIO = 0x8004667D, NonBlockingIO = 0x8004667E, // fionbio DataToRead = 0x4004667F, // fionread OobDataRead = 0x40047307, + [MinimumOSPlatform("windows7.0")] AssociateHandle = 0x88000001, // SIO_ASSOCIATE_HANDLE + [MinimumOSPlatform("windows7.0")] EnableCircularQueuing = 0x28000002, + [MinimumOSPlatform("windows7.0")] Flush = 0x28000004, + [MinimumOSPlatform("windows7.0")] GetBroadcastAddress = 0x48000005, + [MinimumOSPlatform("windows7.0")] GetExtensionFunctionPointer = 0xC8000006, + [MinimumOSPlatform("windows7.0")] GetQos = 0xC8000007, + [MinimumOSPlatform("windows7.0")] GetGroupQos = 0xC8000008, + [MinimumOSPlatform("windows7.0")] MultipointLoopback = 0x88000009, + [MinimumOSPlatform("windows7.0")] MulticastScope = 0x8800000A, + [MinimumOSPlatform("windows7.0")] SetQos = 0x8800000B, + [MinimumOSPlatform("windows7.0")] SetGroupQos = 0x8800000C, + [MinimumOSPlatform("windows7.0")] TranslateHandle = 0xC800000D, + [MinimumOSPlatform("windows7.0")] RoutingInterfaceQuery = 0xC8000014, + [MinimumOSPlatform("windows7.0")] RoutingInterfaceChange = 0x88000015, + [MinimumOSPlatform("windows7.0")] AddressListQuery = 0x48000016, + [MinimumOSPlatform("windows7.0")] AddressListChange = 0x28000017, + [MinimumOSPlatform("windows7.0")] QueryTargetPnpHandle = 0x48000018, + [MinimumOSPlatform("windows7.0")] NamespaceChange = 0x88000019, + [MinimumOSPlatform("windows7.0")] AddressListSort = 0xC8000019, + [MinimumOSPlatform("windows7.0")] ReceiveAll = 0x98000001, + [MinimumOSPlatform("windows7.0")] ReceiveAllMulticast = 0x98000002, + [MinimumOSPlatform("windows7.0")] ReceiveAllIgmpMulticast = 0x98000003, + [MinimumOSPlatform("windows7.0")] KeepAliveValues = 0x98000004, + [MinimumOSPlatform("windows7.0")] AbsorbRouterAlert = 0x98000005, + [MinimumOSPlatform("windows7.0")] UnicastInterface = 0x98000006, + [MinimumOSPlatform("windows7.0")] LimitBroadcasts = 0x98000007, + [MinimumOSPlatform("windows7.0")] BindToInterface = 0x98000008, + [MinimumOSPlatform("windows7.0")] MulticastInterface = 0x98000009, + [MinimumOSPlatform("windows7.0")] AddMulticastGroupOnInterface = 0x9800000A, + [MinimumOSPlatform("windows7.0")] DeleteMulticastGroupFromInterface = 0x9800000B } } diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs index 76e57389eb53..7e995116b877 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Buffers; using System.Collections.Generic; using System.Diagnostics; using System.IO; @@ -14,60 +13,32 @@ namespace System.Net.Sockets { - // The Task-based APIs are currently wrappers over either the APM APIs (e.g. BeginConnect) - // or the SocketAsyncEventArgs APIs (e.g. ReceiveAsync(SocketAsyncEventArgs)). The latter - // are much more efficient when the SocketAsyncEventArg instances can be reused; as such, - // at present we use them for ReceiveAsync and SendAsync, caching an instance for each. - // In the future we could potentially maintain a global cache of instances used for accepts - // and connects, and potentially separate per-socket instances for Receive{Message}FromAsync, - // which would need different instances from ReceiveAsync due to having different results - // and thus different Completed logic. We also currently fall back to APM implementations - // when the single cached instance for each of send/receive is otherwise in use; we could - // potentially also employ a global pool from which to pull in such situations. - public partial class Socket { - /// Handler for completed AcceptAsync operations. - private static readonly EventHandler AcceptCompletedHandler = (s, e) => CompleteAccept((Socket)s!, (TaskSocketAsyncEventArgs)e); - /// Handler for completed ReceiveAsync operations. - private static readonly EventHandler ReceiveCompletedHandler = (s, e) => CompleteSendReceive((Socket)s!, (Int32TaskSocketAsyncEventArgs)e, isReceive: true); - /// Handler for completed SendAsync operations. - private static readonly EventHandler SendCompletedHandler = (s, e) => CompleteSendReceive((Socket)s!, (Int32TaskSocketAsyncEventArgs)e, isReceive: false); - /// - /// Sentinel that can be stored into one of the Socket cached fields to indicate that an instance - /// was previously created but is currently being used by another concurrent operation. - /// - private static readonly TaskSocketAsyncEventArgs s_rentedSocketSentinel = new TaskSocketAsyncEventArgs(); - /// - /// Sentinel that can be stored into one of the Int32 fields to indicate that an instance - /// was previously created but is currently being used by another concurrent operation. - /// - private static readonly Int32TaskSocketAsyncEventArgs s_rentedInt32Sentinel = new Int32TaskSocketAsyncEventArgs(); /// Cached task with a 0 value. private static readonly Task s_zeroTask = Task.FromResult(0); - /// Cached event args used with Task-based async operations. - private CachedEventArgs? _cachedTaskEventArgs; + /// Cached instance for accept operations. + private TaskSocketAsyncEventArgs? _acceptEventArgs; + + /// Cached instance for receive operations that return . Also used for ConnectAsync operations. + private AwaitableSocketAsyncEventArgs? _singleBufferReceiveEventArgs; + /// Cached instance for send operations that return . + private AwaitableSocketAsyncEventArgs? _singleBufferSendEventArgs; - private CachedEventArgs EventArgs => LazyInitializer.EnsureInitialized(ref _cachedTaskEventArgs, () => new CachedEventArgs()); + /// Cached instance for receive operations that return . + private TaskSocketAsyncEventArgs? _multiBufferReceiveEventArgs; + /// Cached instance for send operations that return . + private TaskSocketAsyncEventArgs? _multiBufferSendEventArgs; internal Task AcceptAsync(Socket? acceptSocket) { // Get any cached SocketAsyncEventArg we may have. - TaskSocketAsyncEventArgs? saea = Interlocked.Exchange(ref EventArgs.TaskAccept, s_rentedSocketSentinel); - if (saea == s_rentedSocketSentinel) + TaskSocketAsyncEventArgs? saea = Interlocked.Exchange(ref _acceptEventArgs, null); + if (saea is null) { - // An instance was once created (or is currently being created elsewhere), but some other - // concurrent operation is using it. Since we can store at most one, and since an individual - // APM operation is less expensive than creating a new SAEA and using it only once, we simply - // fall back to using an APM implementation. - return AcceptAsyncApm(acceptSocket); - } - else if (saea == null) - { - // No instance has been created yet, so create one. saea = new TaskSocketAsyncEventArgs(); - saea.Completed += AcceptCompletedHandler; + saea.Completed += (s, e) => CompleteAccept((Socket)s!, (TaskSocketAsyncEventArgs)e); } // Configure the SAEA. @@ -103,36 +74,18 @@ internal Task AcceptAsync(Socket? acceptSocket) return t; } - /// Implements Task-returning AcceptAsync on top of Begin/EndAsync. - private Task AcceptAsyncApm(Socket? acceptSocket) - { - var tcs = new TaskCompletionSource(this); - BeginAccept(acceptSocket, 0, iar => - { - var innerTcs = (TaskCompletionSource)iar.AsyncState!; - try { innerTcs.TrySetResult(((Socket)innerTcs.Task.AsyncState!).EndAccept(iar)); } - catch (Exception e) { innerTcs.TrySetException(e); } - }, tcs); - return tcs.Task; - } - internal Task ConnectAsync(EndPoint remoteEP) { - // Use ValueTaskReceive so the AwaitableSocketAsyncEventArgs can be re-used later. - AwaitableSocketAsyncEventArgs saea = LazyInitializer.EnsureInitialized(ref EventArgs.ValueTaskReceive, () => new AwaitableSocketAsyncEventArgs()); - - if (!saea.Reserve()) - { - saea = new AwaitableSocketAsyncEventArgs(); - saea.Reserve(); - } + // Use _singleBufferReceiveEventArgs so the AwaitableSocketAsyncEventArgs can be re-used later for receives. + AwaitableSocketAsyncEventArgs saea = + Interlocked.Exchange(ref _singleBufferReceiveEventArgs, null) ?? + new AwaitableSocketAsyncEventArgs(this, isReceiveForCaching: true); saea.RemoteEndPoint = remoteEP; return saea.ConnectAsync(this).AsTask(); } - internal Task ConnectAsync(IPAddress address, int port) - => ConnectAsync(new IPEndPoint(address, port)); + internal Task ConnectAsync(IPAddress address, int port) => ConnectAsync(new IPEndPoint(address, port)); internal Task ConnectAsync(IPAddress[] addresses, int port) { @@ -163,6 +116,7 @@ private async Task DoConnectAsync(IPAddress[] addresses, int port) lastException = ex; } } + Debug.Assert(lastException != null); ExceptionDispatchInfo.Throw(lastException); } @@ -174,20 +128,16 @@ internal Task ConnectAsync(string host, int port) throw new ArgumentNullException(nameof(host)); } - if (IPAddress.TryParse(host, out IPAddress? parsedAddress)) - { - return ConnectAsync(new IPEndPoint(parsedAddress, port)); - } - else - { - return ConnectAsync(new DnsEndPoint(host, port)); - } + EndPoint ep = IPAddress.TryParse(host, out IPAddress? parsedAddress) ? (EndPoint) + new IPEndPoint(parsedAddress, port) : + new DnsEndPoint(host, port); + return ConnectAsync(ep); } internal Task ReceiveAsync(ArraySegment buffer, SocketFlags socketFlags, bool fromNetworkStream) { ValidateBuffer(buffer); - return ReceiveAsync((Memory)buffer, socketFlags, fromNetworkStream, default).AsTask(); + return ReceiveAsync(buffer, socketFlags, fromNetworkStream, default).AsTask(); } internal ValueTask ReceiveAsync(Memory buffer, SocketFlags socketFlags, bool fromNetworkStream, CancellationToken cancellationToken) @@ -197,97 +147,31 @@ internal ValueTask ReceiveAsync(Memory buffer, SocketFlags socketFlag return ValueTask.FromCanceled(cancellationToken); } - AwaitableSocketAsyncEventArgs saea = LazyInitializer.EnsureInitialized(ref EventArgs.ValueTaskReceive, () => new AwaitableSocketAsyncEventArgs()); - if (saea.Reserve()) - { - Debug.Assert(saea.BufferList == null); - saea.SetBuffer(buffer); - saea.SocketFlags = socketFlags; - saea.WrapExceptionsInIOExceptions = fromNetworkStream; - return saea.ReceiveAsync(this, cancellationToken); - } - else - { - // We couldn't get a cached instance, due to a concurrent receive operation on the socket. - // Fall back to wrapping APM. - return new ValueTask(ReceiveAsyncApm(buffer, socketFlags)); - } - } + AwaitableSocketAsyncEventArgs saea = + Interlocked.Exchange(ref _singleBufferReceiveEventArgs, null) ?? + new AwaitableSocketAsyncEventArgs(this, isReceiveForCaching: true); - /// Implements Task-returning ReceiveAsync on top of Begin/EndReceive. - private Task ReceiveAsyncApm(Memory buffer, SocketFlags socketFlags) - { - if (MemoryMarshal.TryGetArray(buffer, out ArraySegment bufferArray)) - { - // We were able to extract the underlying byte[] from the Memory. Use it. - var tcs = new TaskCompletionSource(this); - BeginReceive(bufferArray.Array!, bufferArray.Offset, bufferArray.Count, socketFlags, iar => - { - var innerTcs = (TaskCompletionSource)iar.AsyncState!; - try { innerTcs.TrySetResult(((Socket)innerTcs.Task.AsyncState!).EndReceive(iar)); } - catch (Exception e) { innerTcs.TrySetException(e); } - }, tcs); - return tcs.Task; - } - else - { - // We weren't able to extract an underlying byte[] from the Memory. - // Instead read into an ArrayPool array, then copy from that into the memory. - byte[] poolArray = ArrayPool.Shared.Rent(buffer.Length); - var tcs = new TaskCompletionSource(this); - BeginReceive(poolArray, 0, buffer.Length, socketFlags, iar => - { - var state = (Tuple, Memory, byte[]>)iar.AsyncState!; - try - { - int bytesCopied = ((Socket)state.Item1.Task.AsyncState!).EndReceive(iar); - new ReadOnlyMemory(state.Item3, 0, bytesCopied).Span.CopyTo(state.Item2.Span); - state.Item1.TrySetResult(bytesCopied); - } - catch (Exception e) - { - state.Item1.TrySetException(e); - } - finally - { - ArrayPool.Shared.Return(state.Item3); - } - }, Tuple.Create(tcs, buffer, poolArray)); - return tcs.Task; - } + Debug.Assert(saea.BufferList == null); + saea.SetBuffer(buffer); + saea.SocketFlags = socketFlags; + saea.WrapExceptionsInIOExceptions = fromNetworkStream; + return saea.ReceiveAsync(this, cancellationToken); } internal Task ReceiveAsync(IList> buffers, SocketFlags socketFlags) { - // Validate the arguments. ValidateBuffersList(buffers); - Int32TaskSocketAsyncEventArgs? saea = RentSocketAsyncEventArgs(isReceive: true); - if (saea != null) + TaskSocketAsyncEventArgs? saea = Interlocked.Exchange(ref _multiBufferReceiveEventArgs, null); + if (saea is null) { - // We got a cached instance. Configure the buffer list and initate the operation. - ConfigureBufferList(saea, buffers, socketFlags); - return GetTaskForSendReceive(ReceiveAsync(saea), saea, fromNetworkStream: false, isReceive: true); + saea = new TaskSocketAsyncEventArgs(); + saea.Completed += (s, e) => CompleteSendReceive((Socket)s!, (TaskSocketAsyncEventArgs)e, isReceive: true); } - else - { - // We couldn't get a cached instance, due to a concurrent receive operation on the socket. - // Fall back to wrapping APM. - return ReceiveAsyncApm(buffers, socketFlags); - } - } - /// Implements Task-returning ReceiveAsync on top of Begin/EndReceive. - private Task ReceiveAsyncApm(IList> buffers, SocketFlags socketFlags) - { - var tcs = new TaskCompletionSource(this); - BeginReceive(buffers, socketFlags, iar => - { - var innerTcs = (TaskCompletionSource)iar.AsyncState!; - try { innerTcs.TrySetResult(((Socket)innerTcs.Task.AsyncState!).EndReceive(iar)); } - catch (Exception e) { innerTcs.TrySetException(e); } - }, tcs); - return tcs.Task; + saea.BufferList = buffers; + saea.SocketFlags = socketFlags; + return GetTaskForSendReceive(ReceiveAsync(saea), saea, fromNetworkStream: false, isReceive: true); } internal Task ReceiveFromAsync(ArraySegment buffer, SocketFlags socketFlags, EndPoint remoteEndPoint) @@ -336,7 +220,7 @@ internal Task ReceiveMessageFromAsync(ArraySegme internal Task SendAsync(ArraySegment buffer, SocketFlags socketFlags) { ValidateBuffer(buffer); - return SendAsync((ReadOnlyMemory)buffer, socketFlags, default).AsTask(); + return SendAsync(buffer, socketFlags, default).AsTask(); } internal ValueTask SendAsync(ReadOnlyMemory buffer, SocketFlags socketFlags, CancellationToken cancellationToken) @@ -346,21 +230,15 @@ internal ValueTask SendAsync(ReadOnlyMemory buffer, SocketFlags socke return ValueTask.FromCanceled(cancellationToken); } - AwaitableSocketAsyncEventArgs saea = LazyInitializer.EnsureInitialized(ref EventArgs.ValueTaskSend, () => new AwaitableSocketAsyncEventArgs()); - if (saea.Reserve()) - { - Debug.Assert(saea.BufferList == null); - saea.SetBuffer(MemoryMarshal.AsMemory(buffer)); - saea.SocketFlags = socketFlags; - saea.WrapExceptionsInIOExceptions = false; - return saea.SendAsync(this, cancellationToken); - } - else - { - // We couldn't get a cached instance, due to a concurrent send operation on the socket. - // Fall back to wrapping APM. - return new ValueTask(SendAsyncApm(buffer, socketFlags)); - } + AwaitableSocketAsyncEventArgs saea = + Interlocked.Exchange(ref _singleBufferSendEventArgs, null) ?? + new AwaitableSocketAsyncEventArgs(this, isReceiveForCaching: false); + + Debug.Assert(saea.BufferList == null); + saea.SetBuffer(MemoryMarshal.AsMemory(buffer)); + saea.SocketFlags = socketFlags; + saea.WrapExceptionsInIOExceptions = false; + return saea.SendAsync(this, cancellationToken); } internal ValueTask SendAsyncForNetworkStream(ReadOnlyMemory buffer, SocketFlags socketFlags, CancellationToken cancellationToken) @@ -370,95 +248,31 @@ internal ValueTask SendAsyncForNetworkStream(ReadOnlyMemory buffer, Socket return ValueTask.FromCanceled(cancellationToken); } - AwaitableSocketAsyncEventArgs saea = LazyInitializer.EnsureInitialized(ref EventArgs.ValueTaskSend, () => new AwaitableSocketAsyncEventArgs()); - if (saea.Reserve()) - { - Debug.Assert(saea.BufferList == null); - saea.SetBuffer(MemoryMarshal.AsMemory(buffer)); - saea.SocketFlags = socketFlags; - saea.WrapExceptionsInIOExceptions = true; - return saea.SendAsyncForNetworkStream(this, cancellationToken); - } - else - { - // We couldn't get a cached instance, due to a concurrent send operation on the socket. - // Fall back to wrapping APM. - return new ValueTask(SendAsyncApm(buffer, socketFlags)); - } - } + AwaitableSocketAsyncEventArgs saea = + Interlocked.Exchange(ref _singleBufferSendEventArgs, null) ?? + new AwaitableSocketAsyncEventArgs(this, isReceiveForCaching: false); - /// Implements Task-returning SendAsync on top of Begin/EndSend. - private Task SendAsyncApm(ReadOnlyMemory buffer, SocketFlags socketFlags) - { - if (MemoryMarshal.TryGetArray(buffer, out ArraySegment bufferArray)) - { - var tcs = new TaskCompletionSource(this); - BeginSend(bufferArray.Array!, bufferArray.Offset, bufferArray.Count, socketFlags, iar => - { - var innerTcs = (TaskCompletionSource)iar.AsyncState!; - try { innerTcs.TrySetResult(((Socket)innerTcs.Task.AsyncState!).EndSend(iar)); } - catch (Exception e) { innerTcs.TrySetException(e); } - }, tcs); - return tcs.Task; - } - else - { - // We weren't able to extract an underlying byte[] from the Memory. - // Instead read into an ArrayPool array, then copy from that into the memory. - byte[] poolArray = ArrayPool.Shared.Rent(buffer.Length); - buffer.Span.CopyTo(poolArray); - var tcs = new TaskCompletionSource(this); - BeginSend(poolArray, 0, buffer.Length, socketFlags, iar => - { - var state = (Tuple, byte[]>)iar.AsyncState!; - try - { - state.Item1.TrySetResult(((Socket)state.Item1.Task.AsyncState!).EndSend(iar)); - } - catch (Exception e) - { - state.Item1.TrySetException(e); - } - finally - { - ArrayPool.Shared.Return(state.Item2); - } - }, Tuple.Create(tcs, poolArray)); - return tcs.Task; - } + Debug.Assert(saea.BufferList == null); + saea.SetBuffer(MemoryMarshal.AsMemory(buffer)); + saea.SocketFlags = socketFlags; + saea.WrapExceptionsInIOExceptions = true; + return saea.SendAsyncForNetworkStream(this, cancellationToken); } internal Task SendAsync(IList> buffers, SocketFlags socketFlags) { - // Validate the arguments. ValidateBuffersList(buffers); - Int32TaskSocketAsyncEventArgs? saea = RentSocketAsyncEventArgs(isReceive: false); - if (saea != null) - { - // We got a cached instance. Configure the buffer list and initate the operation. - ConfigureBufferList(saea, buffers, socketFlags); - return GetTaskForSendReceive(SendAsync(saea), saea, fromNetworkStream: false, isReceive: false); - } - else + TaskSocketAsyncEventArgs? saea = Interlocked.Exchange(ref _multiBufferSendEventArgs, null); + if (saea is null) { - // We couldn't get a cached instance, due to a concurrent send operation on the socket. - // Fall back to wrapping APM. - return SendAsyncApm(buffers, socketFlags); + saea = new TaskSocketAsyncEventArgs(); + saea.Completed += (s, e) => CompleteSendReceive((Socket)s!, (TaskSocketAsyncEventArgs)e, isReceive: false); } - } - /// Implements Task-returning SendAsync on top of Begin/EndSend. - private Task SendAsyncApm(IList> buffers, SocketFlags socketFlags) - { - var tcs = new TaskCompletionSource(this); - BeginSend(buffers, socketFlags, iar => - { - var innerTcs = (TaskCompletionSource)iar.AsyncState!; - try { innerTcs.TrySetResult(((Socket)innerTcs.Task.AsyncState!).EndSend(iar)); } - catch (Exception e) { innerTcs.TrySetException(e); } - }, tcs); - return tcs.Task; + saea.BufferList = buffers; + saea.SocketFlags = socketFlags; + return GetTaskForSendReceive(SendAsync(saea), saea, fromNetworkStream: false, isReceive: false); } internal Task SendToAsync(ArraySegment buffer, SocketFlags socketFlags, EndPoint remoteEP) @@ -480,11 +294,11 @@ private static void ValidateBuffer(ArraySegment buffer) { throw new ArgumentNullException(nameof(buffer.Array)); } - if (buffer.Offset < 0 || buffer.Offset > buffer.Array.Length) + if ((uint)buffer.Offset > buffer.Array.Length) { throw new ArgumentOutOfRangeException(nameof(buffer.Offset)); } - if (buffer.Count < 0 || buffer.Count > buffer.Array.Length - buffer.Offset) + if ((uint)buffer.Count > buffer.Array.Length - buffer.Offset) { throw new ArgumentOutOfRangeException(nameof(buffer.Count)); } @@ -503,18 +317,6 @@ private static void ValidateBuffersList(IList> buffers) } } - private static void ConfigureBufferList( - Int32TaskSocketAsyncEventArgs saea, IList> buffers, SocketFlags socketFlags) - { - // Configure the buffer list. We don't clear the buffers when returning the SAEA to the pool, - // so as to minimize overhead if the same buffers are used for subsequent operations (which is likely). - // But SAEA doesn't support having both a buffer and a buffer list configured, so clear out a buffer - // if there is one before we set the desired buffer list. - if (!saea.MemoryBuffer.Equals(default)) saea.SetBuffer(default); - saea.BufferList = buffers; - saea.SocketFlags = socketFlags; - } - /// Gets a task to represent the operation. /// true if the operation completes asynchronously; false if it completed synchronously. /// The event args instance used with the operation. @@ -523,9 +325,7 @@ private static void ConfigureBufferList( /// exceptions and cached tasks; otherwise, false. /// /// true if this is a receive; false if this is a send. - private Task GetTaskForSendReceive( - bool pending, Int32TaskSocketAsyncEventArgs saea, - bool fromNetworkStream, bool isReceive) + private Task GetTaskForSendReceive(bool pending, TaskSocketAsyncEventArgs saea, bool fromNetworkStream, bool isReceive) { Task t; @@ -605,7 +405,7 @@ private static void CompleteAccept(Socket s, TaskSocketAsyncEventArgs sa } /// Completes the SocketAsyncEventArg's Task with the result of the send or receive, and returns it to the specified pool. - private static void CompleteSendReceive(Socket s, Int32TaskSocketAsyncEventArgs saea, bool isReceive) + private static void CompleteSendReceive(Socket s, TaskSocketAsyncEventArgs saea, bool isReceive) { // Pull the relevant state off of the SAEA SocketError error = saea.SocketError; @@ -642,129 +442,72 @@ private static Exception GetException(SocketError error, bool wrapExceptionsInIO e; } - /// Rents a for immediate use. - /// true if this instance will be used for a receive; false if for sends. - private Int32TaskSocketAsyncEventArgs? RentSocketAsyncEventArgs(bool isReceive) - { - // Get any cached SocketAsyncEventArg we may have. - CachedEventArgs cea = EventArgs; - Int32TaskSocketAsyncEventArgs? saea = isReceive ? - Interlocked.Exchange(ref cea.TaskReceive, s_rentedInt32Sentinel) : - Interlocked.Exchange(ref cea.TaskSend, s_rentedInt32Sentinel); - - if (saea == s_rentedInt32Sentinel) - { - // An instance was once created (or is currently being created elsewhere), but some other - // concurrent operation is using it. Since we can store at most one, and since an individual - // APM operation is less expensive than creating a new SAEA and using it only once, we simply - // return null, for a caller to fall back to using an APM implementation. - return null; - } - - if (saea == null) - { - // No instance has been created yet, so create one. - saea = new Int32TaskSocketAsyncEventArgs(); - saea.Completed += isReceive ? ReceiveCompletedHandler : SendCompletedHandler; - } - - return saea; - } - - /// Returns a instance for reuse. + /// Returns a instance for reuse. /// The instance to return. /// true if this instance is used for receives; false if used for sends. - private void ReturnSocketAsyncEventArgs(Int32TaskSocketAsyncEventArgs saea, bool isReceive) + private void ReturnSocketAsyncEventArgs(TaskSocketAsyncEventArgs saea, bool isReceive) { - Debug.Assert(_cachedTaskEventArgs != null, "Should have been initialized when renting"); - Debug.Assert(saea != s_rentedInt32Sentinel); - // Reset state on the SAEA before returning it. But do not reset buffer state. That'll be done // if necessary by the consumer, but we want to keep the buffers due to likely subsequent reuse // and the costs associated with changing them. saea._accessed = false; - saea._builder = default(AsyncTaskMethodBuilder); + saea._builder = default; saea._wrapExceptionsInIOExceptions = false; - // Write this instance back as a cached instance. It should only ever be overwriting the sentinel, - // never null or another instance. - if (isReceive) - { - Debug.Assert(_cachedTaskEventArgs.TaskReceive == s_rentedInt32Sentinel); - Volatile.Write(ref _cachedTaskEventArgs.TaskReceive, saea); - } - else + // Write this instance back as a cached instance, only if there isn't currently one cached. + ref TaskSocketAsyncEventArgs? cache = ref isReceive ? ref _multiBufferReceiveEventArgs : ref _multiBufferSendEventArgs; + if (Interlocked.CompareExchange(ref cache, saea, null) != null) { - Debug.Assert(_cachedTaskEventArgs.TaskSend == s_rentedInt32Sentinel); - Volatile.Write(ref _cachedTaskEventArgs.TaskSend, saea); + saea.Dispose(); } } - /// Returns a instance for reuse. + /// Returns a instance for reuse. /// The instance to return. private void ReturnSocketAsyncEventArgs(TaskSocketAsyncEventArgs saea) { - Debug.Assert(_cachedTaskEventArgs != null, "Should have been initialized when renting"); - Debug.Assert(saea != s_rentedSocketSentinel); - // Reset state on the SAEA before returning it. But do not reset buffer state. That'll be done // if necessary by the consumer, but we want to keep the buffers due to likely subsequent reuse // and the costs associated with changing them. saea.AcceptSocket = null; saea._accessed = false; - saea._builder = default(AsyncTaskMethodBuilder); + saea._builder = default; - // Write this instance back as a cached instance. It should only ever be overwriting the sentinel, - // never null or another instance. - Debug.Assert(_cachedTaskEventArgs.TaskAccept == s_rentedSocketSentinel); - Volatile.Write(ref _cachedTaskEventArgs.TaskAccept, saea); + // Write this instance back as a cached instance, only if there isn't currently one cached. + if (Interlocked.CompareExchange(ref _acceptEventArgs, saea, null) != null) + { + // Couldn't return it, so dispose it. + saea.Dispose(); + } } - /// Dispose of any cached instances. + /// Dispose of any cached instances. private void DisposeCachedTaskSocketAsyncEventArgs() { - CachedEventArgs? cea = _cachedTaskEventArgs; - if (cea != null) - { - Interlocked.Exchange(ref cea.TaskAccept, s_rentedSocketSentinel)?.Dispose(); - Interlocked.Exchange(ref cea.TaskReceive, s_rentedInt32Sentinel)?.Dispose(); - Interlocked.Exchange(ref cea.TaskSend, s_rentedInt32Sentinel)?.Dispose(); - Interlocked.Exchange(ref cea.ValueTaskReceive, AwaitableSocketAsyncEventArgs.Reserved)?.Dispose(); - Interlocked.Exchange(ref cea.ValueTaskSend, AwaitableSocketAsyncEventArgs.Reserved)?.Dispose(); - } + Interlocked.Exchange(ref _acceptEventArgs, null)?.Dispose(); + Interlocked.Exchange(ref _multiBufferReceiveEventArgs, null)?.Dispose(); + Interlocked.Exchange(ref _multiBufferSendEventArgs, null)?.Dispose(); + Interlocked.Exchange(ref _singleBufferReceiveEventArgs, null)?.Dispose(); + Interlocked.Exchange(ref _singleBufferSendEventArgs, null)?.Dispose(); } /// A TaskCompletionSource that carries an extra field of strongly-typed state. - private class StateTaskCompletionSource : TaskCompletionSource + private sealed class StateTaskCompletionSource : TaskCompletionSource { internal TField1 _field1 = default!; // always set on construction public StateTaskCompletionSource(object baseState) : base(baseState) { } } /// A TaskCompletionSource that carries several extra fields of strongly-typed state. - private class StateTaskCompletionSource : StateTaskCompletionSource + private sealed class StateTaskCompletionSource : TaskCompletionSource { + internal TField1 _field1 = default!; // always set on construction internal TField2 _field2 = default!; // always set on construction public StateTaskCompletionSource(object baseState) : base(baseState) { } } - /// Cached event args used with Task-based async operations. - private sealed class CachedEventArgs - { - /// Cached instance for accept operations. - public TaskSocketAsyncEventArgs? TaskAccept; - /// Cached instance for receive operations that return . - public Int32TaskSocketAsyncEventArgs? TaskReceive; - /// Cached instance for send operations that return . - public Int32TaskSocketAsyncEventArgs? TaskSend; - /// Cached instance for receive operations that return . - public AwaitableSocketAsyncEventArgs? ValueTaskReceive; - /// Cached instance for send operations that return . - public AwaitableSocketAsyncEventArgs? ValueTaskSend; - } - /// A SocketAsyncEventArgs with an associated async method builder. - private class TaskSocketAsyncEventArgs : SocketAsyncEventArgs + private sealed class TaskSocketAsyncEventArgs : SocketAsyncEventArgs { /// /// The builder used to create the Task representing the result of the async operation. @@ -780,6 +523,8 @@ private class TaskSocketAsyncEventArgs : SocketAsyncEventArgs /// accesses this second, so we track whether it's already been accessed. /// internal bool _accessed; + /// Whether exceptions that emerge should be wrapped in IOExceptions. + internal bool _wrapExceptionsInIOExceptions; internal TaskSocketAsyncEventArgs() : base(unsafeSuppressExecutionContextFlow: true) // avoid flowing context at lower layers as we only expose Task, which handles it @@ -799,29 +544,19 @@ internal AsyncTaskMethodBuilder GetCompletionResponsibility(out bool re } } - /// A SocketAsyncEventArgs with an associated async method builder. - private sealed class Int32TaskSocketAsyncEventArgs : TaskSocketAsyncEventArgs - { - /// Whether exceptions that emerge should be wrapped in IOExceptions. - internal bool _wrapExceptionsInIOExceptions; - } - /// A SocketAsyncEventArgs that can be awaited to get the result of an operation. internal sealed class AwaitableSocketAsyncEventArgs : SocketAsyncEventArgs, IValueTaskSource, IValueTaskSource { - internal static readonly AwaitableSocketAsyncEventArgs Reserved = new AwaitableSocketAsyncEventArgs() { _continuation = null }; - /// Sentinel object used to indicate that the operation has completed prior to OnCompleted being called. private static readonly Action s_completedSentinel = new Action(state => throw new InvalidOperationException(SR.Format(SR.net_sockets_valuetaskmisuse, nameof(s_completedSentinel)))); - /// Sentinel object used to indicate that the instance is available for use. - private static readonly Action s_availableSentinel = new Action(state => throw new InvalidOperationException(SR.Format(SR.net_sockets_valuetaskmisuse, nameof(s_availableSentinel)))); + /// The owning socket. + private readonly Socket _owner; + /// Whether this should be cached as a read or a write on the + private bool _isReadForCaching; /// - /// if the object is available for use, after GetResult has been called on a previous use. - /// null if the operation has not completed. - /// if it has completed. - /// Another delegate if OnCompleted was called before the operation could complete, in which case it's the delegate to invoke - /// when the operation does complete. + /// if it has completed. Another delegate if OnCompleted was called before the operation could complete, + /// in which case it's the delegate to invoke when the operation does complete. /// - private Action? _continuation = s_availableSentinel; + private Action? _continuation; private ExecutionContext? _executionContext; private object? _scheduler; /// Current token value given to a ValueTask and then verified against the value it passes back to us. @@ -835,21 +570,26 @@ internal sealed class AwaitableSocketAsyncEventArgs : SocketAsyncEventArgs, IVal private CancellationToken _cancellationToken; /// Initializes the event args. - public AwaitableSocketAsyncEventArgs() : + public AwaitableSocketAsyncEventArgs(Socket owner, bool isReceiveForCaching) : base(unsafeSuppressExecutionContextFlow: true) // avoid flowing context at lower layers as we only expose ValueTask, which handles it { + _owner = owner; + _isReadForCaching = isReceiveForCaching; } public bool WrapExceptionsInIOExceptions { get; set; } - public bool Reserve() => - ReferenceEquals(Interlocked.CompareExchange(ref _continuation, null, s_availableSentinel), s_availableSentinel); - private void Release() { _cancellationToken = default; _token++; - Volatile.Write(ref _continuation, s_availableSentinel); + _continuation = null; + + ref AwaitableSocketAsyncEventArgs? cache = ref _isReadForCaching ? ref _owner._singleBufferReceiveEventArgs : ref _owner._singleBufferSendEventArgs; + if (Interlocked.CompareExchange(ref cache, this, null) != null) + { + Dispose(); + } } protected override void OnCompleted(SocketAsyncEventArgs _) @@ -859,7 +599,6 @@ protected override void OnCompleted(SocketAsyncEventArgs _) Action? c = _continuation; if (c != null || (c = Interlocked.CompareExchange(ref _continuation, s_completedSentinel, null)) != null) { - Debug.Assert(c != s_availableSentinel, "The delegate should not have been the available sentinel."); Debug.Assert(c != s_completedSentinel, "The delegate should not have been the completed sentinel."); object? continuationState = UserToken; @@ -985,7 +724,7 @@ public ValueTaskSourceStatus GetStatus(short token) return !ReferenceEquals(_continuation, s_completedSentinel) ? ValueTaskSourceStatus.Pending : - base.SocketError == SocketError.Success ? ValueTaskSourceStatus.Succeeded : + SocketError == SocketError.Success ? ValueTaskSourceStatus.Succeeded : ValueTaskSourceStatus.Faulted; } @@ -1146,7 +885,7 @@ private Exception CreateException(SocketError error, bool forAsyncThrow = true) e = ExceptionDispatchInfo.SetCurrentStackTrace(e); } - return WrapExceptionsInIOExceptions ? (Exception) + return WrapExceptionsInIOExceptions ? new IOException(SR.Format(SR.net_io_readfailure, e.Message), e) : e; } diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Unix.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Unix.cs index b84761722674..0886dbff4ccc 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Unix.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Unix.cs @@ -1,15 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.Win32.SafeHandles; using System.Diagnostics; using System.IO; using System.Threading.Tasks; +using System.Runtime.Versioning; namespace System.Net.Sockets { public partial class Socket { + [MinimumOSPlatform("windows7.0")] public Socket(SocketInformation socketInformation) { // This constructor works in conjunction with DuplicateAndClose, which is not supported on Unix. @@ -17,6 +18,7 @@ public Socket(SocketInformation socketInformation) throw new PlatformNotSupportedException(SR.net_sockets_duplicateandclose_notsupported); } + [MinimumOSPlatform("windows7.0")] public SocketInformation DuplicateAndClose(int targetProcessId) { // DuplicateAndClose is not supported on Unix, since passing file descriptors between processes diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Windows.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Windows.cs index d20fbea8a1b2..d9c64a547127 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Windows.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Windows.cs @@ -6,8 +6,8 @@ using System.Diagnostics; using System.IO; using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; using System.Threading; +using System.Runtime.Versioning; namespace System.Net.Sockets { @@ -17,6 +17,7 @@ public partial class Socket internal void ReplaceHandleIfNecessaryAfterFailedConnect() { /* nop on Windows */ } + [MinimumOSPlatform("windows7.0")] public Socket(SocketInformation socketInformation) { InitializeSockets(); @@ -105,6 +106,7 @@ private unsafe void LoadSocketTypeFromHandle( blocking = true; } + [MinimumOSPlatform("windows7.0")] public SocketInformation DuplicateAndClose(int targetProcessId) { ThrowIfDisposed(); diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs index 6bddfe34d96a..a874c7f60dc4 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.Tracing; using System.Globalization; using System.IO; using System.Net.Internals; @@ -12,6 +13,7 @@ using System.Runtime.ExceptionServices; using System.Runtime.InteropServices; using System.Threading; +using System.Runtime.Versioning; namespace System.Net.Sockets { @@ -1934,6 +1936,7 @@ public int GetRawSocketOption(int optionLevel, int optionName, Span option return realOptionLength; } + [MinimumOSPlatform("windows7.0")] public void SetIPProtectionLevel(IPProtectionLevel level) { if (level == IPProtectionLevel.Unspecified) @@ -2071,6 +2074,8 @@ private bool CanUseConnectEx(EndPoint remoteEP) internal IAsyncResult UnsafeBeginConnect(EndPoint remoteEP, AsyncCallback? callback, object? state, bool flowContext = false) { + if (SocketsTelemetry.Log.IsEnabled()) SocketsTelemetry.Log.ConnectStart(remoteEP); + if (CanUseConnectEx(remoteEP)) { return BeginConnectEx(remoteEP, flowContext, callback, state); @@ -2320,6 +2325,8 @@ asyncResult as MultipleAddressConnectAsyncResult ?? Exception? ex = castedAsyncResult.Result as Exception; if (ex != null || (SocketError)castedAsyncResult.ErrorCode != SocketError.Success) { + if (SocketsTelemetry.Log.IsEnabled()) SocketsTelemetry.Log.ConnectFailedAndStop((SocketError)castedAsyncResult.ErrorCode, ex?.Message); + if (ex == null) { SocketError errorCode = (SocketError)castedAsyncResult.ErrorCode; @@ -2334,6 +2341,8 @@ asyncResult as MultipleAddressConnectAsyncResult ?? ExceptionDispatchInfo.Throw(ex); } + if (SocketsTelemetry.Log.IsEnabled()) SocketsTelemetry.Log.ConnectStop(); + if (NetEventSource.Log.IsEnabled()) NetEventSource.Connected(this, LocalEndPoint, RemoteEndPoint); } @@ -4121,11 +4130,15 @@ static void InitializeSocketsCore() private void DoConnect(EndPoint endPointSnapshot, Internals.SocketAddress socketAddress) { + if (SocketsTelemetry.Log.IsEnabled()) SocketsTelemetry.Log.ConnectStart(socketAddress); + SocketError errorCode = SocketPal.Connect(_handle, socketAddress.Buffer, socketAddress.Size); // Throw an appropriate SocketException if the native call fails. if (errorCode != SocketError.Success) { + if (SocketsTelemetry.Log.IsEnabled()) SocketsTelemetry.Log.ConnectFailedAndStop(errorCode, null); + UpdateConnectSocketErrorForDisposed(ref errorCode); // Update the internal state of this socket according to the error before throwing. SocketException socketException = SocketExceptionFactory.CreateSocketException((int)errorCode, endPointSnapshot); @@ -4134,6 +4147,8 @@ private void DoConnect(EndPoint endPointSnapshot, Internals.SocketAddress socket throw socketException; } + if (SocketsTelemetry.Log.IsEnabled()) SocketsTelemetry.Log.ConnectStop(); + if (_rightEndPoint == null) { // Save a copy of the EndPoint so we can use it for Create(). diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.cs index 118371df52f1..213cb30909b9 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.Tracing; using System.Runtime.InteropServices; using System.Threading; @@ -553,6 +554,9 @@ internal void StartOperationConnect(MultipleConnectAsync? multipleConnect, bool _multipleConnect = multipleConnect; _connectSocket = null; _userSocket = userSocket; + + // Log only the actual connect operation to a remote endpoint. + if (SocketsTelemetry.Log.IsEnabled() && multipleConnect == null) SocketsTelemetry.Log.ConnectStart(_socketAddress!); } internal void CancelConnectAsync() @@ -566,6 +570,8 @@ internal void CancelConnectAsync() } else { + if (SocketsTelemetry.Log.IsEnabled()) SocketsTelemetry.Log.ConnectCanceledAndStop(); + // Otherwise we're doing a normal ConnectAsync - cancel it by closing the socket. // _currentSocket will only be null if _multipleConnect was set, so we don't have to check. if (_currentSocket == null) @@ -581,6 +587,11 @@ internal void FinishOperationSyncFailure(SocketError socketError, int bytesTrans { SetResults(socketError, bytesTransferred, flags); + if (SocketsTelemetry.Log.IsEnabled() && _multipleConnect == null && _completedOperation == SocketAsyncOperation.Connect) + { + SocketsTelemetry.Log.ConnectFailedAndStop(socketError, null); + } + // This will be null if we're doing a static ConnectAsync to a DnsEndPoint with AddressFamily.Unspecified; // the attempt socket will be closed anyways, so not updating the state is OK. // If we're doing a static ConnectAsync to an IPEndPoint, we need to dispose @@ -719,12 +730,16 @@ internal void FinishOperationSyncSuccess(int bytesTransferred, SocketFlags flags catch (ObjectDisposedException) { } } + if (SocketsTelemetry.Log.IsEnabled()) SocketsTelemetry.Log.ConnectStop(); + // Mark socket connected. _currentSocket!.SetToConnected(); _connectSocket = _currentSocket; } else { + if (SocketsTelemetry.Log.IsEnabled()) SocketsTelemetry.Log.ConnectFailedAndStop(socketError, null); + SetResults(socketError, bytesTransferred, flags); _currentSocket!.UpdateStatusAfterSocketError(socketError); } diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Unix.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Unix.cs index 1aa7750f5067..fca424b656a2 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Unix.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Unix.cs @@ -22,10 +22,8 @@ internal static partial class SocketPal // that get stackalloced in the Linux kernel. private const int IovStackThreshold = 8; - private static bool GetPlatformSupportsDualModeIPv4PacketInfo() - { - return Interop.Sys.PlatformSupportsDualModeIPv4PacketInfo(); - } + private static bool GetPlatformSupportsDualModeIPv4PacketInfo() => + Interop.Sys.PlatformSupportsDualModeIPv4PacketInfo() != 0; public static void Initialize() { @@ -422,8 +420,8 @@ private static unsafe int SysReceiveMessageFrom(SafeSocketHandle socket, SocketF { Debug.Assert(socketAddress != null, "Expected non-null socketAddress"); - int cmsgBufferLen = Interop.Sys.GetControlMessageBufferSize(isIPv4, isIPv6); - var cmsgBuffer = stackalloc byte[cmsgBufferLen]; + int cmsgBufferLen = Interop.Sys.GetControlMessageBufferSize(Convert.ToInt32(isIPv4), Convert.ToInt32(isIPv6)); + byte* cmsgBuffer = stackalloc byte[cmsgBufferLen]; int sockAddrLen = socketAddressLen; @@ -498,8 +496,8 @@ private static unsafe int SysReceiveMessageFrom( fixed (byte* sockAddr = socketAddress) fixed (Interop.Sys.IOVector* iov = iovecs) { - int cmsgBufferLen = Interop.Sys.GetControlMessageBufferSize(isIPv4, isIPv6); - var cmsgBuffer = stackalloc byte[cmsgBufferLen]; + int cmsgBufferLen = Interop.Sys.GetControlMessageBufferSize(Convert.ToInt32(isIPv4), Convert.ToInt32(isIPv6)); + byte* cmsgBuffer = stackalloc byte[cmsgBufferLen]; var messageHeader = new Interop.Sys.MessageHeader { diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketsTelemetry.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketsTelemetry.cs new file mode 100644 index 000000000000..7f0e2a78eb74 --- /dev/null +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketsTelemetry.cs @@ -0,0 +1,75 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics.Tracing; + +namespace System.Net.Sockets +{ + [EventSource(Name = "System.Net.Sockets")] + internal sealed class SocketsTelemetry : EventSource + { + public static readonly SocketsTelemetry Log = new SocketsTelemetry(); + + [Event(1, Level = EventLevel.Informational)] + public void ConnectStart(string? address) + { + if (IsEnabled(EventLevel.Informational, EventKeywords.All)) + { + WriteEvent(eventId: 1, address ?? ""); + } + } + + [Event(2, Level = EventLevel.Informational)] + public void ConnectStop() + { + if (IsEnabled(EventLevel.Informational, EventKeywords.All)) + { + WriteEvent(eventId: 2); + } + } + + [Event(3, Level = EventLevel.Error)] + public void ConnectFailed(SocketError error, string? exceptionMessage) + { + if (IsEnabled(EventLevel.Error, EventKeywords.All)) + { + WriteEvent(eventId: 3, (int)error, exceptionMessage ?? string.Empty); + } + } + + [Event(4, Level = EventLevel.Warning)] + public void ConnectCanceled() + { + if (IsEnabled(EventLevel.Warning, EventKeywords.All)) + { + WriteEvent(eventId: 4); + } + } + + [NonEvent] + public void ConnectStart(Internals.SocketAddress address) + { + ConnectStart(address.ToString()); + } + + [NonEvent] + public void ConnectStart(EndPoint address) + { + ConnectStart(address.ToString()); + } + + [NonEvent] + public void ConnectCanceledAndStop() + { + ConnectCanceled(); + ConnectStop(); + } + + [NonEvent] + public void ConnectFailedAndStop(SocketError error, string? exceptionMessage) + { + ConnectFailed(error, exceptionMessage); + ConnectStop(); + } + } +} diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/TCPListener.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/TCPListener.cs index d11d283ef8af..df906c11b4d0 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/TCPListener.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/TCPListener.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Threading.Tasks; +using System.Runtime.Versioning; namespace System.Net.Sockets { @@ -111,6 +112,7 @@ public bool ExclusiveAddressUse } } + [MinimumOSPlatform("windows7.0")] public void AllowNatTraversal(bool allowed) { if (_active) diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/TransmitFileOptions.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/TransmitFileOptions.cs index 9d7e2451df1b..cc1d42c633f0 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/TransmitFileOptions.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/TransmitFileOptions.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Runtime.Versioning; + namespace System.Net.Sockets { [Flags] @@ -9,8 +11,11 @@ public enum TransmitFileOptions UseDefaultWorkerThread = 0x00, Disconnect = 0x01, ReuseSocket = 0x02, + [MinimumOSPlatform("windows7.0")] WriteBehind = 0x04, + [MinimumOSPlatform("windows7.0")] UseSystemThread = 0x10, + [MinimumOSPlatform("windows7.0")] UseKernelApc = 0x20, }; } diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/UDPClient.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/UDPClient.cs index 83243cfc3bde..e5b9074bb4cf 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/UDPClient.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/UDPClient.cs @@ -3,6 +3,7 @@ using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; +using System.Runtime.Versioning; namespace System.Net.Sockets { @@ -192,6 +193,7 @@ public bool ExclusiveAddressUse } } + [MinimumOSPlatform("windows7.0")] public void AllowNatTraversal(bool allowed) { _clientSocket.SetIPProtectionLevel(allowed ? IPProtectionLevel.Unrestricted : IPProtectionLevel.EdgeRestricted); diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/AssemblyInfo.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/AssemblyInfo.cs index 83b661559542..4c89f7536b3f 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/AssemblyInfo.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/AssemblyInfo.cs @@ -5,4 +5,4 @@ [assembly: SkipOnCoreClr("System.Net.Tests are flaky and/or long running: https://github.com/dotnet/runtime/issues/131", RuntimeConfiguration.Checked)] [assembly: ActiveIssue("https://github.com/dotnet/runtime/issues/34690", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] - +[assembly: SkipOnMono("System.Net.Sockets is not supported on Browser", TestPlatforms.Browser)] diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/System.Net.Sockets.Tests.csproj b/src/libraries/System.Net.Sockets/tests/FunctionalTests/System.Net.Sockets.Tests.csproj index 6a6d63b4c6a4..ef710218ea2a 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/System.Net.Sockets.Tests.csproj +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/System.Net.Sockets.Tests.csproj @@ -3,6 +3,7 @@ true true $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser + true @@ -18,7 +19,7 @@ - + @@ -39,6 +40,7 @@ + @@ -88,4 +90,4 @@ - \ No newline at end of file + diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/TelemetryTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/TelemetryTest.cs new file mode 100644 index 000000000000..33529f980d22 --- /dev/null +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/TelemetryTest.cs @@ -0,0 +1,67 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Concurrent; +using System.Diagnostics.Tracing; +using Microsoft.DotNet.RemoteExecutor; +using Xunit; +using Xunit.Abstractions; + +namespace System.Net.Sockets.Tests +{ + public class TelemetryTest + { + public readonly ITestOutputHelper _output; + + public TelemetryTest(ITestOutputHelper output) + { + _output = output; + } + + [Fact] + public static void EventSource_ExistsWithCorrectId() + { + Type esType = typeof(Socket).Assembly.GetType("System.Net.Sockets.SocketsTelemetry", throwOnError: true, ignoreCase: false); + Assert.NotNull(esType); + + Assert.Equal("System.Net.Sockets", EventSource.GetName(esType)); + Assert.Equal(Guid.Parse("d5b2e7d4-b6ec-50ae-7cde-af89427ad21f"), EventSource.GetGuid(esType)); + + Assert.NotEmpty(EventSource.GenerateManifest(esType, esType.Assembly.Location)); + } + + [OuterLoop] + [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] + public void EventSource_EventsRaisedAsExpected() + { + RemoteExecutor.Invoke(() => + { + using (var listener = new TestEventListener("System.Net.Sockets", EventLevel.Verbose)) + { + var events = new ConcurrentQueue(); + listener.RunWithCallback(events.Enqueue, () => + { + // Invoke several tests to execute code paths while tracing is enabled + + new SendReceiveSync(null).SendRecv_Stream_TCP(IPAddress.Loopback, false).GetAwaiter(); + new SendReceiveSync(null).SendRecv_Stream_TCP(IPAddress.Loopback, true).GetAwaiter(); + + new SendReceiveTask(null).SendRecv_Stream_TCP(IPAddress.Loopback, false).GetAwaiter(); + new SendReceiveTask(null).SendRecv_Stream_TCP(IPAddress.Loopback, true).GetAwaiter(); + + new SendReceiveEap(null).SendRecv_Stream_TCP(IPAddress.Loopback, false).GetAwaiter(); + new SendReceiveEap(null).SendRecv_Stream_TCP(IPAddress.Loopback, true).GetAwaiter(); + + new SendReceiveApm(null).SendRecv_Stream_TCP(IPAddress.Loopback, false).GetAwaiter(); + new SendReceiveApm(null).SendRecv_Stream_TCP(IPAddress.Loopback, true).GetAwaiter(); + + new NetworkStreamTest().CopyToAsync_AllDataCopied(4096, true).GetAwaiter().GetResult(); + new NetworkStreamTest().Timeout_ValidData_Roundtrips().GetAwaiter().GetResult(); + }); + Assert.DoesNotContain(events, ev => ev.EventId == 0); // errors from the EventSource itself + Assert.InRange(events.Count, 1, int.MaxValue); + } + }).Dispose(); + } + } +} diff --git a/src/libraries/System.Net.WebClient/ref/System.Net.WebClient.cs b/src/libraries/System.Net.WebClient/ref/System.Net.WebClient.cs index e337a7855294..4b035a4ecdd1 100644 --- a/src/libraries/System.Net.WebClient/ref/System.Net.WebClient.cs +++ b/src/libraries/System.Net.WebClient/ref/System.Net.WebClient.cs @@ -79,16 +79,16 @@ public WebClient() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)] public bool AllowWriteStreamBuffering { get { throw null; } set { } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string BaseAddress { get { throw null; } set { } } public System.Net.Cache.RequestCachePolicy? CachePolicy { get { throw null; } set { } } public System.Net.ICredentials? Credentials { get { throw null; } set { } } public System.Text.Encoding Encoding { get { throw null; } set { } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public System.Net.WebHeaderCollection Headers { get { throw null; } set { } } public bool IsBusy { get { throw null; } } public System.Net.IWebProxy? Proxy { get { throw null; } set { } } - [System.Diagnostics.CodeAnalysis.AllowNull] + [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public System.Collections.Specialized.NameValueCollection QueryString { get { throw null; } set { } } public System.Net.WebHeaderCollection? ResponseHeaders { get { throw null; } } public bool UseDefaultCredentials { get { throw null; } set { } } diff --git a/src/libraries/System.Net.WebSockets.WebSocketProtocol/pkg/System.Net.WebSockets.WebSocketProtocol.pkgproj b/src/libraries/System.Net.WebSockets.WebSocketProtocol/pkg/System.Net.WebSockets.WebSocketProtocol.pkgproj index 286b2f50ed4d..e5902d272822 100644 --- a/src/libraries/System.Net.WebSockets.WebSocketProtocol/pkg/System.Net.WebSockets.WebSocketProtocol.pkgproj +++ b/src/libraries/System.Net.WebSockets.WebSocketProtocol/pkg/System.Net.WebSockets.WebSocketProtocol.pkgproj @@ -1,10 +1,9 @@  - + uap10.0.16299;net461;netcoreapp2.0;$(AllXamarinFrameworks) - \ No newline at end of file diff --git a/src/libraries/System.Net.WebSockets.WebSocketProtocol/src/System.Net.WebSockets.WebSocketProtocol.csproj b/src/libraries/System.Net.WebSockets.WebSocketProtocol/src/System.Net.WebSockets.WebSocketProtocol.csproj index c82981f0138e..189e51596d37 100644 --- a/src/libraries/System.Net.WebSockets.WebSocketProtocol/src/System.Net.WebSockets.WebSocketProtocol.csproj +++ b/src/libraries/System.Net.WebSockets.WebSocketProtocol/src/System.Net.WebSockets.WebSocketProtocol.csproj @@ -2,7 +2,8 @@ System.Net.WebSockets.WebSocketProtocol True - $(NetCoreAppCurrent);netstandard2.0;netcoreapp2.1 + $(NetCoreAppCurrent);netstandard2.0;netcoreapp2.1;net461;$(NetFrameworkCurrent) + true true enable @@ -18,7 +19,7 @@ - + @@ -39,4 +40,8 @@ + + + + diff --git a/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj b/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj index f7f536629855..b9e1821c6d4f 100644 --- a/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj +++ b/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj @@ -1,7 +1,8 @@ true - netstandard2.0;netstandard1.1 + netstandard2.0;netstandard1.1;net461;$(NetFrameworkCurrent) + true enable @@ -27,4 +28,9 @@ + + + + + \ No newline at end of file diff --git a/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.Shared.xml b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.Shared.xml new file mode 100644 index 000000000000..d864e9163005 --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.Shared.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.Shared.xml b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.Shared.xml index 1ebf944c46ad..81e98c3f71b5 100644 --- a/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.Shared.xml +++ b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.Shared.xml @@ -12,5 +12,8 @@ + + + diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Internal.cs b/src/libraries/System.Private.CoreLib/src/Internal/AssemblyAttributes.cs similarity index 91% rename from src/coreclr/src/System.Private.CoreLib/src/System/Internal.cs rename to src/libraries/System.Private.CoreLib/src/Internal/AssemblyAttributes.cs index 5c13161b4eb7..0052cefef04f 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Internal.cs +++ b/src/libraries/System.Private.CoreLib/src/Internal/AssemblyAttributes.cs @@ -13,6 +13,7 @@ using System; using System.Reflection; using System.Runtime.InteropServices; +using System.Resources; [assembly: CLSCompliant(true)] [assembly: ComVisible(false)] @@ -21,3 +22,5 @@ [assembly: AssemblyMetadata("Serviceable", "True")] [assembly: AssemblyMetadata(".NETFrameworkAssembly", "")] + +[assembly: NeutralResourcesLanguage("en-US")] diff --git a/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx b/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx index 8dbea2ed2717..e3e86925a275 100644 --- a/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx +++ b/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx @@ -3757,4 +3757,7 @@ Object must be of type Half. + + BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information. + diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index 983a30c2ebde..63314c0e85b9 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -28,8 +28,11 @@ Condition="'$(Platform)' == 'wasm'" /> + + + @@ -251,6 +254,7 @@ + @@ -815,20 +819,17 @@ + - - - + - - @@ -1067,7 +1068,10 @@ Common\Interop\Interop.ResultCode.cs - + + Common\Interop\Interop.TimeZoneDisplayNameType.cs + + Common\Interop\Interop.TimeZoneInfo.cs @@ -1790,7 +1794,7 @@ - + @@ -1818,8 +1822,13 @@ + + + + - + + @@ -1870,6 +1879,8 @@ + + @@ -1878,6 +1889,8 @@ + + diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs index c1e4e132ccba..ff64dbf87889 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs @@ -5,46 +5,46 @@ namespace System.Diagnostics.CodeAnalysis { /// Specifies that null is allowed as an input even if the corresponding type disallows it. [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)] -#if INTERNAL_NULLABLE_ATTRIBUTES - internal -#else +#if SYSTEM_PRIVATE_CORELIB public +#else + internal #endif sealed class AllowNullAttribute : Attribute { } /// Specifies that null is disallowed as an input even if the corresponding type allows it. [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)] -#if INTERNAL_NULLABLE_ATTRIBUTES - internal -#else +#if SYSTEM_PRIVATE_CORELIB public +#else + internal #endif sealed class DisallowNullAttribute : Attribute { } /// Specifies that an output may be null even if the corresponding type disallows it. [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)] -#if INTERNAL_NULLABLE_ATTRIBUTES - internal -#else +#if SYSTEM_PRIVATE_CORELIB public +#else + internal #endif sealed class MaybeNullAttribute : Attribute { } /// Specifies that an output will not be null even if the corresponding type allows it. Specifies that an input argument was not null when the call returns. [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)] -#if INTERNAL_NULLABLE_ATTRIBUTES - internal -#else +#if SYSTEM_PRIVATE_CORELIB public +#else + internal #endif sealed class NotNullAttribute : Attribute { } /// Specifies that when a method returns , the parameter may be null even if the corresponding type disallows it. [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] -#if INTERNAL_NULLABLE_ATTRIBUTES - internal -#else +#if SYSTEM_PRIVATE_CORELIB public +#else + internal #endif sealed class MaybeNullWhenAttribute : Attribute { @@ -60,10 +60,10 @@ sealed class MaybeNullWhenAttribute : Attribute /// Specifies that when a method returns , the parameter will not be null even if the corresponding type allows it. [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] -#if INTERNAL_NULLABLE_ATTRIBUTES - internal -#else +#if SYSTEM_PRIVATE_CORELIB public +#else + internal #endif sealed class NotNullWhenAttribute : Attribute { @@ -79,10 +79,10 @@ sealed class NotNullWhenAttribute : Attribute /// Specifies that the output will be non-null if the named parameter is non-null. [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)] -#if INTERNAL_NULLABLE_ATTRIBUTES - internal -#else +#if SYSTEM_PRIVATE_CORELIB public +#else + internal #endif sealed class NotNullIfNotNullAttribute : Attribute { @@ -98,19 +98,19 @@ sealed class NotNullIfNotNullAttribute : Attribute /// Applied to a method that will never return under any circumstance. [AttributeUsage(AttributeTargets.Method, Inherited = false)] -#if INTERNAL_NULLABLE_ATTRIBUTES - internal -#else +#if SYSTEM_PRIVATE_CORELIB public +#else + internal #endif sealed class DoesNotReturnAttribute : Attribute { } /// Specifies that the method will not return if the associated Boolean parameter is passed the specified value. [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] -#if INTERNAL_NULLABLE_ATTRIBUTES - internal -#else +#if SYSTEM_PRIVATE_CORELIB public +#else + internal #endif sealed class DoesNotReturnIfAttribute : Attribute { @@ -127,10 +127,10 @@ sealed class DoesNotReturnIfAttribute : Attribute /// Specifies that the method or property will ensure that the listed field and property members have not-null values. [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] -#if INTERNAL_NULLABLE_ATTRIBUTES - internal -#else +#if SYSTEM_PRIVATE_CORELIB public +#else + internal #endif sealed class MemberNotNullAttribute : Attribute { @@ -152,10 +152,10 @@ sealed class MemberNotNullAttribute : Attribute /// Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition. [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] -#if INTERNAL_NULLABLE_ATTRIBUTES - internal -#else +#if SYSTEM_PRIVATE_CORELIB public +#else + internal #endif sealed class MemberNotNullWhenAttribute : Attribute { diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/DebuggerTypeProxyAttribute.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/DebuggerTypeProxyAttribute.cs index 500a946951bc..1f99516869be 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/DebuggerTypeProxyAttribute.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/DebuggerTypeProxyAttribute.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; + namespace System.Diagnostics { [AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class | AttributeTargets.Assembly, AllowMultiple = true)] @@ -8,7 +10,8 @@ public sealed class DebuggerTypeProxyAttribute : Attribute { private Type? _target; - public DebuggerTypeProxyAttribute(Type type) + public DebuggerTypeProxyAttribute( + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type) { if (type == null) { @@ -18,11 +21,15 @@ public DebuggerTypeProxyAttribute(Type type) ProxyTypeName = type.AssemblyQualifiedName!; } - public DebuggerTypeProxyAttribute(string typeName) + public DebuggerTypeProxyAttribute( + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] string typeName) { ProxyTypeName = typeName; } + // The Proxy is only invoked by the debugger, so it needs to have its + // members preserved + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] public string ProxyTypeName { get; } public Type? Target diff --git a/src/libraries/System.Private.CoreLib/src/System/Enum.EnumInfo.cs b/src/libraries/System.Private.CoreLib/src/System/Enum.EnumInfo.cs new file mode 100644 index 000000000000..7ab48cfb11f4 --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Enum.EnumInfo.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System +{ + public abstract partial class Enum + { + internal sealed class EnumInfo + { + public readonly bool HasFlagsAttribute; + public readonly ulong[] Values; + public readonly string[] Names; + + // Each entry contains a list of sorted pair of enum field names and values, sorted by values + public EnumInfo(bool hasFlagsAttribute, ulong[] values, string[] names) + { + HasFlagsAttribute = hasFlagsAttribute; + Values = values; + Names = names; + } + } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/Enum.cs b/src/libraries/System.Private.CoreLib/src/System/Enum.cs index d76d85894e81..38ed61a36610 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Enum.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Enum.cs @@ -261,6 +261,87 @@ internal static ulong ToUInt64(object value) #endregion #region Public Static Methods + public static string? GetName(TEnum value) where TEnum : struct, Enum + => GetName(typeof(TEnum), value); + + public static string? GetName(Type enumType, object value) + { + if (enumType is null) + throw new ArgumentNullException(nameof(enumType)); + + return enumType.GetEnumName(value); + } + + public static string[] GetNames() where TEnum : struct, Enum + => GetNames(typeof(TEnum)); + + public static string[] GetNames(Type enumType) + { + if (enumType is null) + throw new ArgumentNullException(nameof(enumType)); + + return enumType.GetEnumNames(); + } + + internal static string[] InternalGetNames(RuntimeType enumType) + { + // Get all of the names + return GetEnumInfo(enumType, true).Names; + } + + public static Type GetUnderlyingType(Type enumType) + { + if (enumType == null) + throw new ArgumentNullException(nameof(enumType)); + + return enumType.GetEnumUnderlyingType(); + } + + public static TEnum[] GetValues() where TEnum : struct, Enum + => (TEnum[])GetValues(typeof(TEnum)); + + public static Array GetValues(Type enumType) + { + if (enumType is null) + throw new ArgumentNullException(nameof(enumType)); + + return enumType.GetEnumValues(); + } + + [Intrinsic] + public bool HasFlag(Enum flag) + { + if (flag is null) + throw new ArgumentNullException(nameof(flag)); + if (!GetType().IsEquivalentTo(flag.GetType())) + throw new ArgumentException(SR.Format(SR.Argument_EnumTypeDoesNotMatch, flag.GetType(), GetType())); + + return InternalHasFlag(flag); + } + + internal static ulong[] InternalGetValues(RuntimeType enumType) + { + // Get all of the values + return GetEnumInfo(enumType, false).Values; + } + + public static bool IsDefined(TEnum value) where TEnum : struct, Enum + { + RuntimeType enumType = (RuntimeType)typeof(TEnum); + ulong[] ulValues = Enum.InternalGetValues(enumType); + ulong ulValue = Enum.ToUInt64(value); + + return Array.BinarySearch(ulValues, ulValue) >= 0; + } + + public static bool IsDefined(Type enumType, object value) + { + if (enumType is null) + throw new ArgumentNullException(nameof(enumType)); + + return enumType.IsEnumDefined(value); + } + public static object Parse(Type enumType, string value) => Parse(enumType, value, ignoreCase: false); @@ -1141,5 +1222,16 @@ private static object ToObject(Type enumType, bool value) => InternalBoxEnum(ValidateRuntimeType(enumType), value ? 1 : 0); #endregion + + private static RuntimeType ValidateRuntimeType(Type enumType) + { + if (enumType == null) + throw new ArgumentNullException(nameof(enumType)); + if (!enumType.IsEnum) + throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType)); + if (!(enumType is RuntimeType rtType)) + throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType)); + return rtType; + } } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Environment.Browser.cs b/src/libraries/System.Private.CoreLib/src/System/Environment.Browser.cs new file mode 100644 index 000000000000..9ef90da4762d --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Environment.Browser.cs @@ -0,0 +1,26 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System +{ + public static partial class Environment + { + // Emscripten VFS mounts at / and is the only drive + public static string[] GetLogicalDrives() => new string[] { "/" }; + + // In the mono runtime, this maps to gethostname, which returns 'emscripten'. + // Returning the value here allows us to exclude more of the runtime. + public static string MachineName => "localhost"; + + // Matching what we returned for an earlier release. There isn't an established equivalent + // on wasm. + public static long WorkingSet => 0; + + public static string UserName => "Browser"; + + private static OperatingSystem GetOSVersion() + { + return new OperatingSystem(PlatformID.Other, new Version(1, 0, 0, 0)); + } + } +} \ No newline at end of file diff --git a/src/libraries/System.Private.CoreLib/src/System/Environment.OSVersion.Browser.cs b/src/libraries/System.Private.CoreLib/src/System/Environment.OSVersion.Browser.cs deleted file mode 100644 index 9dd80cbbd579..000000000000 --- a/src/libraries/System.Private.CoreLib/src/System/Environment.OSVersion.Browser.cs +++ /dev/null @@ -1,14 +0,0 @@ -// 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 -{ - public static partial class Environment - { - private static OperatingSystem GetOSVersion() - { - return new OperatingSystem(PlatformID.Other, new Version(1, 0, 0, 0)); - } - } -} diff --git a/src/libraries/System.Private.CoreLib/src/System/Environment.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Environment.Unix.cs index 273d04bae8a1..87306e7b741a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Environment.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Environment.Unix.cs @@ -12,44 +12,8 @@ namespace System { public static partial class Environment { - public static bool UserInteractive => true; - - private static string CurrentDirectoryCore - { - get => Interop.Sys.GetCwd(); - set => Interop.CheckIo(Interop.Sys.ChDir(value), value, isDirectory: true); - } - - private static string ExpandEnvironmentVariablesCore(string name) - { - var result = new ValueStringBuilder(stackalloc char[128]); - - int lastPos = 0, pos; - while (lastPos < name.Length && (pos = name.IndexOf('%', lastPos + 1)) >= 0) - { - if (name[lastPos] == '%') - { - string key = name.Substring(lastPos + 1, pos - lastPos - 1); - string? value = GetEnvironmentVariable(key); - if (value != null) - { - result.Append(value); - lastPos = pos + 1; - continue; - } - } - result.Append(name.AsSpan(lastPos, pos - lastPos)); - lastPos = pos; - } - result.Append(name.AsSpan(lastPos)); - - return result.ToString(); - } - public static string[] GetLogicalDrives() => Interop.Sys.GetAllMountPoints(); - private static bool Is64BitOperatingSystemWhen32BitProcess => false; - public static string MachineName { get @@ -60,13 +24,24 @@ public static string MachineName } } - private static int GetCurrentProcessId() => Interop.Sys.GetPid(); - - internal const string NewLineConst = "\n"; - - public static string SystemDirectory => GetFolderPathCore(SpecialFolder.System, SpecialFolderOption.None); + public static long WorkingSet + { + get + { + Type? processType = Type.GetType("System.Diagnostics.Process, System.Diagnostics.Process, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", throwOnError: false); + if (processType?.GetMethod("GetCurrentProcess")?.Invoke(null, BindingFlags.DoNotWrapExceptions, null, null, null) is IDisposable currentProcess) + { + using (currentProcess) + { + if (processType!.GetMethod("get_WorkingSet64")?.Invoke(currentProcess, BindingFlags.DoNotWrapExceptions, null, null, null) is long result) + return result; + } + } - public static int SystemPageSize => CheckedSysConf(Interop.Sys.SysConfName._SC_PAGESIZE); + // Could not get the current working set. + return 0; + } + } public static unsafe string UserName { @@ -135,40 +110,5 @@ private static unsafe bool TryGetUserNameFromPasswd(byte* buf, int bufLen, out s // Otherwise, fail. throw new IOException(errorInfo.GetErrorMessage(), errorInfo.RawErrno); } - - public static string UserDomainName => MachineName; - - /// Invoke , throwing if it fails. - private static int CheckedSysConf(Interop.Sys.SysConfName name) - { - long result = Interop.Sys.SysConf(name); - if (result == -1) - { - Interop.ErrorInfo errno = Interop.Sys.GetLastErrorInfo(); - throw errno.Error == Interop.Error.EINVAL ? - new ArgumentOutOfRangeException(nameof(name), name, errno.GetErrorMessage()) : - Interop.GetIOException(errno); - } - return (int)result; - } - - public static long WorkingSet - { - get - { - Type? processType = Type.GetType("System.Diagnostics.Process, System.Diagnostics.Process, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", throwOnError: false); - if (processType?.GetMethod("GetCurrentProcess")?.Invoke(null, BindingFlags.DoNotWrapExceptions, null, null, null) is IDisposable currentProcess) - { - using (currentProcess) - { - if (processType!.GetMethod("get_WorkingSet64")?.Invoke(currentProcess, BindingFlags.DoNotWrapExceptions, null, null, null) is long result) - return result; - } - } - - // Could not get the current working set. - return 0; - } - } } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Environment.UnixOrBrowser.cs b/src/libraries/System.Private.CoreLib/src/System/Environment.UnixOrBrowser.cs new file mode 100644 index 000000000000..cddf1b929e63 --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Environment.UnixOrBrowser.cs @@ -0,0 +1,75 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics; +using System.IO; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; + +namespace System +{ + public static partial class Environment + { + public static bool UserInteractive => true; + + private static string CurrentDirectoryCore + { + get => Interop.Sys.GetCwd(); + set => Interop.CheckIo(Interop.Sys.ChDir(value), value, isDirectory: true); + } + + private static string ExpandEnvironmentVariablesCore(string name) + { + var result = new ValueStringBuilder(stackalloc char[128]); + + int lastPos = 0, pos; + while (lastPos < name.Length && (pos = name.IndexOf('%', lastPos + 1)) >= 0) + { + if (name[lastPos] == '%') + { + string key = name.Substring(lastPos + 1, pos - lastPos - 1); + string? value = GetEnvironmentVariable(key); + if (value != null) + { + result.Append(value); + lastPos = pos + 1; + continue; + } + } + result.Append(name.AsSpan(lastPos, pos - lastPos)); + lastPos = pos; + } + result.Append(name.AsSpan(lastPos)); + + return result.ToString(); + } + + private static bool Is64BitOperatingSystemWhen32BitProcess => false; + + private static int GetCurrentProcessId() => Interop.Sys.GetPid(); + + internal const string NewLineConst = "\n"; + + public static string SystemDirectory => GetFolderPathCore(SpecialFolder.System, SpecialFolderOption.None); + + public static int SystemPageSize => CheckedSysConf(Interop.Sys.SysConfName._SC_PAGESIZE); + + public static string UserDomainName => MachineName; + + /// Invoke , throwing if it fails. + private static int CheckedSysConf(Interop.Sys.SysConfName name) + { + long result = Interop.Sys.SysConf(name); + if (result == -1) + { + Interop.ErrorInfo errno = Interop.Sys.GetLastErrorInfo(); + throw errno.Error == Interop.Error.EINVAL ? + new ArgumentOutOfRangeException(nameof(name), name, errno.GetErrorMessage()) : + Interop.GetIOException(errno); + } + return (int)result; + } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs index aa3f12a4c29c..e5425f8d0a31 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs @@ -422,22 +422,36 @@ internal static bool EnumCalendarInfo(string localeName, CalendarId calendarId, return result; } +#if !TARGET_BROWSER private static unsafe bool EnumCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType dataType, ref IcuEnumCalendarsData callbackContext) { return Interop.Globalization.EnumCalendarInfo(EnumCalendarInfoCallback, localeName, calendarId, dataType, (IntPtr)Unsafe.AsPointer(ref callbackContext)); } +#else + private static unsafe bool EnumCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType dataType, ref IcuEnumCalendarsData callbackContext) + { + // Temp workaround for pinvoke callbacks for Mono-Wasm-Interpreter + // https://github.com/dotnet/runtime/issues/39100 + var calendarInfoCallback = new Interop.Globalization.EnumCalendarInfoCallback(EnumCalendarInfoCallback); + return Interop.Globalization.EnumCalendarInfo( + System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(calendarInfoCallback), + localeName, calendarId, dataType, (IntPtr)Unsafe.AsPointer(ref callbackContext)); + } - private static unsafe void EnumCalendarInfoCallback(string calendarString, IntPtr context) + [Mono.MonoPInvokeCallback(typeof(Interop.Globalization.EnumCalendarInfoCallback))] +#endif + private static unsafe void EnumCalendarInfoCallback(char* calendarStringPtr, IntPtr context) { try { + var calendarStringSpan = new ReadOnlySpan(calendarStringPtr, string.wcslen(calendarStringPtr)); ref IcuEnumCalendarsData callbackContext = ref Unsafe.As(ref *(byte*)context); if (callbackContext.DisallowDuplicates) { foreach (string existingResult in callbackContext.Results) { - if (string.Equals(calendarString, existingResult, StringComparison.Ordinal)) + if (string.CompareOrdinal(calendarStringSpan, existingResult) == 0) { // the value is already in the results, so don't add it again return; @@ -445,7 +459,7 @@ private static unsafe void EnumCalendarInfoCallback(string calendarString, IntPt } } - callbackContext.Results.Add(calendarString); + callbackContext.Results.Add(calendarStringSpan.ToString()); } catch (Exception e) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.cs index e9af9480bdcc..6cf5e4ca2fdf 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.cs @@ -1130,7 +1130,7 @@ public static CultureInfo GetCultureInfo(string name, bool predefinedOnly) throw new ArgumentNullException(nameof(name)); } - if (predefinedOnly) + if (predefinedOnly && !GlobalizationMode.Invariant) { return GlobalizationMode.UseNls ? NlsGetPredefinedCultureInfo(name) : diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Unix.cs index 46deea50a62b..1adc48377db0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/FileStream.Unix.cs @@ -684,7 +684,7 @@ private ValueTask WriteAsyncInternal(ReadOnlyMemory source, CancellationTo } // Serialize operations using the semaphore. - Task waitTask = _asyncState.WaitAsync(); + Task waitTask = _asyncState.WaitAsync(cancellationToken); // If we got ownership immediately, and if there's enough space in our buffer // to buffer the entire write request, then do so and we're done. diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/PinnedBufferMemoryStream.cs b/src/libraries/System.Private.CoreLib/src/System/IO/PinnedBufferMemoryStream.cs index a0ba6392a1f7..6adab80d3efa 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/PinnedBufferMemoryStream.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/PinnedBufferMemoryStream.cs @@ -36,7 +36,7 @@ internal PinnedBufferMemoryStream(byte[] array) Initialize(ptr, len, len, FileAccess.Read); } -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) public override int Read(Span buffer) => ReadCore(buffer); public override void Write(ReadOnlySpan buffer) => WriteCore(buffer); diff --git a/src/libraries/System.Private.CoreLib/src/System/Index.cs b/src/libraries/System.Private.CoreLib/src/System/Index.cs index 9e47365ab775..bb03c56c40ac 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Index.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Index.cs @@ -139,7 +139,7 @@ public override string ToString() private string ToStringFromEnd() { -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) Span span = stackalloc char[11]; // 1 for ^ and 10 for longest possible uint value bool formatted = ((uint)Value).TryFormat(span.Slice(1), out int charsWritten); Debug.Assert(formatted); diff --git a/src/libraries/System.Private.CoreLib/src/System/Marvin.cs b/src/libraries/System.Private.CoreLib/src/System/Marvin.cs index a621fed9a4af..322b7888c34f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Marvin.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Marvin.cs @@ -217,6 +217,7 @@ public static int ComputeHash32(ref byte data, uint count, uint p0, uint p1) [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void Block(ref uint rp0, ref uint rp1) { + // Intrinsified in mono interpreter uint p0 = rp0; uint p1 = rp1; diff --git a/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs b/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs index 64385f6f1186..299e394f509a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs @@ -1352,6 +1352,7 @@ private static unsafe void UInt32ToNumber(uint value, ref NumberBuffer number) internal static unsafe string UInt32ToDecStr(uint value) { + // Intrinsified in mono interpreter int bufferLength = FormattingHelpers.CountDigits(value); // For single-digit values that are very common, especially 0 and 1, just return cached strings. diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix3x2.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix3x2.cs index 9f0bb2f4c07e..fce8ec1a08d0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix3x2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix3x2.cs @@ -107,12 +107,7 @@ public Matrix3x2(float m11, float m12, /// A translation matrix. public static Matrix3x2 CreateTranslation(Vector2 position) { - Matrix3x2 result; - - result.M11 = 1.0f; - result.M12 = 0.0f; - result.M21 = 0.0f; - result.M22 = 1.0f; + Matrix3x2 result = _identity; result.M31 = position.X; result.M32 = position.Y; @@ -128,12 +123,7 @@ public static Matrix3x2 CreateTranslation(Vector2 position) /// A translation matrix. public static Matrix3x2 CreateTranslation(float xPosition, float yPosition) { - Matrix3x2 result; - - result.M11 = 1.0f; - result.M12 = 0.0f; - result.M21 = 0.0f; - result.M22 = 1.0f; + Matrix3x2 result = _identity; result.M31 = xPosition; result.M32 = yPosition; @@ -149,14 +139,10 @@ public static Matrix3x2 CreateTranslation(float xPosition, float yPosition) /// A scaling matrix. public static Matrix3x2 CreateScale(float xScale, float yScale) { - Matrix3x2 result; + Matrix3x2 result = _identity; result.M11 = xScale; - result.M12 = 0.0f; - result.M21 = 0.0f; result.M22 = yScale; - result.M31 = 0.0f; - result.M32 = 0.0f; return result; } @@ -170,14 +156,12 @@ public static Matrix3x2 CreateScale(float xScale, float yScale) /// A scaling matrix. public static Matrix3x2 CreateScale(float xScale, float yScale, Vector2 centerPoint) { - Matrix3x2 result; + Matrix3x2 result = _identity; float tx = centerPoint.X * (1 - xScale); float ty = centerPoint.Y * (1 - yScale); result.M11 = xScale; - result.M12 = 0.0f; - result.M21 = 0.0f; result.M22 = yScale; result.M31 = tx; result.M32 = ty; @@ -192,14 +176,10 @@ public static Matrix3x2 CreateScale(float xScale, float yScale, Vector2 centerPo /// A scaling matrix. public static Matrix3x2 CreateScale(Vector2 scales) { - Matrix3x2 result; + Matrix3x2 result = _identity; result.M11 = scales.X; - result.M12 = 0.0f; - result.M21 = 0.0f; result.M22 = scales.Y; - result.M31 = 0.0f; - result.M32 = 0.0f; return result; } @@ -212,14 +192,12 @@ public static Matrix3x2 CreateScale(Vector2 scales) /// A scaling matrix. public static Matrix3x2 CreateScale(Vector2 scales, Vector2 centerPoint) { - Matrix3x2 result; + Matrix3x2 result = _identity; float tx = centerPoint.X * (1 - scales.X); float ty = centerPoint.Y * (1 - scales.Y); result.M11 = scales.X; - result.M12 = 0.0f; - result.M21 = 0.0f; result.M22 = scales.Y; result.M31 = tx; result.M32 = ty; @@ -234,14 +212,10 @@ public static Matrix3x2 CreateScale(Vector2 scales, Vector2 centerPoint) /// A scaling matrix. public static Matrix3x2 CreateScale(float scale) { - Matrix3x2 result; + Matrix3x2 result = _identity; result.M11 = scale; - result.M12 = 0.0f; - result.M21 = 0.0f; result.M22 = scale; - result.M31 = 0.0f; - result.M32 = 0.0f; return result; } @@ -254,14 +228,12 @@ public static Matrix3x2 CreateScale(float scale) /// A scaling matrix. public static Matrix3x2 CreateScale(float scale, Vector2 centerPoint) { - Matrix3x2 result; + Matrix3x2 result = _identity; float tx = centerPoint.X * (1 - scale); float ty = centerPoint.Y * (1 - scale); result.M11 = scale; - result.M12 = 0.0f; - result.M21 = 0.0f; result.M22 = scale; result.M31 = tx; result.M32 = ty; @@ -277,17 +249,13 @@ public static Matrix3x2 CreateScale(float scale, Vector2 centerPoint) /// A skew matrix. public static Matrix3x2 CreateSkew(float radiansX, float radiansY) { - Matrix3x2 result; + Matrix3x2 result = _identity; float xTan = MathF.Tan(radiansX); float yTan = MathF.Tan(radiansY); - result.M11 = 1.0f; result.M12 = yTan; result.M21 = xTan; - result.M22 = 1.0f; - result.M31 = 0.0f; - result.M32 = 0.0f; return result; } @@ -301,7 +269,7 @@ public static Matrix3x2 CreateSkew(float radiansX, float radiansY) /// A skew matrix. public static Matrix3x2 CreateSkew(float radiansX, float radiansY, Vector2 centerPoint) { - Matrix3x2 result; + Matrix3x2 result = _identity; float xTan = MathF.Tan(radiansX); float yTan = MathF.Tan(radiansY); @@ -309,10 +277,9 @@ public static Matrix3x2 CreateSkew(float radiansX, float radiansY, Vector2 cente float tx = -centerPoint.Y * xTan; float ty = -centerPoint.X * yTan; - result.M11 = 1.0f; result.M12 = yTan; result.M21 = xTan; - result.M22 = 1.0f; + result.M31 = tx; result.M32 = ty; @@ -326,8 +293,6 @@ public static Matrix3x2 CreateSkew(float radiansX, float radiansY, Vector2 cente /// A rotation matrix. public static Matrix3x2 CreateRotation(float radians) { - Matrix3x2 result; - radians = MathF.IEEERemainder(radians, MathF.PI * 2); float c, s; @@ -366,12 +331,11 @@ public static Matrix3x2 CreateRotation(float radians) // [ c s ] // [ -s c ] // [ 0 0 ] + Matrix3x2 result = _identity; result.M11 = c; result.M12 = s; result.M21 = -s; result.M22 = c; - result.M31 = 0.0f; - result.M32 = 0.0f; return result; } @@ -772,9 +736,9 @@ public readonly bool Equals(Matrix3x2 other) /// True if the Object is equal to this matrix; False otherwise. public override readonly bool Equals(object? obj) { - if (obj is Matrix3x2) + if (obj is Matrix3x2 m) { - return Equals((Matrix3x2)obj); + return Equals(m); } return false; diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.cs index c13f7e8132ed..e206bd1330bc 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Matrix4x4.cs @@ -330,26 +330,10 @@ public static Matrix4x4 CreateConstrainedBillboard(Vector3 objectPosition, Vecto /// The translation matrix. public static Matrix4x4 CreateTranslation(Vector3 position) { - Matrix4x4 result; - - result.M11 = 1.0f; - result.M12 = 0.0f; - result.M13 = 0.0f; - result.M14 = 0.0f; - result.M21 = 0.0f; - result.M22 = 1.0f; - result.M23 = 0.0f; - result.M24 = 0.0f; - result.M31 = 0.0f; - result.M32 = 0.0f; - result.M33 = 1.0f; - result.M34 = 0.0f; - + Matrix4x4 result = _identity; result.M41 = position.X; result.M42 = position.Y; result.M43 = position.Z; - result.M44 = 1.0f; - return result; } @@ -362,26 +346,10 @@ public static Matrix4x4 CreateTranslation(Vector3 position) /// The translation matrix. public static Matrix4x4 CreateTranslation(float xPosition, float yPosition, float zPosition) { - Matrix4x4 result; - - result.M11 = 1.0f; - result.M12 = 0.0f; - result.M13 = 0.0f; - result.M14 = 0.0f; - result.M21 = 0.0f; - result.M22 = 1.0f; - result.M23 = 0.0f; - result.M24 = 0.0f; - result.M31 = 0.0f; - result.M32 = 0.0f; - result.M33 = 1.0f; - result.M34 = 0.0f; - + Matrix4x4 result = _identity; result.M41 = xPosition; result.M42 = yPosition; result.M43 = zPosition; - result.M44 = 1.0f; - return result; } @@ -394,25 +362,10 @@ public static Matrix4x4 CreateTranslation(float xPosition, float yPosition, floa /// The scaling matrix. public static Matrix4x4 CreateScale(float xScale, float yScale, float zScale) { - Matrix4x4 result; - + Matrix4x4 result = _identity; result.M11 = xScale; - result.M12 = 0.0f; - result.M13 = 0.0f; - result.M14 = 0.0f; - result.M21 = 0.0f; result.M22 = yScale; - result.M23 = 0.0f; - result.M24 = 0.0f; - result.M31 = 0.0f; - result.M32 = 0.0f; result.M33 = zScale; - result.M34 = 0.0f; - result.M41 = 0.0f; - result.M42 = 0.0f; - result.M43 = 0.0f; - result.M44 = 1.0f; - return result; } @@ -426,29 +379,18 @@ public static Matrix4x4 CreateScale(float xScale, float yScale, float zScale) /// The scaling matrix. public static Matrix4x4 CreateScale(float xScale, float yScale, float zScale, Vector3 centerPoint) { - Matrix4x4 result; + Matrix4x4 result = _identity; float tx = centerPoint.X * (1 - xScale); float ty = centerPoint.Y * (1 - yScale); float tz = centerPoint.Z * (1 - zScale); result.M11 = xScale; - result.M12 = 0.0f; - result.M13 = 0.0f; - result.M14 = 0.0f; - result.M21 = 0.0f; result.M22 = yScale; - result.M23 = 0.0f; - result.M24 = 0.0f; - result.M31 = 0.0f; - result.M32 = 0.0f; result.M33 = zScale; - result.M34 = 0.0f; result.M41 = tx; result.M42 = ty; result.M43 = tz; - result.M44 = 1.0f; - return result; } @@ -459,25 +401,10 @@ public static Matrix4x4 CreateScale(float xScale, float yScale, float zScale, Ve /// The scaling matrix. public static Matrix4x4 CreateScale(Vector3 scales) { - Matrix4x4 result; - + Matrix4x4 result = _identity; result.M11 = scales.X; - result.M12 = 0.0f; - result.M13 = 0.0f; - result.M14 = 0.0f; - result.M21 = 0.0f; result.M22 = scales.Y; - result.M23 = 0.0f; - result.M24 = 0.0f; - result.M31 = 0.0f; - result.M32 = 0.0f; result.M33 = scales.Z; - result.M34 = 0.0f; - result.M41 = 0.0f; - result.M42 = 0.0f; - result.M43 = 0.0f; - result.M44 = 1.0f; - return result; } @@ -489,29 +416,18 @@ public static Matrix4x4 CreateScale(Vector3 scales) /// The scaling matrix. public static Matrix4x4 CreateScale(Vector3 scales, Vector3 centerPoint) { - Matrix4x4 result; + Matrix4x4 result = _identity; float tx = centerPoint.X * (1 - scales.X); float ty = centerPoint.Y * (1 - scales.Y); float tz = centerPoint.Z * (1 - scales.Z); result.M11 = scales.X; - result.M12 = 0.0f; - result.M13 = 0.0f; - result.M14 = 0.0f; - result.M21 = 0.0f; result.M22 = scales.Y; - result.M23 = 0.0f; - result.M24 = 0.0f; - result.M31 = 0.0f; - result.M32 = 0.0f; result.M33 = scales.Z; - result.M34 = 0.0f; result.M41 = tx; result.M42 = ty; result.M43 = tz; - result.M44 = 1.0f; - return result; } @@ -522,24 +438,11 @@ public static Matrix4x4 CreateScale(Vector3 scales, Vector3 centerPoint) /// The scaling matrix. public static Matrix4x4 CreateScale(float scale) { - Matrix4x4 result; + Matrix4x4 result = _identity; result.M11 = scale; - result.M12 = 0.0f; - result.M13 = 0.0f; - result.M14 = 0.0f; - result.M21 = 0.0f; result.M22 = scale; - result.M23 = 0.0f; - result.M24 = 0.0f; - result.M31 = 0.0f; - result.M32 = 0.0f; result.M33 = scale; - result.M34 = 0.0f; - result.M41 = 0.0f; - result.M42 = 0.0f; - result.M43 = 0.0f; - result.M44 = 1.0f; return result; } @@ -552,28 +455,19 @@ public static Matrix4x4 CreateScale(float scale) /// The scaling matrix. public static Matrix4x4 CreateScale(float scale, Vector3 centerPoint) { - Matrix4x4 result; + Matrix4x4 result = _identity; float tx = centerPoint.X * (1 - scale); float ty = centerPoint.Y * (1 - scale); float tz = centerPoint.Z * (1 - scale); result.M11 = scale; - result.M12 = 0.0f; - result.M13 = 0.0f; - result.M14 = 0.0f; - result.M21 = 0.0f; result.M22 = scale; - result.M23 = 0.0f; - result.M24 = 0.0f; - result.M31 = 0.0f; - result.M32 = 0.0f; result.M33 = scale; - result.M34 = 0.0f; + result.M41 = tx; result.M42 = ty; result.M43 = tz; - result.M44 = 1.0f; return result; } @@ -585,7 +479,7 @@ public static Matrix4x4 CreateScale(float scale, Vector3 centerPoint) /// The rotation matrix. public static Matrix4x4 CreateRotationX(float radians) { - Matrix4x4 result; + Matrix4x4 result = _identity; float c = MathF.Cos(radians); float s = MathF.Sin(radians); @@ -594,22 +488,11 @@ public static Matrix4x4 CreateRotationX(float radians) // [ 0 c s 0 ] // [ 0 -s c 0 ] // [ 0 0 0 1 ] - result.M11 = 1.0f; - result.M12 = 0.0f; - result.M13 = 0.0f; - result.M14 = 0.0f; - result.M21 = 0.0f; + result.M22 = c; result.M23 = s; - result.M24 = 0.0f; - result.M31 = 0.0f; result.M32 = -s; result.M33 = c; - result.M34 = 0.0f; - result.M41 = 0.0f; - result.M42 = 0.0f; - result.M43 = 0.0f; - result.M44 = 1.0f; return result; } @@ -622,7 +505,7 @@ public static Matrix4x4 CreateRotationX(float radians) /// The rotation matrix. public static Matrix4x4 CreateRotationX(float radians, Vector3 centerPoint) { - Matrix4x4 result; + Matrix4x4 result = _identity; float c = MathF.Cos(radians); float s = MathF.Sin(radians); @@ -634,22 +517,13 @@ public static Matrix4x4 CreateRotationX(float radians, Vector3 centerPoint) // [ 0 c s 0 ] // [ 0 -s c 0 ] // [ 0 y z 1 ] - result.M11 = 1.0f; - result.M12 = 0.0f; - result.M13 = 0.0f; - result.M14 = 0.0f; - result.M21 = 0.0f; + result.M22 = c; result.M23 = s; - result.M24 = 0.0f; - result.M31 = 0.0f; result.M32 = -s; result.M33 = c; - result.M34 = 0.0f; - result.M41 = 0.0f; result.M42 = y; result.M43 = z; - result.M44 = 1.0f; return result; } @@ -661,7 +535,7 @@ public static Matrix4x4 CreateRotationX(float radians, Vector3 centerPoint) /// The rotation matrix. public static Matrix4x4 CreateRotationY(float radians) { - Matrix4x4 result; + Matrix4x4 result = _identity; float c = MathF.Cos(radians); float s = MathF.Sin(radians); @@ -671,21 +545,9 @@ public static Matrix4x4 CreateRotationY(float radians) // [ s 0 c 0 ] // [ 0 0 0 1 ] result.M11 = c; - result.M12 = 0.0f; result.M13 = -s; - result.M14 = 0.0f; - result.M21 = 0.0f; - result.M22 = 1.0f; - result.M23 = 0.0f; - result.M24 = 0.0f; result.M31 = s; - result.M32 = 0.0f; result.M33 = c; - result.M34 = 0.0f; - result.M41 = 0.0f; - result.M42 = 0.0f; - result.M43 = 0.0f; - result.M44 = 1.0f; return result; } @@ -698,7 +560,7 @@ public static Matrix4x4 CreateRotationY(float radians) /// The rotation matrix. public static Matrix4x4 CreateRotationY(float radians, Vector3 centerPoint) { - Matrix4x4 result; + Matrix4x4 result = _identity; float c = MathF.Cos(radians); float s = MathF.Sin(radians); @@ -711,21 +573,11 @@ public static Matrix4x4 CreateRotationY(float radians, Vector3 centerPoint) // [ s 0 c 0 ] // [ x 0 z 1 ] result.M11 = c; - result.M12 = 0.0f; result.M13 = -s; - result.M14 = 0.0f; - result.M21 = 0.0f; - result.M22 = 1.0f; - result.M23 = 0.0f; - result.M24 = 0.0f; result.M31 = s; - result.M32 = 0.0f; result.M33 = c; - result.M34 = 0.0f; result.M41 = x; - result.M42 = 0.0f; result.M43 = z; - result.M44 = 1.0f; return result; } @@ -737,7 +589,7 @@ public static Matrix4x4 CreateRotationY(float radians, Vector3 centerPoint) /// The rotation matrix. public static Matrix4x4 CreateRotationZ(float radians) { - Matrix4x4 result; + Matrix4x4 result = _identity; float c = MathF.Cos(radians); float s = MathF.Sin(radians); @@ -748,20 +600,8 @@ public static Matrix4x4 CreateRotationZ(float radians) // [ 0 0 0 1 ] result.M11 = c; result.M12 = s; - result.M13 = 0.0f; - result.M14 = 0.0f; result.M21 = -s; result.M22 = c; - result.M23 = 0.0f; - result.M24 = 0.0f; - result.M31 = 0.0f; - result.M32 = 0.0f; - result.M33 = 1.0f; - result.M34 = 0.0f; - result.M41 = 0.0f; - result.M42 = 0.0f; - result.M43 = 0.0f; - result.M44 = 1.0f; return result; } @@ -774,7 +614,7 @@ public static Matrix4x4 CreateRotationZ(float radians) /// The rotation matrix. public static Matrix4x4 CreateRotationZ(float radians, Vector3 centerPoint) { - Matrix4x4 result; + Matrix4x4 result = _identity; float c = MathF.Cos(radians); float s = MathF.Sin(radians); @@ -788,20 +628,10 @@ public static Matrix4x4 CreateRotationZ(float radians, Vector3 centerPoint) // [ x y 0 1 ] result.M11 = c; result.M12 = s; - result.M13 = 0.0f; - result.M14 = 0.0f; result.M21 = -s; result.M22 = c; - result.M23 = 0.0f; - result.M24 = 0.0f; - result.M31 = 0.0f; - result.M32 = 0.0f; - result.M33 = 1.0f; - result.M34 = 0.0f; result.M41 = x; result.M42 = y; - result.M43 = 0.0f; - result.M44 = 1.0f; return result; } @@ -844,24 +674,19 @@ public static Matrix4x4 CreateFromAxisAngle(Vector3 axis, float angle) float xx = x * x, yy = y * y, zz = z * z; float xy = x * y, xz = x * z, yz = y * z; - Matrix4x4 result; + Matrix4x4 result = _identity; result.M11 = xx + ca * (1.0f - xx); result.M12 = xy - ca * xy + sa * z; result.M13 = xz - ca * xz - sa * y; - result.M14 = 0.0f; + result.M21 = xy - ca * xy - sa * z; result.M22 = yy + ca * (1.0f - yy); result.M23 = yz - ca * yz + sa * x; - result.M24 = 0.0f; + result.M31 = xz - ca * xz + sa * y; result.M32 = yz - ca * yz - sa * x; result.M33 = zz + ca * (1.0f - zz); - result.M34 = 0.0f; - result.M41 = 0.0f; - result.M42 = 0.0f; - result.M43 = 0.0f; - result.M44 = 1.0f; return result; } @@ -999,20 +824,12 @@ public static Matrix4x4 CreatePerspectiveOffCenter(float left, float right, floa /// The orthographic projection matrix. public static Matrix4x4 CreateOrthographic(float width, float height, float zNearPlane, float zFarPlane) { - Matrix4x4 result; + Matrix4x4 result = _identity; result.M11 = 2.0f / width; - result.M12 = result.M13 = result.M14 = 0.0f; - result.M22 = 2.0f / height; - result.M21 = result.M23 = result.M24 = 0.0f; - result.M33 = 1.0f / (zNearPlane - zFarPlane); - result.M31 = result.M32 = result.M34 = 0.0f; - - result.M41 = result.M42 = 0.0f; result.M43 = zNearPlane / (zNearPlane - zFarPlane); - result.M44 = 1.0f; return result; } @@ -1029,21 +846,17 @@ public static Matrix4x4 CreateOrthographic(float width, float height, float zNea /// The orthographic projection matrix. public static Matrix4x4 CreateOrthographicOffCenter(float left, float right, float bottom, float top, float zNearPlane, float zFarPlane) { - Matrix4x4 result; + Matrix4x4 result = _identity; result.M11 = 2.0f / (right - left); - result.M12 = result.M13 = result.M14 = 0.0f; result.M22 = 2.0f / (top - bottom); - result.M21 = result.M23 = result.M24 = 0.0f; result.M33 = 1.0f / (zNearPlane - zFarPlane); - result.M31 = result.M32 = result.M34 = 0.0f; result.M41 = (left + right) / (left - right); result.M42 = (top + bottom) / (bottom - top); result.M43 = zNearPlane / (zNearPlane - zFarPlane); - result.M44 = 1.0f; return result; } @@ -1061,24 +874,23 @@ public static Matrix4x4 CreateLookAt(Vector3 cameraPosition, Vector3 cameraTarge Vector3 xaxis = Vector3.Normalize(Vector3.Cross(cameraUpVector, zaxis)); Vector3 yaxis = Vector3.Cross(zaxis, xaxis); - Matrix4x4 result; + Matrix4x4 result = _identity; result.M11 = xaxis.X; result.M12 = yaxis.X; result.M13 = zaxis.X; - result.M14 = 0.0f; + result.M21 = xaxis.Y; result.M22 = yaxis.Y; result.M23 = zaxis.Y; - result.M24 = 0.0f; + result.M31 = xaxis.Z; result.M32 = yaxis.Z; result.M33 = zaxis.Z; - result.M34 = 0.0f; + result.M41 = -Vector3.Dot(xaxis, cameraPosition); result.M42 = -Vector3.Dot(yaxis, cameraPosition); result.M43 = -Vector3.Dot(zaxis, cameraPosition); - result.M44 = 1.0f; return result; } @@ -1096,24 +908,23 @@ public static Matrix4x4 CreateWorld(Vector3 position, Vector3 forward, Vector3 u Vector3 xaxis = Vector3.Normalize(Vector3.Cross(up, zaxis)); Vector3 yaxis = Vector3.Cross(zaxis, xaxis); - Matrix4x4 result; + Matrix4x4 result = _identity; result.M11 = xaxis.X; result.M12 = xaxis.Y; result.M13 = xaxis.Z; - result.M14 = 0.0f; + result.M21 = yaxis.X; result.M22 = yaxis.Y; result.M23 = yaxis.Z; - result.M24 = 0.0f; + result.M31 = zaxis.X; result.M32 = zaxis.Y; result.M33 = zaxis.Z; - result.M34 = 0.0f; + result.M41 = position.X; result.M42 = position.Y; result.M43 = position.Z; - result.M44 = 1.0f; return result; } @@ -1125,7 +936,7 @@ public static Matrix4x4 CreateWorld(Vector3 position, Vector3 forward, Vector3 u /// The rotation matrix. public static Matrix4x4 CreateFromQuaternion(Quaternion quaternion) { - Matrix4x4 result; + Matrix4x4 result = _identity; float xx = quaternion.X * quaternion.X; float yy = quaternion.Y * quaternion.Y; @@ -1141,19 +952,14 @@ public static Matrix4x4 CreateFromQuaternion(Quaternion quaternion) result.M11 = 1.0f - 2.0f * (yy + zz); result.M12 = 2.0f * (xy + wz); result.M13 = 2.0f * (xz - wy); - result.M14 = 0.0f; + result.M21 = 2.0f * (xy - wz); result.M22 = 1.0f - 2.0f * (zz + xx); result.M23 = 2.0f * (yz + wx); - result.M24 = 0.0f; + result.M31 = 2.0f * (xz + wy); result.M32 = 2.0f * (yz - wx); result.M33 = 1.0f - 2.0f * (yy + xx); - result.M34 = 0.0f; - result.M41 = 0.0f; - result.M42 = 0.0f; - result.M43 = 0.0f; - result.M44 = 1.0f; return result; } @@ -1188,7 +994,7 @@ public static Matrix4x4 CreateShadow(Vector3 lightDirection, Plane plane) float c = -p.Normal.Z; float d = -p.D; - Matrix4x4 result; + Matrix4x4 result = _identity; result.M11 = a * lightDirection.X + dot; result.M21 = b * lightDirection.X; @@ -1205,9 +1011,6 @@ public static Matrix4x4 CreateShadow(Vector3 lightDirection, Plane plane) result.M33 = c * lightDirection.Z + dot; result.M43 = d * lightDirection.Z; - result.M14 = 0.0f; - result.M24 = 0.0f; - result.M34 = 0.0f; result.M44 = dot; return result; @@ -1230,27 +1033,23 @@ public static Matrix4x4 CreateReflection(Plane value) float fb = -2.0f * b; float fc = -2.0f * c; - Matrix4x4 result; + Matrix4x4 result = _identity; result.M11 = fa * a + 1.0f; result.M12 = fb * a; result.M13 = fc * a; - result.M14 = 0.0f; result.M21 = fa * b; result.M22 = fb * b + 1.0f; result.M23 = fc * b; - result.M24 = 0.0f; result.M31 = fa * c; result.M32 = fb * c; result.M33 = fc * c + 1.0f; - result.M34 = 0.0f; result.M41 = fa * value.D; result.M42 = fb * value.D; result.M43 = fc * value.D; - result.M44 = 1.0f; return result; } diff --git a/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs b/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs index 5a49935d8ed2..718f67cc9096 100644 --- a/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs +++ b/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs @@ -65,7 +65,7 @@ public string VersionString case PlatformID.Unix: os = "Unix "; break; case PlatformID.Xbox: os = "Xbox "; break; case PlatformID.MacOSX: os = "Mac OS X "; break; - case PlatformID.Other: os = "Other"; break; + case PlatformID.Other: os = "Other "; break; default: Debug.Fail($"Unknown platform {_platform}"); os = " "; break; diff --git a/src/libraries/System.Private.CoreLib/src/System/Range.cs b/src/libraries/System.Private.CoreLib/src/System/Range.cs index 75b2712b3a16..0d6996da35c9 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Range.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Range.cs @@ -4,7 +4,7 @@ using System.Diagnostics; using System.Runtime.CompilerServices; -#if NETSTANDARD2_0 +#if NETSTANDARD2_0 || NETFRAMEWORK using System.Numerics.Hashing; #endif @@ -50,7 +50,7 @@ value is Range r && /// Returns the hash code for this instance. public override int GetHashCode() { -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) return HashCode.Combine(Start.GetHashCode(), End.GetHashCode()); #else return HashHelpers.Combine(Start.GetHashCode(), End.GetHashCode()); @@ -60,7 +60,7 @@ public override int GetHashCode() /// Converts the value of the current Range object to its equivalent string representation. public override string ToString() { -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) Span span = stackalloc char[2 + (2 * 11)]; // 2 for "..", then for each index 1 for '^' and 10 for longest possible uint int pos = 0; diff --git a/src/libraries/System.Private.CoreLib/src/System/Resources/ResourceReader.Core.cs b/src/libraries/System.Private.CoreLib/src/System/Resources/ResourceReader.Core.cs index 0a91938f83b1..880f21c1b98b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Resources/ResourceReader.Core.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Resources/ResourceReader.Core.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.IO; using System.Reflection; +using System.Runtime.Serialization; using System.Text; using System.Threading; @@ -50,7 +51,14 @@ private object DeserializeObject(int typeIndex) if (_binaryFormatter == null) { - InitializeBinaryFormatter(); + if (!InitializeBinaryFormatter()) + { + // The linker trimmed away the BinaryFormatter implementation and we can't call into it. + // We'll throw an exception with the same text that BinaryFormatter would have thrown + // had we been able to call into it. Keep this resource string in sync with the same + // resource from the Formatters assembly. + throw new NotSupportedException(SR.BinaryFormatter_SerializationDisallowed); + } } Type type = FindType(typeIndex); @@ -64,8 +72,12 @@ private object DeserializeObject(int typeIndex) return graph; } - private void InitializeBinaryFormatter() + // Issue https://github.com/dotnet/runtime/issues/39290 tracks finding an alternative to BinaryFormatter + private bool InitializeBinaryFormatter() { + // If BinaryFormatter support is disabled for the app, the linker will replace this entire + // method body with "return false;", skipping all reflection code below. + LazyInitializer.EnsureInitialized(ref s_binaryFormatterType, () => Type.GetType("System.Runtime.Serialization.Formatters.Binary.BinaryFormatter, System.Runtime.Serialization.Formatters, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", throwOnError: true)!); @@ -82,6 +94,8 @@ private void InitializeBinaryFormatter() }); _binaryFormatter = Activator.CreateInstance(s_binaryFormatterType!)!; + + return true; // initialization successful } // generic method that we specialize at runtime once we've loaded the BinaryFormatter type diff --git a/src/libraries/System.Private.CoreLib/src/System/Resources/RuntimeResourceSet.cs b/src/libraries/System.Private.CoreLib/src/System/Resources/RuntimeResourceSet.cs index 703c4e81b508..c00ebb2b04a4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Resources/RuntimeResourceSet.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Resources/RuntimeResourceSet.cs @@ -209,7 +209,11 @@ internal RuntimeResourceSet(Stream stream, bool permitDeserialization = false) : Reader = _defaultReader; } #else - private IResourceReader Reader => _defaultReader!; + private +#if NETFRAMEWORK + new +#endif + IResourceReader Reader => _defaultReader!; internal RuntimeResourceSet(IResourceReader reader) : // explicitly do not call IResourceReader constructor since it caches all resources diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/DispatchWrapper.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/DispatchWrapper.cs index b18dc25838ef..5be89fc00623 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/DispatchWrapper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/DispatchWrapper.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Runtime.Versioning; + namespace System.Runtime.InteropServices { // Wrapper that is converted to a variant with VT_DISPATCH @@ -20,6 +22,7 @@ public DispatchWrapper(object? obj) } } + [MinimumOSPlatform("windows7.0")] public object? WrappedObject { get; } } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.NoCom.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.NoCom.cs index aa94a55153f3..2e7c3b36b4e6 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.NoCom.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.NoCom.cs @@ -4,6 +4,7 @@ using System.Diagnostics.CodeAnalysis; using System.Reflection; using System.Runtime.InteropServices.ComTypes; +using System.Runtime.Versioning; namespace System.Runtime.InteropServices { @@ -14,6 +15,7 @@ public static int GetHRForException(Exception? e) return e?.HResult ?? 0; } + [MinimumOSPlatform("windows7.0")] public static int AddRef(IntPtr pUnk) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); @@ -21,11 +23,13 @@ public static int AddRef(IntPtr pUnk) public static bool AreComObjectsAvailableForCleanup() => false; + [MinimumOSPlatform("windows7.0")] public static IntPtr CreateAggregatedObject(IntPtr pOuter, object o) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static object BindToMoniker(string monikerName) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); @@ -35,46 +39,55 @@ public static void CleanupUnusedObjectsInCurrentContext() { } + [MinimumOSPlatform("windows7.0")] public static IntPtr CreateAggregatedObject(IntPtr pOuter, T o) where T : notnull { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static object? CreateWrapperOfType(object? o, Type t) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static TWrapper CreateWrapperOfType([AllowNull] T o) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static void ChangeWrapperHandleStrength(object otp, bool fIsWeak) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static int FinalReleaseComObject(object o) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static IntPtr GetComInterfaceForObject(object o, Type T) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static IntPtr GetComInterfaceForObject(object o, Type T, CustomQueryInterfaceMode mode) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static IntPtr GetComInterfaceForObject([DisallowNull] T o) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static object? GetComObjectData(object obj, object key) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); @@ -90,77 +103,92 @@ public static IntPtr GetHINSTANCE(Module m) return (IntPtr)(-1); } + [MinimumOSPlatform("windows7.0")] public static IntPtr GetIDispatchForObject(object o) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static IntPtr GetIUnknownForObject(object o) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static void GetNativeVariantForObject(object? obj, IntPtr pDstNativeVariant) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static void GetNativeVariantForObject([AllowNull] T obj, IntPtr pDstNativeVariant) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static object GetTypedObjectForIUnknown(IntPtr pUnk, Type t) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static object GetObjectForIUnknown(IntPtr pUnk) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static object? GetObjectForNativeVariant(IntPtr pSrcNativeVariant) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] [return: MaybeNull] public static T GetObjectForNativeVariant(IntPtr pSrcNativeVariant) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static object?[] GetObjectsForNativeVariants(IntPtr aSrcNativeVariant, int cVars) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static T[] GetObjectsForNativeVariants(IntPtr aSrcNativeVariant, int cVars) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static int GetStartComSlot(Type t) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static int GetEndComSlot(Type t) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static Type? GetTypeFromCLSID(Guid clsid) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static string GetTypeInfoName(ITypeInfo typeInfo) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static object GetUniqueObjectForIUnknown(IntPtr unknown) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); @@ -185,21 +213,25 @@ public static bool IsTypeVisibleFromCom(Type t) return false; } + [MinimumOSPlatform("windows7.0")] public static int QueryInterface(IntPtr pUnk, ref Guid iid, out IntPtr ppv) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static int Release(IntPtr pUnk) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static int ReleaseComObject(object o) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } + [MinimumOSPlatform("windows7.0")] public static bool SetComObjectData(object obj, object key, object? data) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/SuppressGCTransitionAttribute.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/SuppressGCTransitionAttribute.cs index 1909af3f6d6d..21b8a615f1a7 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/SuppressGCTransitionAttribute.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/SuppressGCTransitionAttribute.cs @@ -42,6 +42,9 @@ namespace System.Runtime.InteropServices /// In general, usage of this attribute is not recommended if debugging the P/Invoke is important, for example /// stepping through the native code or diagnosing an exception thrown from the native code. /// + /// The runtime may load the native library for method marked with this attribute in advance before the method is called for the first time. + /// Usage of this attribute is not recommended for platform neutral libraries with conditional platform specific code. + /// /// The P/Invoke method that this attribute is applied to must have all of the following properties: /// * Native function always executes for a trivial amount of time (less than 1 microsecond). /// * Native function does not perform a blocking syscall (e.g. any type of I/O). @@ -55,7 +58,12 @@ namespace System.Runtime.InteropServices /// * Data corruption. /// [AttributeUsage(AttributeTargets.Method, Inherited = false)] - public sealed class SuppressGCTransitionAttribute : Attribute +#if SYSTEM_PRIVATE_CORELIB + public +#else + internal +#endif + sealed class SuppressGCTransitionAttribute : Attribute { public SuppressGCTransitionAttribute() { diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs index bd0d20b305af..748ba26f67d5 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs @@ -2715,6 +2715,236 @@ internal Arm64() { } /// public static Vector128 Sqrt(Vector128 value) { throw new PlatformNotSupportedException(); } + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(byte* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(double* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(short* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(int* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(long* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(sbyte* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(float* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(ushort* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(uint* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(ulong* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(byte* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(double* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(short* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(int* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(long* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(sbyte* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(float* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(ushort* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(uint* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(ulong* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(byte* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(double* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(short* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(int* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(long* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(sbyte* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(float* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(ushort* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(uint* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(ulong* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(byte* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(double* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(short* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(int* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(long* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(sbyte* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(float* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(ushort* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(uint* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(ulong* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP St1, St2, [Xn] + /// + public static unsafe void StorePairScalar(int* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP St1, St2, [Xn] + /// + public static unsafe void StorePairScalar(float* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STP St1, St2, [Xn] + /// + public static unsafe void StorePairScalar(uint* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP St1, St2, [Xn] + /// + public static unsafe void StorePairScalarNonTemporal(int* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP St1, St2, [Xn] + /// + public static unsafe void StorePairScalarNonTemporal(float* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + + /// + /// A64: STNP St1, St2, [Xn] + /// + public static unsafe void StorePairScalarNonTemporal(uint* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } + /// /// float64x2_t vsubq_f64 (float64x2_t a, float64x2_t b) /// A64: FSUB Vd.2D, Vn.2D, Vm.2D diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs index 30dc6881900f..a8db248ef75c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs @@ -2713,6 +2713,236 @@ internal Arm64() { } /// public static Vector128 Sqrt(Vector128 value) => Sqrt(value); + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(byte* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(double* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(short* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(int* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(long* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(sbyte* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(float* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(ushort* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(uint* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePair(ulong* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(byte* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(double* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(short* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(int* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(long* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(sbyte* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(float* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(ushort* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(uint* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); + + /// + /// A64: STP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePair(ulong* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(byte* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(double* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(short* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(int* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(long* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(sbyte* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(float* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(ushort* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(uint* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Dt1, Dt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(ulong* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(byte* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(double* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(short* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(int* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(long* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(sbyte* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(float* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(ushort* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(uint* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STNP Qt1, Qt2, [Xn] + /// + public static unsafe void StorePairNonTemporal(ulong* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); + + /// + /// A64: STP St1, St2, [Xn] + /// + public static unsafe void StorePairScalar(int* address, Vector64 value1, Vector64 value2) => StorePairScalar(address, value1, value2); + + /// + /// A64: STP St1, St2, [Xn] + /// + public static unsafe void StorePairScalar(float* address, Vector64 value1, Vector64 value2) => StorePairScalar(address, value1, value2); + + /// + /// A64: STP St1, St2, [Xn] + /// + public static unsafe void StorePairScalar(uint* address, Vector64 value1, Vector64 value2) => StorePairScalar(address, value1, value2); + + /// + /// A64: STNP St1, St2, [Xn] + /// + public static unsafe void StorePairScalarNonTemporal(int* address, Vector64 value1, Vector64 value2) => StorePairScalarNonTemporal(address, value1, value2); + + /// + /// A64: STNP St1, St2, [Xn] + /// + public static unsafe void StorePairScalarNonTemporal(float* address, Vector64 value1, Vector64 value2) => StorePairScalarNonTemporal(address, value1, value2); + + /// + /// A64: STNP St1, St2, [Xn] + /// + public static unsafe void StorePairScalarNonTemporal(uint* address, Vector64 value1, Vector64 value2) => StorePairScalarNonTemporal(address, value1, value2); + /// /// float64x2_t vsubq_f64 (float64x2_t a, float64x2_t b) /// A64: FSUB Vd.2D, Vn.2D, Vm.2D diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Dp.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Dp.PlatformNotSupported.cs new file mode 100644 index 000000000000..a1b430e70955 --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Dp.PlatformNotSupported.cs @@ -0,0 +1,111 @@ +// 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. + +#pragma warning disable IDE0060 // unused parameters +using System.Runtime.CompilerServices; + +namespace System.Runtime.Intrinsics.Arm +{ + /// + /// This class provides access to the ARMv8.2-DotProd hardware instructions via intrinsics + /// + [CLSCompliant(false)] + public abstract class Dp : AdvSimd + { + internal Dp() { } + + public static new bool IsSupported { [Intrinsic] get => false; } + + public new abstract class Arm64 : AdvSimd.Arm64 + { + internal Arm64() { } + + public static new bool IsSupported { [Intrinsic] get { return false; } } + } + + /// + /// int32x2_t vdot_s32 (int32x2_t r, int8x8_t a, int8x8_t b) + /// A32: VSDOT.S8 Dd, Dn, Dm + /// A64: SDOT Vd.2S, Vn.8B, Vm.8B + /// + public static Vector64 DotProduct(Vector64 addend, Vector64 left, Vector64 right) { throw new PlatformNotSupportedException(); } + + /// + /// uint32x2_t vdot_u32 (uint32x2_t r, uint8x8_t a, uint8x8_t b) + /// A32: VUDOT.U8 Dd, Dn, Dm + /// A64: UDOT Vd.2S, Vn.8B, Vm.8B + /// + public static Vector64 DotProduct(Vector64 addend, Vector64 left, Vector64 right) { throw new PlatformNotSupportedException(); } + + /// + /// int32x4_t vdotq_s32 (int32x4_t r, int8x16_t a, int8x16_t b) + /// A32: VSDOT.S8 Qd, Qn, Qm + /// A64: SDOT Vd.4S, Vn.16B, Vm.16B + /// + public static Vector128 DotProduct(Vector128 addend, Vector128 left, Vector128 right) { throw new PlatformNotSupportedException(); } + + /// + /// uint32x4_t vdotq_u32 (uint32x4_t r, uint8x16_t a, uint8x16_t b) + /// A32: VUDOT.U8 Qd, Qn, Qm + /// A64: UDOT Vd.4S, Vn.16B, Vm.16B + /// + public static Vector128 DotProduct(Vector128 addend, Vector128 left, Vector128 right) { throw new PlatformNotSupportedException(); } + + /// + /// int32x2_t vdot_lane_s32 (int32x2_t r, int8x8_t a, int8x8_t b, const int lane) + /// A32: VSDOT.S8 Dd, Dn, Dm[lane] + /// A64: SDOT Vd.2S, Vn.8B, Vm.4B[lane] + /// + public static Vector64 DotProductBySelectedQuadruplet(Vector64 addend, Vector64 left, Vector64 right, byte rightScaledIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int32x2_t vdot_laneq_s32 (int32x2_t r, int8x8_t a, int8x16_t b, const int lane) + /// A32: VSDOT.S8 Dd, Dn, Dm[lane] + /// A64: SDOT Vd.2S, Vn.8B, Vm.4B[lane] + /// + public static Vector64 DotProductBySelectedQuadruplet(Vector64 addend, Vector64 left, Vector128 right, byte rightScaledIndex) { throw new PlatformNotSupportedException(); } + + /// + /// uint32x2_t vdot_lane_u32 (uint32x2_t r, uint8x8_t a, uint8x8_t b, const int lane) + /// A32: VUDOT.U8 Dd, Dn, Dm[lane] + /// A64: UDOT Vd.2S, Vn.8B, Vm.4B[lane] + /// + public static Vector64 DotProductBySelectedQuadruplet(Vector64 addend, Vector64 left, Vector64 right, byte rightScaledIndex) { throw new PlatformNotSupportedException(); } + + /// + /// uint32x2_t vdot_laneq_u32 (uint32x2_t r, uint8x8_t a, uint8x16_t b, const int lane) + /// A32: VUDOT.U8 Dd, Dn, Dm[lane] + /// A64: UDOT Vd.2S, Vn.8B, Vm.4B[lane] + /// + public static Vector64 DotProductBySelectedQuadruplet(Vector64 addend, Vector64 left, Vector128 right, byte rightScaledIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int32x4_t vdotq_laneq_s32 (int32x4_t r, int8x16_t a, int8x16_t b, const int lane) + /// A32: VSDOT.S8 Qd, Qn, Dm[lane] + /// A64: SDOT Vd.4S, Vn.16B, Vm.4B[lane] + /// + public static Vector128 DotProductBySelectedQuadruplet(Vector128 addend, Vector128 left, Vector128 right, byte rightScaledIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int32x4_t vdotq_lane_s32 (int32x4_t r, int8x16_t a, int8x8_t b, const int lane) + /// A32: VSDOT.S8 Qd, Qn, Dm[lane] + /// A64: SDOT Vd.4S, Vn.16B, Vm.4B[lane] + /// + public static Vector128 DotProductBySelectedQuadruplet(Vector128 addend, Vector128 left, Vector64 right, byte rightScaledIndex) { throw new PlatformNotSupportedException(); } + + /// + /// uint32x4_t vdotq_laneq_u32 (uint32x4_t r, uint8x16_t a, uint8x16_t b, const int lane) + /// A32: VUDOT.U8 Qd, Qn, Dm[lane] + /// A64: UDOT Vd.4S, Vn.16B, Vm.4B[lane] + /// + public static Vector128 DotProductBySelectedQuadruplet(Vector128 addend, Vector128 left, Vector128 right, byte rightScaledIndex) { throw new PlatformNotSupportedException(); } + + /// + /// uint32x4_t vdotq_lane_u32 (uint32x4_t r, uint8x16_t a, uint8x8_t b, const int lane) + /// A32: VUDOT.U8 Qd, Qn, Dm[lane] + /// A64: UDOT Vd.4S, Vn.16B, Vm.4B[lane] + /// + public static Vector128 DotProductBySelectedQuadruplet(Vector128 addend, Vector128 left, Vector64 right, byte rightScaledIndex) { throw new PlatformNotSupportedException(); } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Dp.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Dp.cs new file mode 100644 index 000000000000..a1cb07ce7bac --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Dp.cs @@ -0,0 +1,112 @@ +// 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.Runtime.CompilerServices; + +namespace System.Runtime.Intrinsics.Arm +{ + /// + /// This class provides access to the ARMv8.2-DotProd hardware instructions via intrinsics + /// + [Intrinsic] + [CLSCompliant(false)] + public abstract class Dp : AdvSimd + { + internal Dp() { } + + public static new bool IsSupported { get => IsSupported; } + + [Intrinsic] + public new abstract class Arm64 : AdvSimd.Arm64 + { + internal Arm64() { } + + public static new bool IsSupported { get => IsSupported; } + } + + /// + /// int32x2_t vdot_s32 (int32x2_t r, int8x8_t a, int8x8_t b) + /// A32: VSDOT.S8 Dd, Dn, Dm + /// A64: SDOT Vd.2S, Vn.8B, Vm.8B + /// + public static Vector64 DotProduct(Vector64 addend, Vector64 left, Vector64 right) => DotProduct(addend, left, right); + + /// + /// uint32x2_t vdot_u32 (uint32x2_t r, uint8x8_t a, uint8x8_t b) + /// A32: VUDOT.U8 Dd, Dn, Dm + /// A64: UDOT Vd.2S, Vn.8B, Vm.8B + /// + public static Vector64 DotProduct(Vector64 addend, Vector64 left, Vector64 right) => DotProduct(addend, left, right); + + /// + /// int32x4_t vdotq_s32 (int32x4_t r, int8x16_t a, int8x16_t b) + /// A32: VSDOT.S8 Qd, Qn, Qm + /// A64: SDOT Vd.4S, Vn.16B, Vm.16B + /// + public static Vector128 DotProduct(Vector128 addend, Vector128 left, Vector128 right) => DotProduct(addend, left, right); + + /// + /// uint32x4_t vdotq_u32 (uint32x4_t r, uint8x16_t a, uint8x16_t b) + /// A32: VUDOT.U8 Qd, Qn, Qm + /// A64: UDOT Vd.4S, Vn.16B, Vm.16B + /// + public static Vector128 DotProduct(Vector128 addend, Vector128 left, Vector128 right) => DotProduct(addend, left, right); + + /// + /// int32x2_t vdot_lane_s32 (int32x2_t r, int8x8_t a, int8x8_t b, const int lane) + /// A32: VSDOT.S8 Dd, Dn, Dm[lane] + /// A64: SDOT Vd.2S, Vn.8B, Vm.4B[lane] + /// + public static Vector64 DotProductBySelectedQuadruplet(Vector64 addend, Vector64 left, Vector64 right, byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex); + + /// + /// int32x2_t vdot_laneq_s32 (int32x2_t r, int8x8_t a, int8x16_t b, const int lane) + /// A32: VSDOT.S8 Dd, Dn, Dm[lane] + /// A64: SDOT Vd.2S, Vn.8B, Vm.4B[lane] + /// + public static Vector64 DotProductBySelectedQuadruplet(Vector64 addend, Vector64 left, Vector128 right, byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex); + + /// + /// uint32x2_t vdot_lane_u32 (uint32x2_t r, uint8x8_t a, uint8x8_t b, const int lane) + /// A32: VUDOT.U8 Dd, Dn, Dm[lane] + /// A64: UDOT Vd.2S, Vn.8B, Vm.4B[lane] + /// + public static Vector64 DotProductBySelectedQuadruplet(Vector64 addend, Vector64 left, Vector64 right, byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex); + + /// + /// uint32x2_t vdot_laneq_u32 (uint32x2_t r, uint8x8_t a, uint8x16_t b, const int lane) + /// A32: VUDOT.U8 Dd, Dn, Dm[lane] + /// A64: UDOT Vd.2S, Vn.8B, Vm.4B[lane] + /// + public static Vector64 DotProductBySelectedQuadruplet(Vector64 addend, Vector64 left, Vector128 right, byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex); + + /// + /// int32x4_t vdotq_laneq_s32 (int32x4_t r, int8x16_t a, int8x16_t b, const int lane) + /// A32: VSDOT.S8 Qd, Qn, Dm[lane] + /// A64: SDOT Vd.4S, Vn.16B, Vm.4B[lane] + /// + public static Vector128 DotProductBySelectedQuadruplet(Vector128 addend, Vector128 left, Vector128 right, byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex); + + /// + /// int32x4_t vdotq_lane_s32 (int32x4_t r, int8x16_t a, int8x8_t b, const int lane) + /// A32: VSDOT.S8 Qd, Qn, Dm[lane] + /// A64: SDOT Vd.4S, Vn.16B, Vm.4B[lane] + /// + public static Vector128 DotProductBySelectedQuadruplet(Vector128 addend, Vector128 left, Vector64 right, byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex); + + /// + /// uint32x4_t vdotq_laneq_u32 (uint32x4_t r, uint8x16_t a, uint8x16_t b, const int lane) + /// A32: VUDOT.U8 Qd, Qn, Dm[lane] + /// A64: UDOT Vd.4S, Vn.16B, Vm.4B[lane] + /// + public static Vector128 DotProductBySelectedQuadruplet(Vector128 addend, Vector128 left, Vector128 right, byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex); + + /// + /// uint32x4_t vdotq_lane_u32 (uint32x4_t r, uint8x16_t a, uint8x8_t b, const int lane) + /// A32: VUDOT.U8 Qd, Qn, Dm[lane] + /// A64: UDOT Vd.4S, Vn.16B, Vm.4B[lane] + /// + public static Vector128 DotProductBySelectedQuadruplet(Vector128 addend, Vector128 left, Vector64 right, byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex); + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Rdm.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Rdm.PlatformNotSupported.cs new file mode 100644 index 000000000000..0c91d3ba1153 --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Rdm.PlatformNotSupported.cs @@ -0,0 +1,267 @@ +// 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. + +#pragma warning disable IDE0060 // unused parameters +using System.Runtime.CompilerServices; + +namespace System.Runtime.Intrinsics.Arm +{ + /// + /// This class provides access to the ARMv8.1-RDMA hardware instructions via intrinsics + /// + [CLSCompliant(false)] + public abstract class Rdm : AdvSimd + { + internal Rdm() { } + + public static new bool IsSupported { [Intrinsic] get => false; } + + public new abstract class Arm64 : AdvSimd.Arm64 + { + internal Arm64() { } + + public static new bool IsSupported { [Intrinsic] get { return false; } } + + /// + /// int16_t vqrdmlahh_s16 (int16_t a, int16_t b, int16_t c) + /// A64: SQRDMLAH Hd, Hn, Hm + /// + public static Vector64 MultiplyRoundedDoublingAndAddSaturateHighScalar(Vector64 addend, Vector64 left, Vector64 right) { throw new PlatformNotSupportedException(); } + + /// + /// int32_t vqrdmlahs_s32 (int32_t a, int32_t b, int32_t c) + /// A64: SQRDMLAH Sd, Sn, Sm + /// + public static Vector64 MultiplyRoundedDoublingAndAddSaturateHighScalar(Vector64 addend, Vector64 left, Vector64 right) { throw new PlatformNotSupportedException(); } + + /// + /// int16_t vqrdmlshh_s16 (int16_t a, int16_t b, int16_t c) + /// A64: SQRDMLSH Hd, Hn, Hm + /// + public static Vector64 MultiplyRoundedDoublingAndSubtractSaturateHighScalar(Vector64 addend, Vector64 left, Vector64 right) { throw new PlatformNotSupportedException(); } + + /// + /// int32_t vqrdmlshs_s32 (int32_t a, int32_t b, int32_t c) + /// A64: SQRDMLSH Sd, Sn, Sm + /// + public static Vector64 MultiplyRoundedDoublingAndSubtractSaturateHighScalar(Vector64 addend, Vector64 left, Vector64 right) { throw new PlatformNotSupportedException(); } + + /// + /// int16_t vqrdmlahh_lane_s16 (int16_t a, int16_t b, int16x4_t v, const int lane) + /// A64: SQRDMLAH Hd, Hn, Vm.H[lane] + /// + public static Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector64 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int16_t vqrdmlahh_laneq_s16 (int16_t a, int16_t b, int16x8_t v, const int lane) + /// A64: SQRDMLAH Hd, Hn, Vm.H[lane] + /// + public static Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector128 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int32_t vqrdmlahs_lane_s32 (int32_t a, int32_t b, int32x2_t v, const int lane) + /// A64: SQRDMLAH Sd, Sn, Vm.S[lane] + /// + public static Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector64 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int32_t vqrdmlahs_laneq_s32 (int32_t a, int32_t b, int32x4_t v, const int lane) + /// A64: SQRDMLAH Sd, Sn, Vm.S[lane] + /// + public static Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector128 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int16_t vqrdmlshh_lane_s16 (int16_t a, int16_t b, int16x4_t v, const int lane) + /// A64: SQRDMLSH Hd, Hn, Vm.H[lane] + /// + public static Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector64 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int16_t vqrdmlshh_laneq_s16 (int16_t a, int16_t b, int16x8_t v, const int lane) + /// A64: SQRDMLSH Hd, Hn, Vm.H[lane] + /// + public static Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector128 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int32_t vqrdmlshs_lane_s32 (int32_t a, int32_t b, int32x2_t v, const int lane) + /// A64: SQRDMLSH Sd, Sn, Vm.S[lane] + /// + public static Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector64 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int32_t vqrdmlshs_laneq_s32 (int32_t a, int32_t b, int32x4_t v, const int lane) + /// A64: SQRDMLSH Sd, Sn, Vm.S[lane] + /// + public static Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector128 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + } + + /// + /// int16x4_t vqrdmlah_s16 (int16x4_t a, int16x4_t b, int16x4_t c) + /// A32: VQRDMLAH.S16 Dd, Dn, Dm + /// A64: SQRDMLAH Vd.4H, Vn.4H, Vm.4H + /// + public static Vector64 MultiplyRoundedDoublingAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector64 right) { throw new PlatformNotSupportedException(); } + + /// + /// int32x2_t vqrdmlah_s32 (int32x2_t a, int32x2_t b, int32x2_t c) + /// A32: VQRDMLAH.S32 Dd, Dn, Dm + /// A64: SQRDMLAH Vd.2S, Vn.2S, Vm.2S + /// + public static Vector64 MultiplyRoundedDoublingAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector64 right) { throw new PlatformNotSupportedException(); } + + /// + /// int16x8_t vqrdmlahq_s16 (int16x8_t a, int16x8_t b, int16x8_t c) + /// A32: VQRDMLAH.S16 Qd, Qn, Qm + /// A64: SQRDMLAH Vd.8H, Vn.8H, Vm.8H + /// + public static Vector128 MultiplyRoundedDoublingAndAddSaturateHigh(Vector128 addend, Vector128 left, Vector128 right) { throw new PlatformNotSupportedException(); } + + /// + /// int32x4_t vqrdmlahq_s32 (int32x4_t a, int32x4_t b, int32x4_t c) + /// A32: VQRDMLAH.S32 Qd, Qn, Qm + /// A64: SQRDMLAH Vd.4S, Vn.4S, Vm.4S + /// + public static Vector128 MultiplyRoundedDoublingAndAddSaturateHigh(Vector128 addend, Vector128 left, Vector128 right) { throw new PlatformNotSupportedException(); } + + /// + /// int16x4_t vqrdmlsh_s16 (int16x4_t a, int16x4_t b, int16x4_t c) + /// A32: VQRDMLSH.S16 Dd, Dn, Dm + /// A64: SQRDMLSH Vd.4H, Vn.4H, Vm.4H + /// + public static Vector64 MultiplyRoundedDoublingAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector64 right) { throw new PlatformNotSupportedException(); } + + /// + /// int32x2_t vqrdmlsh_s32 (int32x2_t a, int32x2_t b, int32x2_t c) + /// A32: VQRDMLSH.S32 Dd, Dn, Dm + /// A64: SQRDMLSH Vd.2S, Vn.2S, Vm.2S + /// + public static Vector64 MultiplyRoundedDoublingAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector64 right) { throw new PlatformNotSupportedException(); } + + /// + /// int16x8_t vqrdmlshq_s16 (int16x8_t a, int16x8_t b, int16x8_t c) + /// A32: VQRDMLSH.S16 Qd, Qn, Qm + /// A64: SQRDMLSH Vd.8H, Vn.8H, Vm.8H + /// + public static Vector128 MultiplyRoundedDoublingAndSubtractSaturateHigh(Vector128 minuend, Vector128 left, Vector128 right) { throw new PlatformNotSupportedException(); } + + /// + /// int32x4_t vqrdmlshq_s32 (int32x4_t a, int32x4_t b, int32x4_t c) + /// A32: VQRDMLSH.S32 Qd, Qn, Qm + /// A64: SQRDMLSH Vd.4S, Vn.4S, Vm.4S + /// + public static Vector128 MultiplyRoundedDoublingAndSubtractSaturateHigh(Vector128 minuend, Vector128 left, Vector128 right) { throw new PlatformNotSupportedException(); } + + /// + /// int16x4_t vqrdmlah_lane_s16 (int16x4_t a, int16x4_t b, int16x4_t v, const int lane) + /// A32: VQRDMLAH.S16 Dd, Dn, Dm[lane] + /// A64: SQRDMLAH Vd.4H, Vn.4H, Vm.H[lane] + /// + public static Vector64 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector64 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int16x4_t vqrdmlah_laneq_s16 (int16x4_t a, int16x4_t b, int16x8_t v, const int lane) + /// A32: VQRDMLAH.S16 Dd, Dn, Dm[lane] + /// A64: SQRDMLAH Vd.4H, Vn.4H, Vm.H[lane] + /// + public static Vector64 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector128 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int32x2_t vqrdmlah_lane_s32 (int32x2_t a, int32x2_t b, int32x2_t v, const int lane) + /// A32: VQRDMLAH.S32 Dd, Dn, Dm[lane] + /// A64: SQRDMLAH Vd.2S, Vn.2S, Vm.S[lane] + /// + public static Vector64 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector64 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int32x2_t vqrdmlah_laneq_s32 (int32x2_t a, int32x2_t b, int32x4_t v, const int lane) + /// A32: VQRDMLAH.S32 Dd, Dn, Dm[lane] + /// A64: SQRDMLAH Vd.2S, Vn.2S, Vm.S[lane] + /// + public static Vector64 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector128 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int16x8_t vqrdmlahq_lane_s16 (int16x8_t a, int16x8_t b, int16x4_t v, const int lane) + /// A32: VQRDMLAH.S16 Qd, Qn, Dm[lane] + /// A64: SQRDMLAH Vd.8H, Vn.8H, Vm.H[lane] + /// + public static Vector128 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(Vector128 addend, Vector128 left, Vector64 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int16x8_t vqrdmlahq_laneq_s16 (int16x8_t a, int16x8_t b, int16x8_t v, const int lane) + /// A32: VQRDMLAH.S16 Qd, Qn, Dm[lane] + /// A64: SQRDMLAH Vd.8H, Vn.8H, Vm.H[lane] + /// + public static Vector128 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(Vector128 addend, Vector128 left, Vector128 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int32x4_t vqrdmlahq_lane_s32 (int32x4_t a, int32x4_t b, int32x2_t v, const int lane) + /// A32: VQRDMLAH.S32 Qd, Qn, Dm[lane] + /// A64: SQRDMLAH Vd.4S, Vn.4S, Vm.S[lane] + /// + public static Vector128 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(Vector128 addend, Vector128 left, Vector64 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int32x4_t vqrdmlahq_laneq_s32 (int32x4_t a, int32x4_t b, int32x4_t v, const int lane) + /// A32: VQRDMLAH.S32 Qd, Qn, Dm[lane] + /// A64: SQRDMLAH Vd.4S, Vn.4S, Vm.S[lane] + /// + public static Vector128 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(Vector128 addend, Vector128 left, Vector128 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int16x4_t vqrdmlsh_lane_s16 (int16x4_t a, int16x4_t b, int16x4_t v, const int lane) + /// A32: VQRDMLSH.S16 Dd, Dn, Dm[lane] + /// A64: SQRDMLSH Vd.4H, Vn.4H, Vm.H[lane] + /// + public static Vector64 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector64 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int16x4_t vqrdmlsh_laneq_s16 (int16x4_t a, int16x4_t b, int16x8_t v, const int lane) + /// A32: VQRDMLSH.S16 Dd, Dn, Dm[lane] + /// A64: SQRDMLSH Vd.4H, Vn.4H, Vm.H[lane] + /// + public static Vector64 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector128 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int32x2_t vqrdmlsh_lane_s32 (int32x2_t a, int32x2_t b, int32x2_t v, const int lane) + /// A32: VQRDMLSH.S32 Dd, Dn, Dm[lane] + /// A64: SQRDMLSH Vd.2S, Vn.2S, Vm.S[lane] + /// + public static Vector64 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector64 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int32x2_t vqrdmlsh_laneq_s32 (int32x2_t a, int32x2_t b, int32x4_t v, const int lane) + /// A32: VQRDMLSH.S32 Dd, Dn, Dm[lane] + /// A64: SQRDMLSH Vd.2S, Vn.2S, Vm.S[lane] + /// + public static Vector64 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector128 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int16x8_t vqrdmlshq_lane_s16 (int16x8_t a, int16x8_t b, int16x4_t v, const int lane) + /// A32: VQRDMLSH.S16 Qd, Qn, Dm[lane] + /// A64: SQRDMLSH Vd.8H, Vn.8H, Vm.H[lane] + /// + public static Vector128 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(Vector128 minuend, Vector128 left, Vector64 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int16x8_t vqrdmlshq_laneq_s16 (int16x8_t a, int16x8_t b, int16x8_t v, const int lane) + /// A32: VQRDMLSH.S16 Qd, Qn, Dm[lane] + /// A64: SQRDMLSH Vd.8H, Vn.8H, Vm.H[lane] + /// + public static Vector128 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(Vector128 minuend, Vector128 left, Vector128 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int32x4_t vqrdmlshq_lane_s32 (int32x4_t a, int32x4_t b, int32x2_t v, const int lane) + /// A32: VQRDMLSH.S32 Qd, Qn, Dm[lane] + /// A64: SQRDMLSH Vd.4S, Vn.4S, Vm.S[lane] + /// + public static Vector128 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(Vector128 minuend, Vector128 left, Vector64 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// int32x4_t vqrdmlshq_laneq_s32 (int32x4_t a, int32x4_t b, int32x4_t v, const int lane) + /// A32: VQRDMLSH.S32 Qd, Qn, Dm[lane] + /// A64: SQRDMLSH Vd.4S, Vn.4S, Vm.S[lane] + /// + public static Vector128 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(Vector128 minuend, Vector128 left, Vector128 right, byte rightIndex) { throw new PlatformNotSupportedException(); } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Rdm.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Rdm.cs new file mode 100644 index 000000000000..3d37ecf93fe0 --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Rdm.cs @@ -0,0 +1,268 @@ +// 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.Runtime.CompilerServices; + +namespace System.Runtime.Intrinsics.Arm +{ + /// + /// This class provides access to the ARMv8.1-RDMA hardware instructions via intrinsics + /// + [Intrinsic] + [CLSCompliant(false)] + public abstract class Rdm : AdvSimd + { + internal Rdm() { } + + public static new bool IsSupported { get => IsSupported; } + + [Intrinsic] + public new abstract class Arm64 : AdvSimd.Arm64 + { + internal Arm64() { } + + public static new bool IsSupported { get => IsSupported; } + + /// + /// int16_t vqrdmlahh_s16 (int16_t a, int16_t b, int16_t c) + /// A64: SQRDMLAH Hd, Hn, Hm + /// + public static Vector64 MultiplyRoundedDoublingAndAddSaturateHighScalar(Vector64 addend, Vector64 left, Vector64 right) => MultiplyRoundedDoublingAndAddSaturateHighScalar(addend, left, right); + + /// + /// int32_t vqrdmlahs_s32 (int32_t a, int32_t b, int32_t c) + /// A64: SQRDMLAH Sd, Sn, Sm + /// + public static Vector64 MultiplyRoundedDoublingAndAddSaturateHighScalar(Vector64 addend, Vector64 left, Vector64 right) => MultiplyRoundedDoublingAndAddSaturateHighScalar(addend, left, right); + + /// + /// int16_t vqrdmlshh_s16 (int16_t a, int16_t b, int16_t c) + /// A64: SQRDMLSH Hd, Hn, Hm + /// + public static Vector64 MultiplyRoundedDoublingAndSubtractSaturateHighScalar(Vector64 addend, Vector64 left, Vector64 right) => MultiplyRoundedDoublingAndSubtractSaturateHighScalar(addend, left, right); + + /// + /// int32_t vqrdmlshs_s32 (int32_t a, int32_t b, int32_t c) + /// A64: SQRDMLSH Sd, Sn, Sm + /// + public static Vector64 MultiplyRoundedDoublingAndSubtractSaturateHighScalar(Vector64 addend, Vector64 left, Vector64 right) => MultiplyRoundedDoublingAndSubtractSaturateHighScalar(addend, left, right); + + /// + /// int16_t vqrdmlahh_lane_s16 (int16_t a, int16_t b, int16x4_t v, const int lane) + /// A64: SQRDMLAH Hd, Hn, Vm.H[lane] + /// + public static Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector64 right, byte rightIndex) => MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(addend, left, right, rightIndex); + + /// + /// int16_t vqrdmlahh_laneq_s16 (int16_t a, int16_t b, int16x8_t v, const int lane) + /// A64: SQRDMLAH Hd, Hn, Vm.H[lane] + /// + public static Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector128 right, byte rightIndex) => MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(addend, left, right, rightIndex); + + /// + /// int32_t vqrdmlahs_lane_s32 (int32_t a, int32_t b, int32x2_t v, const int lane) + /// A64: SQRDMLAH Sd, Sn, Vm.S[lane] + /// + public static Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector64 right, byte rightIndex) => MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(addend, left, right, rightIndex); + + /// + /// int32_t vqrdmlahs_laneq_s32 (int32_t a, int32_t b, int32x4_t v, const int lane) + /// A64: SQRDMLAH Sd, Sn, Vm.S[lane] + /// + public static Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector128 right, byte rightIndex) => MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(addend, left, right, rightIndex); + + /// + /// int16_t vqrdmlshh_lane_s16 (int16_t a, int16_t b, int16x4_t v, const int lane) + /// A64: SQRDMLSH Hd, Hn, Vm.H[lane] + /// + public static Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector64 right, byte rightIndex) => MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(minuend, left, right, rightIndex); + + /// + /// int16_t vqrdmlshh_laneq_s16 (int16_t a, int16_t b, int16x8_t v, const int lane) + /// A64: SQRDMLSH Hd, Hn, Vm.H[lane] + /// + public static Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector128 right, byte rightIndex) => MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(minuend, left, right, rightIndex); + + /// + /// int32_t vqrdmlshs_lane_s32 (int32_t a, int32_t b, int32x2_t v, const int lane) + /// A64: SQRDMLSH Sd, Sn, Vm.S[lane] + /// + public static Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector64 right, byte rightIndex) => MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(minuend, left, right, rightIndex); + + /// + /// int32_t vqrdmlshs_laneq_s32 (int32_t a, int32_t b, int32x4_t v, const int lane) + /// A64: SQRDMLSH Sd, Sn, Vm.S[lane] + /// + public static Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector128 right, byte rightIndex) => MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(minuend, left, right, rightIndex); + } + + /// + /// int16x4_t vqrdmlah_s16 (int16x4_t a, int16x4_t b, int16x4_t c) + /// A32: VQRDMLAH.S16 Dd, Dn, Dm + /// A64: SQRDMLAH Vd.4H, Vn.4H, Vm.4H + /// + public static Vector64 MultiplyRoundedDoublingAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector64 right) => MultiplyRoundedDoublingAndAddSaturateHigh(addend, left, right); + + /// + /// int32x2_t vqrdmlah_s32 (int32x2_t a, int32x2_t b, int32x2_t c) + /// A32: VQRDMLAH.S32 Dd, Dn, Dm + /// A64: SQRDMLAH Vd.2S, Vn.2S, Vm.2S + /// + public static Vector64 MultiplyRoundedDoublingAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector64 right) => MultiplyRoundedDoublingAndAddSaturateHigh(addend, left, right); + + /// + /// int16x8_t vqrdmlahq_s16 (int16x8_t a, int16x8_t b, int16x8_t c) + /// A32: VQRDMLAH.S16 Qd, Qn, Qm + /// A64: SQRDMLAH Vd.8H, Vn.8H, Vm.8H + /// + public static Vector128 MultiplyRoundedDoublingAndAddSaturateHigh(Vector128 addend, Vector128 left, Vector128 right) => MultiplyRoundedDoublingAndAddSaturateHigh(addend, left, right); + + /// + /// int32x4_t vqrdmlahq_s32 (int32x4_t a, int32x4_t b, int32x4_t c) + /// A32: VQRDMLAH.S32 Qd, Qn, Qm + /// A64: SQRDMLAH Vd.4S, Vn.4S, Vm.4S + /// + public static Vector128 MultiplyRoundedDoublingAndAddSaturateHigh(Vector128 addend, Vector128 left, Vector128 right) => MultiplyRoundedDoublingAndAddSaturateHigh(addend, left, right); + + /// + /// int16x4_t vqrdmlsh_s16 (int16x4_t a, int16x4_t b, int16x4_t c) + /// A32: VQRDMLSH.S16 Dd, Dn, Dm + /// A64: SQRDMLSH Vd.4H, Vn.4H, Vm.4H + /// + public static Vector64 MultiplyRoundedDoublingAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector64 right) => MultiplyRoundedDoublingAndSubtractSaturateHigh(minuend, left, right); + + /// + /// int32x2_t vqrdmlsh_s32 (int32x2_t a, int32x2_t b, int32x2_t c) + /// A32: VQRDMLSH.S32 Dd, Dn, Dm + /// A64: SQRDMLSH Vd.2S, Vn.2S, Vm.2S + /// + public static Vector64 MultiplyRoundedDoublingAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector64 right) => MultiplyRoundedDoublingAndSubtractSaturateHigh(minuend, left, right); + + /// + /// int16x8_t vqrdmlshq_s16 (int16x8_t a, int16x8_t b, int16x8_t c) + /// A32: VQRDMLSH.S16 Qd, Qn, Qm + /// A64: SQRDMLSH Vd.8H, Vn.8H, Vm.8H + /// + public static Vector128 MultiplyRoundedDoublingAndSubtractSaturateHigh(Vector128 minuend, Vector128 left, Vector128 right) => MultiplyRoundedDoublingAndSubtractSaturateHigh(minuend, left, right); + + /// + /// int32x4_t vqrdmlshq_s32 (int32x4_t a, int32x4_t b, int32x4_t c) + /// A32: VQRDMLSH.S32 Qd, Qn, Qm + /// A64: SQRDMLSH Vd.4S, Vn.4S, Vm.4S + /// + public static Vector128 MultiplyRoundedDoublingAndSubtractSaturateHigh(Vector128 minuend, Vector128 left, Vector128 right) => MultiplyRoundedDoublingAndSubtractSaturateHigh(minuend, left, right); + + /// + /// int16x4_t vqrdmlah_lane_s16 (int16x4_t a, int16x4_t b, int16x4_t v, const int lane) + /// A32: VQRDMLAH.S16 Dd, Dn, Dm[lane] + /// A64: SQRDMLAH Vd.4H, Vn.4H, Vm.H[lane] + /// + public static Vector64 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector64 right, byte rightIndex) => MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(addend, left, right, rightIndex); + + /// + /// int16x4_t vqrdmlah_laneq_s16 (int16x4_t a, int16x4_t b, int16x8_t v, const int lane) + /// A32: VQRDMLAH.S16 Dd, Dn, Dm[lane] + /// A64: SQRDMLAH Vd.4H, Vn.4H, Vm.H[lane] + /// + public static Vector64 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector128 right, byte rightIndex) => MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(addend, left, right, rightIndex); + + /// + /// int32x2_t vqrdmlah_lane_s32 (int32x2_t a, int32x2_t b, int32x2_t v, const int lane) + /// A32: VQRDMLAH.S32 Dd, Dn, Dm[lane] + /// A64: SQRDMLAH Vd.2S, Vn.2S, Vm.S[lane] + /// + public static Vector64 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector64 right, byte rightIndex) => MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(addend, left, right, rightIndex); + + /// + /// int32x2_t vqrdmlah_laneq_s32 (int32x2_t a, int32x2_t b, int32x4_t v, const int lane) + /// A32: VQRDMLAH.S32 Dd, Dn, Dm[lane] + /// A64: SQRDMLAH Vd.2S, Vn.2S, Vm.S[lane] + /// + public static Vector64 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(Vector64 addend, Vector64 left, Vector128 right, byte rightIndex) => MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(addend, left, right, rightIndex); + + /// + /// int16x8_t vqrdmlahq_lane_s16 (int16x8_t a, int16x8_t b, int16x4_t v, const int lane) + /// A32: VQRDMLAH.S16 Qd, Qn, Dm[lane] + /// A64: SQRDMLAH Vd.8H, Vn.8H, Vm.H[lane] + /// + public static Vector128 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(Vector128 addend, Vector128 left, Vector64 right, byte rightIndex) => MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(addend, left, right, rightIndex); + + /// + /// int16x8_t vqrdmlahq_laneq_s16 (int16x8_t a, int16x8_t b, int16x8_t v, const int lane) + /// A32: VQRDMLAH.S16 Qd, Qn, Dm[lane] + /// A64: SQRDMLAH Vd.8H, Vn.8H, Vm.H[lane] + /// + public static Vector128 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(Vector128 addend, Vector128 left, Vector128 right, byte rightIndex) => MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(addend, left, right, rightIndex); + + /// + /// int32x4_t vqrdmlahq_lane_s32 (int32x4_t a, int32x4_t b, int32x2_t v, const int lane) + /// A32: VQRDMLAH.S32 Qd, Qn, Dm[lane] + /// A64: SQRDMLAH Vd.4S, Vn.4S, Vm.S[lane] + /// + public static Vector128 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(Vector128 addend, Vector128 left, Vector64 right, byte rightIndex) => MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(addend, left, right, rightIndex); + + /// + /// int32x4_t vqrdmlahq_laneq_s32 (int32x4_t a, int32x4_t b, int32x4_t v, const int lane) + /// A32: VQRDMLAH.S32 Qd, Qn, Dm[lane] + /// A64: SQRDMLAH Vd.4S, Vn.4S, Vm.S[lane] + /// + public static Vector128 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(Vector128 addend, Vector128 left, Vector128 right, byte rightIndex) => MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(addend, left, right, rightIndex); + + /// + /// int16x4_t vqrdmlsh_lane_s16 (int16x4_t a, int16x4_t b, int16x4_t v, const int lane) + /// A32: VQRDMLSH.S16 Dd, Dn, Dm[lane] + /// A64: SQRDMLSH Vd.4H, Vn.4H, Vm.H[lane] + /// + public static Vector64 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector64 right, byte rightIndex) => MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(minuend, left, right, rightIndex); + + /// + /// int16x4_t vqrdmlsh_laneq_s16 (int16x4_t a, int16x4_t b, int16x8_t v, const int lane) + /// A32: VQRDMLSH.S16 Dd, Dn, Dm[lane] + /// A64: SQRDMLSH Vd.4H, Vn.4H, Vm.H[lane] + /// + public static Vector64 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector128 right, byte rightIndex) => MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(minuend, left, right, rightIndex); + + /// + /// int32x2_t vqrdmlsh_lane_s32 (int32x2_t a, int32x2_t b, int32x2_t v, const int lane) + /// A32: VQRDMLSH.S32 Dd, Dn, Dm[lane] + /// A64: SQRDMLSH Vd.2S, Vn.2S, Vm.S[lane] + /// + public static Vector64 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector64 right, byte rightIndex) => MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(minuend, left, right, rightIndex); + + /// + /// int32x2_t vqrdmlsh_laneq_s32 (int32x2_t a, int32x2_t b, int32x4_t v, const int lane) + /// A32: VQRDMLSH.S32 Dd, Dn, Dm[lane] + /// A64: SQRDMLSH Vd.2S, Vn.2S, Vm.S[lane] + /// + public static Vector64 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(Vector64 minuend, Vector64 left, Vector128 right, byte rightIndex) => MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(minuend, left, right, rightIndex); + + /// + /// int16x8_t vqrdmlshq_lane_s16 (int16x8_t a, int16x8_t b, int16x4_t v, const int lane) + /// A32: VQRDMLSH.S16 Qd, Qn, Dm[lane] + /// A64: SQRDMLSH Vd.8H, Vn.8H, Vm.H[lane] + /// + public static Vector128 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(Vector128 minuend, Vector128 left, Vector64 right, byte rightIndex) => MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(minuend, left, right, rightIndex); + + /// + /// int16x8_t vqrdmlshq_laneq_s16 (int16x8_t a, int16x8_t b, int16x8_t v, const int lane) + /// A32: VQRDMLSH.S16 Qd, Qn, Dm[lane] + /// A64: SQRDMLSH Vd.8H, Vn.8H, Vm.H[lane] + /// + public static Vector128 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(Vector128 minuend, Vector128 left, Vector128 right, byte rightIndex) => MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(minuend, left, right, rightIndex); + + /// + /// int32x4_t vqrdmlshq_lane_s32 (int32x4_t a, int32x4_t b, int32x2_t v, const int lane) + /// A32: VQRDMLSH.S32 Qd, Qn, Dm[lane] + /// A64: SQRDMLSH Vd.4S, Vn.4S, Vm.S[lane] + /// + public static Vector128 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(Vector128 minuend, Vector128 left, Vector64 right, byte rightIndex) => MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(minuend, left, right, rightIndex); + + /// + /// int32x4_t vqrdmlshq_laneq_s32 (int32x4_t a, int32x4_t b, int32x4_t v, const int lane) + /// A32: VQRDMLSH.S32 Qd, Qn, Dm[lane] + /// A64: SQRDMLSH Vd.4S, Vn.4S, Vm.S[lane] + /// + public static Vector128 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(Vector128 minuend, Vector128 left, Vector128 right, byte rightIndex) => MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(minuend, left, right, rightIndex); + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Serialization/SerializationInfo.SerializationGuard.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Serialization/SerializationInfo.SerializationGuard.cs new file mode 100644 index 000000000000..cc664071f0d5 --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Serialization/SerializationInfo.SerializationGuard.cs @@ -0,0 +1,139 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Security; +using System.Threading; + +namespace System.Runtime.Serialization +{ + /// The structure for holding all of the data needed for object serialization and deserialization. + public sealed partial class SerializationInfo + { + internal static AsyncLocal AsyncDeserializationInProgress { get; } = new AsyncLocal(); + +#if !CORECLR + // On AoT, assume private members are reflection blocked, so there's no further protection required + // for the thread's DeserializationTracker + [ThreadStatic] + private static DeserializationTracker? t_deserializationTracker; + + private static DeserializationTracker GetThreadDeserializationTracker() => + t_deserializationTracker ??= new DeserializationTracker(); +#endif // !CORECLR + + // Returns true if deserialization is currently in progress + public static bool DeserializationInProgress + { +#if CORECLR + [DynamicSecurityMethod] // Methods containing StackCrawlMark local var must be marked DynamicSecurityMethod +#endif + get + { + if (AsyncDeserializationInProgress.Value) + { + return true; + } + +#if CORECLR + StackCrawlMark stackMark = StackCrawlMark.LookForMe; + DeserializationTracker tracker = Thread.GetThreadDeserializationTracker(ref stackMark); +#else + DeserializationTracker tracker = GetThreadDeserializationTracker(); +#endif + bool result = tracker.DeserializationInProgress; + return result; + } + } + + // Throws a SerializationException if dangerous deserialization is currently + // in progress + public static void ThrowIfDeserializationInProgress() + { + if (DeserializationInProgress) + { + throw new SerializationException(SR.Serialization_DangerousDeserialization); + } + } + + // Throws a DeserializationBlockedException if dangerous deserialization is currently + // in progress and the AppContext switch Switch.System.Runtime.Serialization.SerializationGuard.{switchSuffix} + // is not true. The value of the switch is cached in cachedValue to avoid repeated lookups: + // 0: No value cached + // 1: The switch is true + // -1: The switch is false + public static void ThrowIfDeserializationInProgress(string switchSuffix, ref int cachedValue) + { + const string SwitchPrefix = "Switch.System.Runtime.Serialization.SerializationGuard."; + if (switchSuffix == null) + { + throw new ArgumentNullException(nameof(switchSuffix)); + } + if (string.IsNullOrWhiteSpace(switchSuffix)) + { + throw new ArgumentException(SR.Argument_EmptyName, nameof(switchSuffix)); + } + + if (cachedValue == 0) + { + if (AppContext.TryGetSwitch(SwitchPrefix + switchSuffix, out bool isEnabled) && isEnabled) + { + cachedValue = 1; + } + else + { + cachedValue = -1; + } + } + + if (cachedValue == 1) + { + return; + } + else if (cachedValue == -1) + { + if (DeserializationInProgress) + { + throw new SerializationException(SR.Format(SR.Serialization_DangerousDeserialization_Switch, SwitchPrefix + switchSuffix)); + } + } + else + { + throw new ArgumentOutOfRangeException(nameof(cachedValue)); + } + } + + // Declares that the current thread and async context have begun deserialization. + // In this state, if the SerializationGuard or other related AppContext switches are set, + // actions likely to be dangerous during deserialization, such as starting a process will be blocked. + // Returns a DeserializationToken that must be disposed to remove the deserialization state. +#if CORECLR + [DynamicSecurityMethod] // Methods containing StackCrawlMark local var must be marked DynamicSecurityMethod +#endif + public static DeserializationToken StartDeserialization() + { + if (LocalAppContextSwitches.SerializationGuard) + { +#if CORECLR + StackCrawlMark stackMark = StackCrawlMark.LookForMe; + DeserializationTracker tracker = Thread.GetThreadDeserializationTracker(ref stackMark); +#else + DeserializationTracker tracker = GetThreadDeserializationTracker(); +#endif + if (!tracker.DeserializationInProgress) + { + lock (tracker) + { + if (!tracker.DeserializationInProgress) + { + AsyncDeserializationInProgress.Value = true; + tracker.DeserializationInProgress = true; + return new DeserializationToken(tracker); + } + } + } + } + + return new DeserializationToken(null); + } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Serialization/SerializationInfo.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Serialization/SerializationInfo.cs index 0f7eb977dca0..ccc7bd66a05d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Serialization/SerializationInfo.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Serialization/SerializationInfo.cs @@ -3,13 +3,11 @@ using System.Collections.Generic; using System.Diagnostics; -using System.Security; -using System.Threading; namespace System.Runtime.Serialization { /// The structure for holding all of the data needed for object serialization and deserialization. - public sealed class SerializationInfo + public sealed partial class SerializationInfo { private const int DefaultSize = 4; @@ -25,133 +23,6 @@ public sealed class SerializationInfo private string _rootTypeAssemblyName; private Type _rootType; - internal static AsyncLocal AsyncDeserializationInProgress { get; } = new AsyncLocal(); - -#if !CORECLR - // On AoT, assume private members are reflection blocked, so there's no further protection required - // for the thread's DeserializationTracker - [ThreadStatic] - private static DeserializationTracker? t_deserializationTracker; - - private static DeserializationTracker GetThreadDeserializationTracker() => - t_deserializationTracker ??= new DeserializationTracker(); -#endif // !CORECLR - - // Returns true if deserialization is currently in progress - public static bool DeserializationInProgress - { -#if CORECLR - [DynamicSecurityMethod] // Methods containing StackCrawlMark local var must be marked DynamicSecurityMethod -#endif - get - { - if (AsyncDeserializationInProgress.Value) - { - return true; - } - -#if CORECLR - StackCrawlMark stackMark = StackCrawlMark.LookForMe; - DeserializationTracker tracker = Thread.GetThreadDeserializationTracker(ref stackMark); -#else - DeserializationTracker tracker = GetThreadDeserializationTracker(); -#endif - bool result = tracker.DeserializationInProgress; - return result; - } - } - - // Throws a SerializationException if dangerous deserialization is currently - // in progress - public static void ThrowIfDeserializationInProgress() - { - if (DeserializationInProgress) - { - throw new SerializationException(SR.Serialization_DangerousDeserialization); - } - } - - // Throws a DeserializationBlockedException if dangerous deserialization is currently - // in progress and the AppContext switch Switch.System.Runtime.Serialization.SerializationGuard.{switchSuffix} - // is not true. The value of the switch is cached in cachedValue to avoid repeated lookups: - // 0: No value cached - // 1: The switch is true - // -1: The switch is false - public static void ThrowIfDeserializationInProgress(string switchSuffix, ref int cachedValue) - { - const string SwitchPrefix = "Switch.System.Runtime.Serialization.SerializationGuard."; - if (switchSuffix == null) - { - throw new ArgumentNullException(nameof(switchSuffix)); - } - if (string.IsNullOrWhiteSpace(switchSuffix)) - { - throw new ArgumentException(SR.Argument_EmptyName, nameof(switchSuffix)); - } - - if (cachedValue == 0) - { - if (AppContext.TryGetSwitch(SwitchPrefix + switchSuffix, out bool isEnabled) && isEnabled) - { - cachedValue = 1; - } - else - { - cachedValue = -1; - } - } - - if (cachedValue == 1) - { - return; - } - else if (cachedValue == -1) - { - if (DeserializationInProgress) - { - throw new SerializationException(SR.Format(SR.Serialization_DangerousDeserialization_Switch, SwitchPrefix + switchSuffix)); - } - } - else - { - throw new ArgumentOutOfRangeException(nameof(cachedValue)); - } - } - - // Declares that the current thread and async context have begun deserialization. - // In this state, if the SerializationGuard or other related AppContext switches are set, - // actions likely to be dangerous during deserialization, such as starting a process will be blocked. - // Returns a DeserializationToken that must be disposed to remove the deserialization state. -#if CORECLR - [DynamicSecurityMethod] // Methods containing StackCrawlMark local var must be marked DynamicSecurityMethod -#endif - public static DeserializationToken StartDeserialization() - { - if (LocalAppContextSwitches.SerializationGuard) - { -#if CORECLR - StackCrawlMark stackMark = StackCrawlMark.LookForMe; - DeserializationTracker tracker = Thread.GetThreadDeserializationTracker(ref stackMark); -#else - DeserializationTracker tracker = GetThreadDeserializationTracker(); -#endif - if (!tracker.DeserializationInProgress) - { - lock (tracker) - { - if (!tracker.DeserializationInProgress) - { - AsyncDeserializationInProgress.Value = true; - tracker.DeserializationInProgress = true; - return new DeserializationToken(tracker); - } - } - } - } - - return new DeserializationToken(null); - } - [CLSCompliant(false)] public SerializationInfo(Type type, IFormatterConverter converter) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/MinimumOSPlatformAttribute.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/MinimumOSPlatformAttribute.cs deleted file mode 100644 index b5108ec7ec3d..000000000000 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/MinimumOSPlatformAttribute.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Runtime.Versioning -{ - /// - /// Records the operating system (and minimum version) that supports an API. Multiple attributes can be - /// applied to indicate support on multiple operating systems. - /// - /// - /// Callers can apply a - /// or use guards to prevent calls to APIs on unsupported operating systems. - /// - /// A given platform should only be specified once. - /// - [AttributeUsage(AttributeTargets.Assembly | - AttributeTargets.Class | - AttributeTargets.Constructor | - AttributeTargets.Event | - AttributeTargets.Method | - AttributeTargets.Module | - AttributeTargets.Property | - AttributeTargets.Struct, - AllowMultiple = true, Inherited = false)] - public sealed class MinimumOSPlatformAttribute : OSPlatformAttribute - { - public MinimumOSPlatformAttribute(string platformName) : base(platformName) - { - } - } -} diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/OSPlatformAttribute.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/OSPlatformAttribute.cs deleted file mode 100644 index c2cbda55c5e5..000000000000 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/OSPlatformAttribute.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Runtime.Versioning -{ - /// - /// Base type for all platform-specific API attributes. - /// -#pragma warning disable CS3015 // Type has no accessible constructors which use only CLS-compliant types - public abstract class OSPlatformAttribute : Attribute -#pragma warning restore CS3015 - { - private protected OSPlatformAttribute(string platformName) - { - PlatformName = platformName; - } - public string PlatformName { get; } - } -} diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/ObsoletedInOSPlatformAttribute.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/ObsoletedInOSPlatformAttribute.cs deleted file mode 100644 index 038562d5004f..000000000000 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/ObsoletedInOSPlatformAttribute.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Runtime.Versioning -{ - /// - /// Marks APIs that were obsoleted in a given operating system version. - /// - /// Primarily used by OS bindings to indicate APIs that should only be used in - /// earlier versions. - /// - [AttributeUsage(AttributeTargets.Assembly | - AttributeTargets.Class | - AttributeTargets.Constructor | - AttributeTargets.Event | - AttributeTargets.Method | - AttributeTargets.Module | - AttributeTargets.Property | - AttributeTargets.Struct, - AllowMultiple = true, Inherited = false)] - public sealed class ObsoletedInOSPlatformAttribute : OSPlatformAttribute - { - public ObsoletedInOSPlatformAttribute(string platformName) : base(platformName) - { - } - - public ObsoletedInOSPlatformAttribute(string platformName, string message) : base(platformName) - { - Message = message; - } - - public string? Message { get; } - public string? Url { get; set; } - } -} diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/PlatformAttributes.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/PlatformAttributes.cs new file mode 100644 index 000000000000..c230113c9b0f --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/PlatformAttributes.cs @@ -0,0 +1,142 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#nullable enable +namespace System.Runtime.Versioning +{ + /// + /// Base type for all platform-specific API attributes. + /// +#pragma warning disable CS3015 // Type has no accessible constructors which use only CLS-compliant types +#if SYSTEM_PRIVATE_CORELIB + public +#else + internal +#endif + abstract class OSPlatformAttribute : Attribute +#pragma warning restore CS3015 + { + private protected OSPlatformAttribute(string platformName) + { + PlatformName = platformName; + } + public string PlatformName { get; } + } + + /// + /// Records the platform that the project targeted. + /// + [AttributeUsage(AttributeTargets.Assembly, + AllowMultiple = false, Inherited = false)] +#if SYSTEM_PRIVATE_CORELIB + public +#else + internal +#endif + sealed class TargetPlatformAttribute : OSPlatformAttribute + { + public TargetPlatformAttribute(string platformName) : base(platformName) + { + } + } + + /// + /// Records the operating system (and minimum version) that supports an API. Multiple attributes can be + /// applied to indicate support on multiple operating systems. + /// + /// + /// Callers can apply a + /// or use guards to prevent calls to APIs on unsupported operating systems. + /// + /// A given platform should only be specified once. + /// + [AttributeUsage(AttributeTargets.Assembly | + AttributeTargets.Class | + AttributeTargets.Constructor | + AttributeTargets.Enum | + AttributeTargets.Event | + AttributeTargets.Field | + AttributeTargets.Method | + AttributeTargets.Module | + AttributeTargets.Property | + AttributeTargets.Struct, + AllowMultiple = true, Inherited = false)] +#if SYSTEM_PRIVATE_CORELIB + public +#else + internal +#endif + sealed class MinimumOSPlatformAttribute : OSPlatformAttribute + { + public MinimumOSPlatformAttribute(string platformName) : base(platformName) + { + } + } + + /// + /// Marks APIs that were obsoleted in a given operating system version. + /// + /// Primarily used by OS bindings to indicate APIs that should only be used in + /// earlier versions. + /// + [AttributeUsage(AttributeTargets.Assembly | + AttributeTargets.Class | + AttributeTargets.Constructor | + AttributeTargets.Enum | + AttributeTargets.Event | + AttributeTargets.Field | + AttributeTargets.Method | + AttributeTargets.Module | + AttributeTargets.Property | + AttributeTargets.Struct, + AllowMultiple = true, Inherited = false)] +#if SYSTEM_PRIVATE_CORELIB + public +#else + internal +#endif + sealed class ObsoletedInOSPlatformAttribute : OSPlatformAttribute + { + public ObsoletedInOSPlatformAttribute(string platformName) : base(platformName) + { + } + + public ObsoletedInOSPlatformAttribute(string platformName, string message) : base(platformName) + { + Message = message; + } + + public string? Message { get; } + public string? Url { get; set; } + } + + /// + /// Marks APIs that were removed in a given operating system version. + /// + /// + /// Primarily used by OS bindings to indicate APIs that are only available in + /// earlier versions. + /// + [AttributeUsage(AttributeTargets.Assembly | + AttributeTargets.Class | + AttributeTargets.Constructor | + AttributeTargets.Enum | + AttributeTargets.Event | + AttributeTargets.Field | + AttributeTargets.Method | + AttributeTargets.Module | + AttributeTargets.Property | + AttributeTargets.Struct, + AllowMultiple = true, Inherited = false)] +#if SYSTEM_PRIVATE_CORELIB + public +#else + internal +#endif + sealed class RemovedInOSPlatformAttribute : OSPlatformAttribute + { + public RemovedInOSPlatformAttribute(string platformName) : base(platformName) + { + } + } +} \ No newline at end of file diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/RemovedInOSPlatformAttribute.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/RemovedInOSPlatformAttribute.cs deleted file mode 100644 index b00569f5085f..000000000000 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/RemovedInOSPlatformAttribute.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Runtime.Versioning -{ - /// - /// Marks APIs that were removed in a given operating system version. - /// - /// - /// Primarily used by OS bindings to indicate APIs that are only available in - /// earlier versions. - /// - [AttributeUsage(AttributeTargets.Assembly | - AttributeTargets.Class | - AttributeTargets.Constructor | - AttributeTargets.Event | - AttributeTargets.Method | - AttributeTargets.Module | - AttributeTargets.Property | - AttributeTargets.Struct, - AllowMultiple = true, Inherited = false)] - public sealed class RemovedInOSPlatformAttribute : OSPlatformAttribute - { - public RemovedInOSPlatformAttribute(string platformName) : base(platformName) - { - } - } -} diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/TargetPlatformAttribute.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/TargetPlatformAttribute.cs deleted file mode 100644 index f3275306bace..000000000000 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Versioning/TargetPlatformAttribute.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Runtime.Versioning -{ - /// - /// Records the platform that the project targeted. - /// - [AttributeUsage(AttributeTargets.Assembly, - AllowMultiple = false, Inherited = false)] - public sealed class TargetPlatformAttribute : OSPlatformAttribute - { - public TargetPlatformAttribute(string platformName) : base(platformName) - { - } - } -} diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/ASCIIUtility.cs b/src/libraries/System.Private.CoreLib/src/System/Text/ASCIIUtility.cs index e85c1bb73220..7628f6f89b45 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/ASCIIUtility.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/ASCIIUtility.cs @@ -1460,6 +1460,7 @@ private static unsafe nuint NarrowUtf16ToAscii_Sse2(char* pUtf16Buffer, byte* pA /// public static unsafe nuint WidenAsciiToUtf16(byte* pAsciiBuffer, char* pUtf16Buffer, nuint elementCount) { + // Intrinsified in mono interpreter nuint currentOffset = 0; // If SSE2 is supported, use those specific intrinsics instead of the generic vectorized diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Rune.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Rune.cs index c4b3d6733fc6..f7dfd4c2c595 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Rune.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Rune.cs @@ -1169,7 +1169,7 @@ public static UnicodeCategory GetUnicodeCategory(Rune value) private static UnicodeCategory GetUnicodeCategoryNonAscii(Rune value) { Debug.Assert(!value.IsAscii, "Shouldn't use this non-optimized code path for ASCII characters."); -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) return CharUnicodeInfo.GetUnicodeCategory(value.Value); #else if (value.IsBmp) diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf16Utility.Validation.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf16Utility.Validation.cs index 395a887f9b42..cd4e6627d844 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf16Utility.Validation.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf16Utility.Validation.cs @@ -4,6 +4,7 @@ using System.Diagnostics; using System.Runtime.CompilerServices; using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; using System.Runtime.Intrinsics.X86; using System.Numerics; @@ -78,7 +79,7 @@ static Utf16Utility() long tempUtf8CodeUnitCountAdjustment = 0; int tempScalarCountAdjustment = 0; - if (Sse2.IsSupported) + if ((AdvSimd.Arm64.IsSupported && BitConverter.IsLittleEndian) || Sse2.IsSupported) { if (inputLength >= Vector128.Count) { @@ -86,18 +87,30 @@ static Utf16Utility() Vector128 vectorA800 = Vector128.Create((ushort)0xA800); Vector128 vector8800 = Vector128.Create(unchecked((short)0x8800)); Vector128 vectorZero = Vector128.Zero; - do { - Vector128 utf16Data = Sse2.LoadVector128((ushort*)pInputBuffer); // unaligned - uint mask; + Vector128 utf16Data; + if (AdvSimd.Arm64.IsSupported) + { + utf16Data = AdvSimd.LoadVector128((ushort*)pInputBuffer); // unaligned + } + else + { + utf16Data = Sse2.LoadVector128((ushort*)pInputBuffer); // unaligned + } Vector128 charIsNonAscii; - if (Sse41.IsSupported) + + if (AdvSimd.Arm64.IsSupported) + { + // Sets the 0x0080 bit of each element in 'charIsNonAscii' if the corresponding + // input was 0x0080 <= [value]. (i.e., [value] is non-ASCII.) + charIsNonAscii = AdvSimd.Min(utf16Data, vector0080); + } + else if (Sse41.IsSupported) { // Sets the 0x0080 bit of each element in 'charIsNonAscii' if the corresponding // input was 0x0080 <= [value]. (i.e., [value] is non-ASCII.) - charIsNonAscii = Sse41.Min(utf16Data, vector0080); } else @@ -111,16 +124,34 @@ static Utf16Utility() #if DEBUG // Quick check to ensure we didn't accidentally set the 0x8000 bit of any element. - uint debugMask = (uint)Sse2.MoveMask(charIsNonAscii.AsByte()); + uint debugMask; + if (AdvSimd.Arm64.IsSupported) + { + debugMask = GetNonAsciiBytes(charIsNonAscii.AsByte()); + } + else + { + debugMask = (uint)Sse2.MoveMask(charIsNonAscii.AsByte()); + } Debug.Assert((debugMask & 0b_1010_1010_1010_1010) == 0, "Shouldn't have set the 0x8000 bit of any element in 'charIsNonAscii'."); #endif // DEBUG // Sets the 0x8080 bits of each element in 'charIsNonAscii' if the corresponding // input was 0x0800 <= [value]. This also handles the missing range a few lines above. - Vector128 charIsThreeByteUtf8Encoded = Sse2.Subtract(vectorZero, Sse2.ShiftRightLogical(utf16Data, 11)); + Vector128 charIsThreeByteUtf8Encoded; + uint mask; - mask = (uint)Sse2.MoveMask(Sse2.Or(charIsNonAscii, charIsThreeByteUtf8Encoded).AsByte()); + if (AdvSimd.IsSupported) + { + charIsThreeByteUtf8Encoded = AdvSimd.Subtract(vectorZero, AdvSimd.ShiftRightLogical(utf16Data, 11)); + mask = GetNonAsciiBytes(AdvSimd.Or(charIsNonAscii, charIsThreeByteUtf8Encoded).AsByte()); + } + else + { + charIsThreeByteUtf8Encoded = Sse2.Subtract(vectorZero, Sse2.ShiftRightLogical(utf16Data, 11)); + mask = (uint)Sse2.MoveMask(Sse2.Or(charIsNonAscii, charIsThreeByteUtf8Encoded).AsByte()); + } // Each even bit of mask will be 1 only if the char was >= 0x0080, // and each odd bit of mask will be 1 only if the char was >= 0x0800. @@ -151,9 +182,16 @@ static Utf16Utility() // Surrogates need to be special-cased for two reasons: (a) we need // to account for the fact that we over-counted in the addition above; // and (b) they require separate validation. - - utf16Data = Sse2.Add(utf16Data, vectorA800); - mask = (uint)Sse2.MoveMask(Sse2.CompareLessThan(utf16Data.AsInt16(), vector8800).AsByte()); + if (AdvSimd.Arm64.IsSupported) + { + utf16Data = AdvSimd.Add(utf16Data, vectorA800); + mask = GetNonAsciiBytes(AdvSimd.CompareLessThan(utf16Data.AsInt16(), vector8800).AsByte()); + } + else + { + utf16Data = Sse2.Add(utf16Data, vectorA800); + mask = (uint)Sse2.MoveMask(Sse2.CompareLessThan(utf16Data.AsInt16(), vector8800).AsByte()); + } if (mask != 0) { @@ -178,7 +216,15 @@ static Utf16Utility() // Since 'mask' already has 00 in these positions (since the corresponding char // wasn't a surrogate), "mask AND mask2 == 00" holds for these positions. - uint mask2 = (uint)Sse2.MoveMask(Sse2.ShiftRightLogical(utf16Data, 3).AsByte()); + uint mask2; + if (AdvSimd.Arm64.IsSupported) + { + mask2 = GetNonAsciiBytes(AdvSimd.ShiftRightLogical(utf16Data, 3).AsByte()); + } + else + { + mask2 = (uint)Sse2.MoveMask(Sse2.ShiftRightLogical(utf16Data, 3).AsByte()); + } // 'lowSurrogatesMask' has its bits occur in pairs: // - 01 if the corresponding char was a low surrogate char, @@ -433,5 +479,24 @@ static Utf16Utility() scalarCountAdjustment = tempScalarCountAdjustment; return pInputBuffer; } + + private static readonly Vector128 s_bitMask128 = BitConverter.IsLittleEndian ? + Vector128.Create(0x80402010_08040201).AsByte() : + Vector128.Create(0x01020408_10204080).AsByte(); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static uint GetNonAsciiBytes(Vector128 value) + { + Debug.Assert(AdvSimd.Arm64.IsSupported); + + Vector128 mostSignificantBitIsSet = AdvSimd.ShiftRightArithmetic(value.AsSByte(), 7).AsByte(); + Vector128 extractedBits = AdvSimd.And(mostSignificantBitIsSet, s_bitMask128); + + // self-pairwise add until all flags have moved to the first two bytes of the vector + extractedBits = AdvSimd.Arm64.AddPairwise(extractedBits, extractedBits); + extractedBits = AdvSimd.Arm64.AddPairwise(extractedBits, extractedBits); + extractedBits = AdvSimd.Arm64.AddPairwise(extractedBits, extractedBits); + return extractedBits.AsUInt16().ToScalar(); + } } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf16Utility.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf16Utility.cs index 9c45b0a37d90..379de97efec5 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf16Utility.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf16Utility.cs @@ -66,6 +66,7 @@ internal static uint ConvertAllAsciiCharsInUInt32ToLowercase(uint value) [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static uint ConvertAllAsciiCharsInUInt32ToUppercase(uint value) { + // Intrinsified in mono interpreter // ASSUMPTION: Caller has validated that input value is ASCII. Debug.Assert(AllCharsInUInt32AreAscii(value)); @@ -144,6 +145,7 @@ internal static bool UInt32ContainsAnyUppercaseAsciiChar(uint value) [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static bool UInt32OrdinalIgnoreCaseAscii(uint valueA, uint valueB) { + // Intrinsified in mono interpreter // ASSUMPTION: Caller has validated that input values are ASCII. Debug.Assert(AllCharsInUInt32AreAscii(valueA)); Debug.Assert(AllCharsInUInt32AreAscii(valueB)); @@ -185,6 +187,7 @@ internal static bool UInt32OrdinalIgnoreCaseAscii(uint valueA, uint valueB) [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static bool UInt64OrdinalIgnoreCaseAscii(ulong valueA, ulong valueB) { + // Intrinsified in mono interpreter // ASSUMPTION: Caller has validated that input values are ASCII. Debug.Assert(AllCharsInUInt64AreAscii(valueA)); Debug.Assert(AllCharsInUInt64AreAscii(valueB)); diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.cs index 7b6e0ff49642..2ecb58c3782b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.cs @@ -24,7 +24,7 @@ internal static partial class Utf8Utility /// /// The UTF-8 representation of . /// -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) private static ReadOnlySpan ReplacementCharSequence => new byte[] { 0xEF, 0xBF, 0xBD }; #else private static readonly byte[] ReplacementCharSequence = new byte[] { 0xEF, 0xBF, 0xBD }; @@ -89,7 +89,7 @@ public static Utf8String ValidateAndFixupUtf8String(Utf8String value) // (The faster implementation is in the dev/utf8string_bak branch currently.) MemoryStream memStream = new MemoryStream(); -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) memStream.Write(valueAsBytes.Slice(0, idxOfFirstInvalidData)); valueAsBytes = valueAsBytes.Slice(idxOfFirstInvalidData); diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Utf8Span.Comparison.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Utf8Span.Comparison.cs index ab24c9dc06e3..ed42f474ee8a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Utf8Span.Comparison.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Utf8Span.Comparison.cs @@ -67,7 +67,7 @@ public bool Contains(Rune value, StringComparison comparison) { // TODO_UTF8STRING: Optimize me to avoid allocations. -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) return this.ToString().Contains(value.ToString(), comparison); #else return this.ToString().IndexOf(value.ToString(), comparison) >= 0; @@ -91,7 +91,7 @@ public bool Contains(Utf8Span value, StringComparison comparison) { // TODO_UTF8STRING: Optimize me to avoid allocations. -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) return this.ToString().Contains(value.ToString(), comparison); #else return this.ToString().IndexOf(value.ToString(), comparison) >= 0; diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Utf8Span.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Utf8Span.cs index f0019e99480a..83beddeff2e3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Utf8Span.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Utf8Span.cs @@ -230,7 +230,7 @@ public override string ToString() // TODO_UTF8STRING: Since we know the underlying data is immutable, well-formed UTF-8, // we can perform transcoding using an optimized code path that skips all safety checks. -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) return Encoding.UTF8.GetString(Bytes); #else if (IsEmpty) @@ -273,7 +273,7 @@ internal unsafe string ToStringNoReplacement() int utf16CharCount = Length + utf16CodeUnitCountAdjustment; Debug.Assert(utf16CharCount <= Length && utf16CharCount >= 0); -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) // TODO_UTF8STRING: Can we call string.FastAllocate directly? return string.Create(utf16CharCount, (pbData: (IntPtr)pData, cbData: Length), (chars, state) => { diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/EventWaitHandle.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/EventWaitHandle.cs index dd27d9303dbf..6d95be79f6ce 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/EventWaitHandle.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/EventWaitHandle.cs @@ -4,6 +4,7 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; +using System.Runtime.Versioning; namespace System.Threading { @@ -27,6 +28,7 @@ public EventWaitHandle(bool initialState, EventResetMode mode, string? name, out CreateEventCore(initialState, mode, name, out createdNew); } + [MinimumOSPlatform("windows7.0")] public static EventWaitHandle OpenExisting(string name) { switch (OpenExistingWorker(name, out EventWaitHandle? result)) @@ -43,6 +45,7 @@ public static EventWaitHandle OpenExisting(string name) } } + [MinimumOSPlatform("windows7.0")] public static bool TryOpenExisting(string name, [NotNullWhen(true)] out EventWaitHandle? result) => OpenExistingWorker(name, out result!) == OpenExistingResult.Success; } diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Semaphore.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Semaphore.cs index 80f4c4b7577f..40555cc8dfda 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Semaphore.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Semaphore.cs @@ -4,6 +4,7 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; +using System.Runtime.Versioning; namespace System.Threading { @@ -32,6 +33,7 @@ public Semaphore(int initialCount, int maximumCount, string? name, out bool crea CreateSemaphoreCore(initialCount, maximumCount, name, out createdNew); } + [MinimumOSPlatform("windows7.0")] public static Semaphore OpenExisting(string name) { switch (OpenExistingWorker(name, out Semaphore? result)) @@ -48,6 +50,7 @@ public static Semaphore OpenExisting(string name) } } + [MinimumOSPlatform("windows7.0")] public static bool TryOpenExisting(string name, [NotNullWhen(true)] out Semaphore? result) => OpenExistingWorker(name, out result!) == OpenExistingResult.Success; diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs index e60393355276..edc05663a044 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs @@ -7,6 +7,7 @@ using System.Globalization; using System.Runtime.ConstrainedExecution; using System.Security.Principal; +using System.Runtime.Versioning; namespace System.Threading { @@ -224,6 +225,7 @@ public ApartmentState ApartmentState set => TrySetApartmentState(value); } + [MinimumOSPlatform("windows7.0")] public void SetApartmentState(ApartmentState state) { if (!TrySetApartmentState(state)) diff --git a/src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.GetDisplayName.Invariant.cs b/src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.GetDisplayName.Invariant.cs new file mode 100644 index 000000000000..14b302d86b80 --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.GetDisplayName.Invariant.cs @@ -0,0 +1,13 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System +{ + public sealed partial class TimeZoneInfo + { + private unsafe void GetDisplayName(Interop.Globalization.TimeZoneDisplayNameType nameType, string uiCulture, ref string? displayName) + { + displayName = _standardDisplayName; + } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.GetDisplayName.cs b/src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.GetDisplayName.cs new file mode 100644 index 000000000000..b557c15384bb --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.GetDisplayName.cs @@ -0,0 +1,67 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Buffers; +using System.Collections.Generic; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.Globalization; +using System.IO; +using System.Text; +using System.Threading; +using System.Security; + +using Internal.IO; + +namespace System +{ + public sealed partial class TimeZoneInfo + { + private unsafe void GetDisplayName(Interop.Globalization.TimeZoneDisplayNameType nameType, string uiCulture, ref string? displayName) + { + if (GlobalizationMode.Invariant) + { + displayName = _standardDisplayName; + return; + } + + string? timeZoneDisplayName; + bool result = Interop.CallStringMethod( + (buffer, locale, id, type) => + { + fixed (char* bufferPtr = buffer) + { + return Interop.Globalization.GetTimeZoneDisplayName(locale, id, type, bufferPtr, buffer.Length); + } + }, + uiCulture, + _id, + nameType, + out timeZoneDisplayName); + + if (!result && uiCulture != FallbackCultureName) + { + // Try to fallback using FallbackCultureName just in case we can make it work. + result = Interop.CallStringMethod( + (buffer, locale, id, type) => + { + fixed (char* bufferPtr = buffer) + { + return Interop.Globalization.GetTimeZoneDisplayName(locale, id, type, bufferPtr, buffer.Length); + } + }, + FallbackCultureName, + _id, + nameType, + out timeZoneDisplayName); + } + + // If there is an unknown error, don't set the displayName field. + // It will be set to the abbreviation that was read out of the tzfile. + if (result) + { + displayName = timeZoneDisplayName; + } + } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Unix.cs index 7dbcf577a657..0be8b50a064f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Unix.cs @@ -107,53 +107,6 @@ private TimeZoneInfo(byte[] data, string id, bool dstDisabled) ValidateTimeZoneInfo(_id, _baseUtcOffset, _adjustmentRules, out _supportsDaylightSavingTime); } - private unsafe void GetDisplayName(Interop.Globalization.TimeZoneDisplayNameType nameType, string uiCulture, ref string? displayName) - { - if (GlobalizationMode.Invariant) - { - displayName = _standardDisplayName; - return; - } - - string? timeZoneDisplayName; - bool result = Interop.CallStringMethod( - (buffer, locale, id, type) => - { - fixed (char* bufferPtr = buffer) - { - return Interop.Globalization.GetTimeZoneDisplayName(locale, id, type, bufferPtr, buffer.Length); - } - }, - uiCulture, - _id, - nameType, - out timeZoneDisplayName); - - if (!result && uiCulture != FallbackCultureName) - { - // Try to fallback using FallbackCultureName just in case we can make it work. - result = Interop.CallStringMethod( - (buffer, locale, id, type) => - { - fixed (char* bufferPtr = buffer) - { - return Interop.Globalization.GetTimeZoneDisplayName(locale, id, type, bufferPtr, buffer.Length); - } - }, - FallbackCultureName, - _id, - nameType, - out timeZoneDisplayName); - } - - // If there is an unknown error, don't set the displayName field. - // It will be set to the abbreviation that was read out of the tzfile. - if (result) - { - displayName = timeZoneDisplayName; - } - } - /// /// Returns a cloned array of AdjustmentRule objects /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Utf8String.Comparison.cs b/src/libraries/System.Private.CoreLib/src/System/Utf8String.Comparison.cs index 09e2697e711b..df4f9fb32a0b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Utf8String.Comparison.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Utf8String.Comparison.cs @@ -189,7 +189,7 @@ public bool Contains(Rune value, StringComparison comparison) { // TODO_UTF8STRING: Optimize me to avoid allocations. -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) return ToString().Contains(value.ToString(), comparison); #else return ToString().IndexOf(value.ToString(), comparison) >= 0; @@ -223,7 +223,7 @@ public bool Contains(Utf8String value, StringComparison comparison) // TODO_UTF8STRING: Optimize me to avoid allocations. -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) return ToString().Contains(value.ToString(), comparison); #else return ToString().IndexOf(value.ToString(), comparison) >= 0; diff --git a/src/libraries/System.Private.CoreLib/src/System/Utf8String.Construction.cs b/src/libraries/System.Private.CoreLib/src/System/Utf8String.Construction.cs index 2d6f329161ab..7508458d73ba 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Utf8String.Construction.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Utf8String.Construction.cs @@ -352,7 +352,7 @@ internal static Utf8String CreateFromRune(Rune value) } #endif // !SYSTEM_PRIVATE_CORELIB -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) /// /// Creates a new instance, allowing the provided delegate to populate the /// instance data of the returned object. diff --git a/src/libraries/System.Private.CoreLib/src/System/Utf8String.cs b/src/libraries/System.Private.CoreLib/src/System/Utf8String.cs index aba4a5d548f0..30b4cbd93dc6 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Utf8String.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Utf8String.cs @@ -259,7 +259,7 @@ public override string ToString() { // TODO_UTF8STRING: Optimize the call below, potentially by avoiding the two-pass. -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) return Encoding.UTF8.GetString(this.AsBytesSkipNullCheck()); #else if (Length == 0) diff --git a/src/libraries/System.Reflection.DispatchProxy/pkg/System.Reflection.DispatchProxy.pkgproj b/src/libraries/System.Reflection.DispatchProxy/pkg/System.Reflection.DispatchProxy.pkgproj deleted file mode 100644 index 46760b1e95e6..000000000000 --- a/src/libraries/System.Reflection.DispatchProxy/pkg/System.Reflection.DispatchProxy.pkgproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - - net461;netcoreapp2.0;$(AllXamarinFrameworks) - - true - - - - - - - - - - - - - - - - - - - .NETCoreApp;UAP - - - - \ No newline at end of file diff --git a/src/libraries/System.Reflection.DispatchProxy/ref/System.Reflection.DispatchProxy.csproj b/src/libraries/System.Reflection.DispatchProxy/ref/System.Reflection.DispatchProxy.csproj index 4478a1e5b98b..2759e12af120 100644 --- a/src/libraries/System.Reflection.DispatchProxy/ref/System.Reflection.DispatchProxy.csproj +++ b/src/libraries/System.Reflection.DispatchProxy/ref/System.Reflection.DispatchProxy.csproj @@ -1,13 +1,12 @@ - $(NetCoreAppCurrent);netstandard2.0 - true + $(NetCoreAppCurrent) enable - + \ No newline at end of file diff --git a/src/libraries/System.Reflection.DispatchProxy/src/System.Reflection.DispatchProxy.csproj b/src/libraries/System.Reflection.DispatchProxy/src/System.Reflection.DispatchProxy.csproj index 93cbb7fb64f9..80891e3e0192 100644 --- a/src/libraries/System.Reflection.DispatchProxy/src/System.Reflection.DispatchProxy.csproj +++ b/src/libraries/System.Reflection.DispatchProxy/src/System.Reflection.DispatchProxy.csproj @@ -1,28 +1,16 @@ true - - $(NetCoreAppCurrent);net461;netstandard2.0;netcoreapp2.0;$(NetFrameworkCurrent) - true - true + $(NetCoreAppCurrent) enable - - - SR.PlatformNotSupported_ReflectionDispatchProxy - - + - - - - - - + diff --git a/src/libraries/System.Reflection.DispatchProxy/tests/System.Reflection.DispatchProxy.Tests.csproj b/src/libraries/System.Reflection.DispatchProxy/tests/System.Reflection.DispatchProxy.Tests.csproj index 25bec3aa0938..0b8d6748dfe0 100644 --- a/src/libraries/System.Reflection.DispatchProxy/tests/System.Reflection.DispatchProxy.Tests.csproj +++ b/src/libraries/System.Reflection.DispatchProxy/tests/System.Reflection.DispatchProxy.Tests.csproj @@ -1,6 +1,6 @@ - $(NetCoreAppCurrent);$(NetFrameworkCurrent) + $(NetCoreAppCurrent) diff --git a/src/libraries/System.Reflection.Metadata/src/System.Reflection.Metadata.csproj b/src/libraries/System.Reflection.Metadata/src/System.Reflection.Metadata.csproj index a60521d62461..bb96d4ba71e6 100644 --- a/src/libraries/System.Reflection.Metadata/src/System.Reflection.Metadata.csproj +++ b/src/libraries/System.Reflection.Metadata/src/System.Reflection.Metadata.csproj @@ -3,7 +3,8 @@ true en-US false - $(NetCoreAppCurrent);netstandard1.1;netstandard2.0 + $(NetCoreAppCurrent);netstandard1.1;netstandard2.0;net461;$(NetFrameworkCurrent) + true true enable @@ -98,14 +99,14 @@ - + - + @@ -266,4 +267,9 @@ + + + + + diff --git a/src/libraries/System.Reflection.MetadataLoadContext/pkg/System.Reflection.MetadataLoadContext.pkgproj b/src/libraries/System.Reflection.MetadataLoadContext/pkg/System.Reflection.MetadataLoadContext.pkgproj index d7bcbbdc45ee..7838bccd43db 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/pkg/System.Reflection.MetadataLoadContext.pkgproj +++ b/src/libraries/System.Reflection.MetadataLoadContext/pkg/System.Reflection.MetadataLoadContext.pkgproj @@ -1,10 +1,9 @@  - + net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks) - diff --git a/src/libraries/System.Reflection.MetadataLoadContext/src/System.Reflection.MetadataLoadContext.csproj b/src/libraries/System.Reflection.MetadataLoadContext/src/System.Reflection.MetadataLoadContext.csproj index 3a90ef79c94d..b1f6f31cb00b 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/src/System.Reflection.MetadataLoadContext.csproj +++ b/src/libraries/System.Reflection.MetadataLoadContext/src/System.Reflection.MetadataLoadContext.csproj @@ -3,7 +3,8 @@ System.Reflection true - $(NetCoreAppCurrent);netcoreapp3.0;netstandard2.0 + $(NetCoreAppCurrent);netcoreapp3.0;netstandard2.0;net461;$(NetFrameworkCurrent) + true true enable @@ -77,8 +78,8 @@ - - + + @@ -155,4 +156,9 @@ + + + + + diff --git a/src/libraries/System.Reflection.TypeExtensions/ref/System.Reflection.TypeExtensions.cs b/src/libraries/System.Reflection.TypeExtensions/ref/System.Reflection.TypeExtensions.cs index 128df6596917..4ca0a300ce5c 100644 --- a/src/libraries/System.Reflection.TypeExtensions/ref/System.Reflection.TypeExtensions.cs +++ b/src/libraries/System.Reflection.TypeExtensions/ref/System.Reflection.TypeExtensions.cs @@ -77,7 +77,7 @@ public static partial class TypeExtensions public static System.Reflection.PropertyInfo? GetProperty(this System.Type type, string name, System.Reflection.BindingFlags bindingAttr) { throw null; } public static System.Reflection.PropertyInfo? GetProperty(this System.Type type, string name, System.Type? returnType) { throw null; } public static System.Reflection.PropertyInfo? GetProperty(this System.Type type, string name, System.Type? returnType, System.Type[] types) { throw null; } - public static bool IsAssignableFrom(this System.Type type, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] System.Type? c) { throw null; } - public static bool IsInstanceOfType(this System.Type type, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? o) { throw null; } + public static bool IsAssignableFrom(this System.Type type, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Type? c) { throw null; } + public static bool IsInstanceOfType(this System.Type type, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? o) { throw null; } } } diff --git a/src/libraries/System.Reflection.TypeExtensions/src/System/Reflection/TypeExtensions.cs b/src/libraries/System.Reflection.TypeExtensions/src/System/Reflection/TypeExtensions.cs index a4f93cf98bb5..f99071819f7e 100644 --- a/src/libraries/System.Reflection.TypeExtensions/src/System/Reflection/TypeExtensions.cs +++ b/src/libraries/System.Reflection.TypeExtensions/src/System/Reflection/TypeExtensions.cs @@ -1,212 +1,203 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// NOTE: These are extension methods in the contract, but plain static methods -// in this implementation. This is done to avoid confusion around what would -// look like infinite recursion in the implementation. Callers compiled against -// the contract will still be able to invoke them as extension methods and get -// source compatibility with classic reflection code. -// -// However, this does not apply if there is no 1:1 correspondence with an instance -// in mscorlib. New extension methods should be marked with 'this'. - namespace System.Reflection { public static class TypeExtensions { - public static ConstructorInfo? GetConstructor(Type type, Type[] types) + public static ConstructorInfo? GetConstructor(this Type type, Type[] types) { Requires.NotNull(type, nameof(type)); return type.GetConstructor(types); } - public static ConstructorInfo[] GetConstructors(Type type) + public static ConstructorInfo[] GetConstructors(this Type type) { Requires.NotNull(type, nameof(type)); return type.GetConstructors(); } - public static ConstructorInfo[] GetConstructors(Type type, BindingFlags bindingAttr) + public static ConstructorInfo[] GetConstructors(this Type type, BindingFlags bindingAttr) { Requires.NotNull(type, nameof(type)); return type.GetConstructors(bindingAttr); } - public static MemberInfo[] GetDefaultMembers(Type type) + public static MemberInfo[] GetDefaultMembers(this Type type) { Requires.NotNull(type, nameof(type)); return type.GetDefaultMembers(); } - public static EventInfo? GetEvent(Type type, string name) + public static EventInfo? GetEvent(this Type type, string name) { Requires.NotNull(type, nameof(type)); return type.GetEvent(name); } - public static EventInfo? GetEvent(Type type, string name, BindingFlags bindingAttr) + public static EventInfo? GetEvent(this Type type, string name, BindingFlags bindingAttr) { Requires.NotNull(type, nameof(type)); return type.GetEvent(name, bindingAttr); } - public static EventInfo[] GetEvents(Type type) + public static EventInfo[] GetEvents(this Type type) { Requires.NotNull(type, nameof(type)); return type.GetEvents(); } - public static EventInfo[] GetEvents(Type type, BindingFlags bindingAttr) + public static EventInfo[] GetEvents(this Type type, BindingFlags bindingAttr) { Requires.NotNull(type, nameof(type)); return type.GetEvents(bindingAttr); } - public static FieldInfo? GetField(Type type, string name) + public static FieldInfo? GetField(this Type type, string name) { Requires.NotNull(type, nameof(type)); return type.GetField(name); } - public static FieldInfo? GetField(Type type, string name, BindingFlags bindingAttr) + public static FieldInfo? GetField(this Type type, string name, BindingFlags bindingAttr) { Requires.NotNull(type, nameof(type)); return type.GetField(name, bindingAttr); } - public static FieldInfo[] GetFields(Type type) + public static FieldInfo[] GetFields(this Type type) { Requires.NotNull(type, nameof(type)); return type.GetFields(); } - public static FieldInfo[] GetFields(Type type, BindingFlags bindingAttr) + public static FieldInfo[] GetFields(this Type type, BindingFlags bindingAttr) { Requires.NotNull(type, nameof(type)); return type.GetFields(bindingAttr); } - public static Type[] GetGenericArguments(Type type) + public static Type[] GetGenericArguments(this Type type) { Requires.NotNull(type, nameof(type)); return type.GetGenericArguments(); } - public static Type[] GetInterfaces(Type type) + public static Type[] GetInterfaces(this Type type) { Requires.NotNull(type, nameof(type)); return type.GetInterfaces(); } - public static MemberInfo[] GetMember(Type type, string name) + public static MemberInfo[] GetMember(this Type type, string name) { Requires.NotNull(type, nameof(type)); return type.GetMember(name); } - public static MemberInfo[] GetMember(Type type, string name, BindingFlags bindingAttr) + public static MemberInfo[] GetMember(this Type type, string name, BindingFlags bindingAttr) { Requires.NotNull(type, nameof(type)); return type.GetMember(name, bindingAttr); } - public static MemberInfo[] GetMembers(Type type) + public static MemberInfo[] GetMembers(this Type type) { Requires.NotNull(type, nameof(type)); return type.GetMembers(); } - public static MemberInfo[] GetMembers(Type type, BindingFlags bindingAttr) + public static MemberInfo[] GetMembers(this Type type, BindingFlags bindingAttr) { Requires.NotNull(type, nameof(type)); return type.GetMembers(bindingAttr); } - public static MethodInfo? GetMethod(Type type, string name) + public static MethodInfo? GetMethod(this Type type, string name) { Requires.NotNull(type, nameof(type)); return type.GetMethod(name); } - public static MethodInfo? GetMethod(Type type, string name, BindingFlags bindingAttr) + public static MethodInfo? GetMethod(this Type type, string name, BindingFlags bindingAttr) { Requires.NotNull(type, nameof(type)); return type.GetMethod(name, bindingAttr); } - public static MethodInfo? GetMethod(Type type, string name, Type[] types) + public static MethodInfo? GetMethod(this Type type, string name, Type[] types) { Requires.NotNull(type, nameof(type)); return type.GetMethod(name, types); } - public static MethodInfo[] GetMethods(Type type) + public static MethodInfo[] GetMethods(this Type type) { Requires.NotNull(type, nameof(type)); return type.GetMethods(); } - public static MethodInfo[] GetMethods(Type type, BindingFlags bindingAttr) + public static MethodInfo[] GetMethods(this Type type, BindingFlags bindingAttr) { Requires.NotNull(type, nameof(type)); return type.GetMethods(bindingAttr); } - public static Type? GetNestedType(Type type, string name, BindingFlags bindingAttr) + public static Type? GetNestedType(this Type type, string name, BindingFlags bindingAttr) { Requires.NotNull(type, nameof(type)); return type.GetNestedType(name, bindingAttr); } - public static Type[] GetNestedTypes(Type type, BindingFlags bindingAttr) + public static Type[] GetNestedTypes(this Type type, BindingFlags bindingAttr) { Requires.NotNull(type, nameof(type)); return type.GetNestedTypes(bindingAttr); } - public static PropertyInfo[] GetProperties(Type type) + public static PropertyInfo[] GetProperties(this Type type) { Requires.NotNull(type, nameof(type)); return type.GetProperties(); } - public static PropertyInfo[] GetProperties(Type type, BindingFlags bindingAttr) + public static PropertyInfo[] GetProperties(this Type type, BindingFlags bindingAttr) { Requires.NotNull(type, nameof(type)); return type.GetProperties(bindingAttr); } - public static PropertyInfo? GetProperty(Type type, string name) + public static PropertyInfo? GetProperty(this Type type, string name) { Requires.NotNull(type, nameof(type)); return type.GetProperty(name); } - public static PropertyInfo? GetProperty(Type type, string name, BindingFlags bindingAttr) + public static PropertyInfo? GetProperty(this Type type, string name, BindingFlags bindingAttr) { Requires.NotNull(type, nameof(type)); return type.GetProperty(name, bindingAttr); } - public static PropertyInfo? GetProperty(Type type, string name, Type? returnType) + public static PropertyInfo? GetProperty(this Type type, string name, Type? returnType) { Requires.NotNull(type, nameof(type)); return type.GetProperty(name, returnType); } - public static PropertyInfo? GetProperty(Type type, string name, Type? returnType, Type[] types) + public static PropertyInfo? GetProperty(this Type type, string name, Type? returnType, Type[] types) { Requires.NotNull(type, nameof(type)); return type.GetProperty(name, returnType, types); } - public static bool IsAssignableFrom(Type type, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] Type? c) + public static bool IsAssignableFrom(this Type type, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] Type? c) { Requires.NotNull(type, nameof(type)); return type.IsAssignableFrom(c); } - public static bool IsInstanceOfType(Type type, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? o) + public static bool IsInstanceOfType(this Type type, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object? o) { Requires.NotNull(type, nameof(type)); return type.IsInstanceOfType(o); @@ -215,19 +206,19 @@ public static bool IsInstanceOfType(Type type, [System.Diagnostics.CodeAnalysis. public static class AssemblyExtensions { - public static Type[] GetExportedTypes(Assembly assembly) + public static Type[] GetExportedTypes(this Assembly assembly) { Requires.NotNull(assembly, nameof(assembly)); return assembly.GetExportedTypes(); } - public static Module[] GetModules(Assembly assembly) + public static Module[] GetModules(this Assembly assembly) { Requires.NotNull(assembly, nameof(assembly)); return assembly.GetModules(); } - public static Type[] GetTypes(Assembly assembly) + public static Type[] GetTypes(this Assembly assembly) { Requires.NotNull(assembly, nameof(assembly)); return assembly.GetTypes(); @@ -236,37 +227,37 @@ public static Type[] GetTypes(Assembly assembly) public static class EventInfoExtensions { - public static MethodInfo? GetAddMethod(EventInfo eventInfo) + public static MethodInfo? GetAddMethod(this EventInfo eventInfo) { Requires.NotNull(eventInfo, nameof(eventInfo)); return eventInfo.GetAddMethod(); } - public static MethodInfo? GetAddMethod(EventInfo eventInfo, bool nonPublic) + public static MethodInfo? GetAddMethod(this EventInfo eventInfo, bool nonPublic) { Requires.NotNull(eventInfo, nameof(eventInfo)); return eventInfo.GetAddMethod(nonPublic); } - public static MethodInfo? GetRaiseMethod(EventInfo eventInfo) + public static MethodInfo? GetRaiseMethod(this EventInfo eventInfo) { Requires.NotNull(eventInfo, nameof(eventInfo)); return eventInfo.GetRaiseMethod(); } - public static MethodInfo? GetRaiseMethod(EventInfo eventInfo, bool nonPublic) + public static MethodInfo? GetRaiseMethod(this EventInfo eventInfo, bool nonPublic) { Requires.NotNull(eventInfo, nameof(eventInfo)); return eventInfo.GetRaiseMethod(nonPublic); } - public static MethodInfo? GetRemoveMethod(EventInfo eventInfo) + public static MethodInfo? GetRemoveMethod(this EventInfo eventInfo) { Requires.NotNull(eventInfo, nameof(eventInfo)); return eventInfo.GetRemoveMethod(); } - public static MethodInfo? GetRemoveMethod(EventInfo eventInfo, bool nonPublic) + public static MethodInfo? GetRemoveMethod(this EventInfo eventInfo, bool nonPublic) { Requires.NotNull(eventInfo, nameof(eventInfo)); return eventInfo.GetRemoveMethod(nonPublic); @@ -317,7 +308,7 @@ public static int GetMetadataToken(this MemberInfo member) return token; } - private static int GetMetadataTokenOrZeroOrThrow(MemberInfo member) + private static int GetMetadataTokenOrZeroOrThrow(this MemberInfo member) { int token = member.MetadataToken; @@ -336,7 +327,7 @@ private static int GetMetadataTokenOrZeroOrThrow(MemberInfo member) public static class MethodInfoExtensions { - public static MethodInfo GetBaseDefinition(MethodInfo method) + public static MethodInfo GetBaseDefinition(this MethodInfo method) { Requires.NotNull(method, nameof(method)); return method.GetBaseDefinition(); @@ -360,37 +351,37 @@ public static Guid GetModuleVersionId(this Module module) public static class PropertyInfoExtensions { - public static MethodInfo[] GetAccessors(PropertyInfo property) + public static MethodInfo[] GetAccessors(this PropertyInfo property) { Requires.NotNull(property, nameof(property)); return property.GetAccessors(); } - public static MethodInfo[] GetAccessors(PropertyInfo property, bool nonPublic) + public static MethodInfo[] GetAccessors(this PropertyInfo property, bool nonPublic) { Requires.NotNull(property, nameof(property)); return property.GetAccessors(nonPublic); } - public static MethodInfo? GetGetMethod(PropertyInfo property) + public static MethodInfo? GetGetMethod(this PropertyInfo property) { Requires.NotNull(property, nameof(property)); return property.GetGetMethod(); } - public static MethodInfo? GetGetMethod(PropertyInfo property, bool nonPublic) + public static MethodInfo? GetGetMethod(this PropertyInfo property, bool nonPublic) { Requires.NotNull(property, nameof(property)); return property.GetGetMethod(nonPublic); } - public static MethodInfo? GetSetMethod(PropertyInfo property) + public static MethodInfo? GetSetMethod(this PropertyInfo property) { Requires.NotNull(property, nameof(property)); return property.GetSetMethod(); } - public static MethodInfo? GetSetMethod(PropertyInfo property, bool nonPublic) + public static MethodInfo? GetSetMethod(this PropertyInfo property, bool nonPublic) { Requires.NotNull(property, nameof(property)); return property.GetSetMethod(nonPublic); diff --git a/src/libraries/System.Reflection.TypeExtensions/tests/AssemblyExtensionTests.cs b/src/libraries/System.Reflection.TypeExtensions/tests/AssemblyExtensionTests.cs index d350878a5945..74d0d8025e58 100644 --- a/src/libraries/System.Reflection.TypeExtensions/tests/AssemblyExtensionTests.cs +++ b/src/libraries/System.Reflection.TypeExtensions/tests/AssemblyExtensionTests.cs @@ -11,21 +11,21 @@ public class AssemblyExtensionTests public void GetExportedTypesTest() { Assembly executingAssembly = GetType().GetTypeInfo().Assembly; - Assert.True(executingAssembly.GetExportedTypes().Length >= 60); + Assert.True(AssemblyExtensions.GetExportedTypes(executingAssembly).Length >= 60); } [Fact] public void GetModulesTest() { Assembly executingAssembly = GetType().GetTypeInfo().Assembly; - Assert.Equal(1, executingAssembly.GetModules().Length); + Assert.Equal(1, AssemblyExtensions.GetModules(executingAssembly).Length); } [Fact] public void GetTypes() { Assembly executingAssembly = GetType().GetTypeInfo().Assembly; - Assert.True(executingAssembly.GetTypes().Length >= 140); + Assert.True(AssemblyExtensions.GetTypes(executingAssembly).Length >= 140); } } } diff --git a/src/libraries/System.Reflection.TypeExtensions/tests/ConstructorInfo/ConstructorInfoInvokeArrayTests.cs b/src/libraries/System.Reflection.TypeExtensions/tests/ConstructorInfo/ConstructorInfoInvokeArrayTests.cs index be7080f80bed..f5f6d36e3939 100644 --- a/src/libraries/System.Reflection.TypeExtensions/tests/ConstructorInfo/ConstructorInfoInvokeArrayTests.cs +++ b/src/libraries/System.Reflection.TypeExtensions/tests/ConstructorInfo/ConstructorInfoInvokeArrayTests.cs @@ -11,7 +11,7 @@ public class ConstructorInfoInvokeArrayTests public void Invoke_SZArrayConstructor() { Type type = Type.GetType("System.Object[]"); - ConstructorInfo[] constructors = type.GetConstructors(); + ConstructorInfo[] constructors = TypeExtensions.GetConstructors(type); Assert.Equal(1, constructors.Length); ConstructorInfo constructor = constructors[0]; @@ -36,11 +36,11 @@ public void Invoke_SZArrayConstructor() public void Invoke_1DArrayConstructor() { Type type = Type.GetType("System.Char[*]"); - MethodInfo getLowerBound = type.GetMethod("GetLowerBound"); - MethodInfo getUpperBound = type.GetMethod("GetUpperBound"); - PropertyInfo getLength = type.GetProperty("Length"); + MethodInfo getLowerBound = TypeExtensions.GetMethod(type, "GetLowerBound"); + MethodInfo getUpperBound = TypeExtensions.GetMethod(type, "GetUpperBound"); + PropertyInfo getLength = TypeExtensions.GetProperty(type, "Length"); - ConstructorInfo[] constructors = type.GetConstructors(); + ConstructorInfo[] constructors = TypeExtensions.GetConstructors(type); Assert.Equal(2, constructors.Length); for (int i = 0; i < constructors.Length; i++) @@ -103,7 +103,7 @@ public void Invoke_2DArrayConstructor() { Type type = Type.GetType("System.Int32[,]", false); - ConstructorInfo[] constructors = type.GetConstructors(); + ConstructorInfo[] constructors = TypeExtensions.GetConstructors(type); Assert.Equal(2, constructors.Length); for (int i = 0; i < constructors.Length; i++) @@ -224,7 +224,7 @@ public void Invoke_2DArrayConstructor() public void Invoke_LargeDimensionalArrayConstructor() { Type type = Type.GetType("System.Type[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]"); - ConstructorInfo[] cia = type.GetConstructors(); + ConstructorInfo[] cia = TypeExtensions.GetConstructors(type); Assert.Equal(2, cia.Length); Assert.Throws(() => Type.GetType("System.Type[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]")); } @@ -233,7 +233,7 @@ public void Invoke_LargeDimensionalArrayConstructor() public void Invoke_JaggedArrayConstructor() { Type type = Type.GetType("System.String[][]"); - ConstructorInfo[] constructors = type.GetConstructors(); + ConstructorInfo[] constructors = TypeExtensions.GetConstructors(type); Assert.Equal(2, constructors.Length); for (int i = 0; i < constructors.Length; i++) diff --git a/src/libraries/System.Reflection.TypeExtensions/tests/ConstructorInfo/ConstructorInfoTests.cs b/src/libraries/System.Reflection.TypeExtensions/tests/ConstructorInfo/ConstructorInfoTests.cs index 092b2cef0014..5ce72bed4c75 100644 --- a/src/libraries/System.Reflection.TypeExtensions/tests/ConstructorInfo/ConstructorInfoTests.cs +++ b/src/libraries/System.Reflection.TypeExtensions/tests/ConstructorInfo/ConstructorInfoTests.cs @@ -42,7 +42,7 @@ public static IEnumerable Invoke_TestData() [MemberData(nameof(Invoke_TestData))] public void Invoke(Type[] constructorTypeParameters, object[] parameters) { - ConstructorInfo constructor = typeof(ConstructorInfoInvoke).GetConstructor(constructorTypeParameters); + ConstructorInfo constructor = TypeExtensions.GetConstructor(typeof(ConstructorInfoInvoke), constructorTypeParameters); object constructedObject = constructor.Invoke(parameters); Assert.NotNull(constructedObject); } @@ -67,7 +67,7 @@ public static IEnumerable Invoke_Invalid_TestData() [MemberData(nameof(Invoke_Invalid_TestData))] public void Invoke_Invalid(Type constructorParent, Type[] constructorTypeParameters, object[] parameters, Type exceptionType) { - ConstructorInfo constructor = constructorParent.GetConstructor(constructorTypeParameters); + ConstructorInfo constructor = TypeExtensions.GetConstructor(constructorParent, constructorTypeParameters); Assert.Throws(exceptionType, () => constructor.Invoke(parameters)); } @@ -82,7 +82,7 @@ public void TypeConstructorName_ReturnsExpected() [InlineData(typeof(string), new Type[] { typeof(char), typeof(int) })] public void Properties(Type type, Type[] typeParameters) { - ConstructorInfo constructor = type.GetConstructor(typeParameters); + ConstructorInfo constructor = TypeExtensions.GetConstructor(type, typeParameters); Assert.Equal(type, constructor.DeclaringType); Assert.Equal(type.GetTypeInfo().Module, constructor.Module); diff --git a/src/libraries/System.Reflection.TypeExtensions/tests/EventInfoTests.cs b/src/libraries/System.Reflection.TypeExtensions/tests/EventInfoTests.cs index e885672784e0..b023097ce485 100644 --- a/src/libraries/System.Reflection.TypeExtensions/tests/EventInfoTests.cs +++ b/src/libraries/System.Reflection.TypeExtensions/tests/EventInfoTests.cs @@ -16,9 +16,9 @@ public class EventInfoTests public static IEnumerable AddEventHandler_TestData() { EI_Class tc1 = new EI_Class(); - yield return new object[] { typeof(EI_Class).GetEvent("PublicEvent"), tc1, new VoidDelegate(tc1.PublicVoidMethod1), 1 }; - yield return new object[] { typeof(EI_Class).GetEvent("PublicStaticEvent"), null, new VoidDelegate(tc1.ProtectedInternalVoidMethod), 2 }; - yield return new object[] { typeof(EI_Class).GetEvent("PublicStaticEvent"), tc1, new VoidDelegate(tc1.PublicVoidMethod2), 3 }; + yield return new object[] { TypeExtensions.GetEvent(typeof(EI_Class), "PublicEvent"), tc1, new VoidDelegate(tc1.PublicVoidMethod1), 1 }; + yield return new object[] { TypeExtensions.GetEvent(typeof(EI_Class), "PublicStaticEvent"), null, new VoidDelegate(tc1.ProtectedInternalVoidMethod), 2 }; + yield return new object[] { TypeExtensions.GetEvent(typeof(EI_Class), "PublicStaticEvent"), tc1, new VoidDelegate(tc1.PublicVoidMethod2), 3 }; } [Theory] @@ -43,13 +43,13 @@ public static IEnumerable AddEventHandler_Invalid_TestData() { // Null target for instance method EI_Class tc1 = new EI_Class(); - yield return new object[] { typeof(EI_Class).GetEvent("PublicEvent"), null, new VoidDelegate(tc1.ProtectedInternalVoidMethod), typeof(TargetException) }; + yield return new object[] { TypeExtensions.GetEvent(typeof(EI_Class), "PublicEvent"), null, new VoidDelegate(tc1.ProtectedInternalVoidMethod), typeof(TargetException) }; // Event not declared on target - yield return new object[] { typeof(EI_Class).GetEvent("PublicEvent"), new DummyClass(), new VoidDelegate(tc1.ProtectedInternalVoidMethod), typeof(TargetException) }; + yield return new object[] { TypeExtensions.GetEvent(typeof(EI_Class), "PublicEvent"), new DummyClass(), new VoidDelegate(tc1.ProtectedInternalVoidMethod), typeof(TargetException) }; // Event does not have a public add accessor - yield return new object[] { typeof(EI_Class).GetEvent("PrivateEvent", BindingFlags.NonPublic | BindingFlags.Instance), new DummyClass(), new VoidDelegate(tc1.ProtectedInternalVoidMethod), typeof(InvalidOperationException) }; + yield return new object[] { TypeExtensions.GetEvent(typeof(EI_Class), "PrivateEvent", BindingFlags.NonPublic | BindingFlags.Instance), new DummyClass(), new VoidDelegate(tc1.ProtectedInternalVoidMethod), typeof(InvalidOperationException) }; } [Theory] @@ -68,7 +68,7 @@ public void AddEventHandler_Invalid(EventInfo eventInfo, object target, Delegate [InlineData(nameof(EI_Class.ProtectedInternalEvent))] public void Attributes_IsSpecialName(string name) { - EventInfo eventInfo = Helpers.GetEvent(typeof(EI_Class), name); + EventInfo eventInfo = TypeExtensions.GetEvent(typeof(EI_Class), name, Helpers.AllFlags); Assert.Equal(EventAttributes.None, eventInfo.Attributes); Assert.False(eventInfo.IsSpecialName); } @@ -80,7 +80,7 @@ public void Attributes_IsSpecialName(string name) [InlineData(nameof(EI_Class.ProtectedInternalEvent), typeof(VoidDelegate))] public void EventHandlerType(string name, Type expected) { - EventInfo eventInfo = Helpers.GetEvent(typeof(EI_Class), name); + EventInfo eventInfo = TypeExtensions.GetEvent(typeof(EI_Class), name, Helpers.AllFlags); Assert.Equal(expected, eventInfo.EventHandlerType); } @@ -91,7 +91,7 @@ public void EventHandlerType(string name, Type expected) [InlineData(nameof(EI_Class.ProtectedInternalEvent), "Void add_ProtectedInternalEvent(System.Reflection.Tests.VoidDelegate)", true)] public void GetAddMethod(string name, string expectedToString, bool nonPublic) { - EventInfo eventInfo = Helpers.GetEvent(typeof(EI_Class), name); + EventInfo eventInfo = TypeExtensions.GetEvent(typeof(EI_Class), name, Helpers.AllFlags); MethodInfo method = eventInfo.GetAddMethod(); Assert.Equal(nonPublic, method == null); if (method != null) @@ -118,7 +118,7 @@ public void GetAddMethod(string name, string expectedToString, bool nonPublic) [InlineData(nameof(EI_Class.ProtectedInternalEvent))] public void GetRaiseMethod(string name) { - EventInfo eventInfo = Helpers.GetEvent(typeof(EI_Class), name); + EventInfo eventInfo = TypeExtensions.GetEvent(typeof(EI_Class), name, Helpers.AllFlags); Assert.Null(eventInfo.GetRaiseMethod()); Assert.Null(eventInfo.GetRaiseMethod(false)); Assert.Null(eventInfo.GetRaiseMethod(true)); @@ -131,7 +131,7 @@ public void GetRaiseMethod(string name) [InlineData(nameof(EI_Class.ProtectedInternalEvent), "Void remove_ProtectedInternalEvent(System.Reflection.Tests.VoidDelegate)", true)] public void GetRemoveMethod(string name, string expectedToString, bool nonPublic) { - EventInfo eventInfo = Helpers.GetEvent(typeof(EI_Class), name); + EventInfo eventInfo = TypeExtensions.GetEvent(typeof(EI_Class), name, Helpers.AllFlags); MethodInfo method = eventInfo.GetRemoveMethod(); Assert.Equal(nonPublic, method == null); if (method != null) @@ -158,7 +158,7 @@ public void GetRemoveMethod(string name, string expectedToString, bool nonPublic [InlineData("InternalEvent")] public void DeclaringType_Module(string name) { - EventInfo eventInfo = Helpers.GetEvent(typeof(EI_Class), name); + EventInfo eventInfo = TypeExtensions.GetEvent(typeof(EI_Class), name, Helpers.AllFlags); Assert.Equal(typeof(EI_Class), eventInfo.DeclaringType); Assert.Equal(typeof(EI_Class).GetTypeInfo().Module, eventInfo.Module); } @@ -170,7 +170,7 @@ public void DeclaringType_Module(string name) [InlineData("InternalEvent")] public void Name(string name) { - EventInfo eventInfo = Helpers.GetEvent(typeof(EI_Class), name); + EventInfo eventInfo = TypeExtensions.GetEvent(typeof(EI_Class), name, Helpers.AllFlags); Assert.Equal(name, eventInfo.Name); } } diff --git a/src/libraries/System.Reflection.TypeExtensions/tests/FieldInfoTests.cs b/src/libraries/System.Reflection.TypeExtensions/tests/FieldInfoTests.cs index 9fa28211632f..8908ae7ece0e 100644 --- a/src/libraries/System.Reflection.TypeExtensions/tests/FieldInfoTests.cs +++ b/src/libraries/System.Reflection.TypeExtensions/tests/FieldInfoTests.cs @@ -24,7 +24,7 @@ public class FieldInfoTests [InlineData("ConstField", FieldAttributes.Public | FieldAttributes.Static | FieldAttributes.Literal | FieldAttributes.HasDefault, typeof(FI_Enum))] public void Properties(string name, FieldAttributes attributes, Type fieldType) { - FieldInfo field = Helpers.GetField(typeof(FI_BaseClass), name); + FieldInfo field = TypeExtensions.GetField(typeof(FI_BaseClass), name, Helpers.AllFlags); Assert.Equal(name, field.Name); Assert.Equal(attributes, field.Attributes); @@ -61,14 +61,14 @@ public static IEnumerable GetValue_TestData() [MemberData(nameof(GetValue_TestData))] public void GetValue(Type type, string name, object obj, object value) { - FieldInfo field = Helpers.GetField(type, name); + FieldInfo field = TypeExtensions.GetField(type, name, Helpers.AllFlags); Assert.Equal(value, field.GetValue(obj)); } [Fact] public void GetValue_NullTarget_ThrowsTargetException() { - FieldInfo field = Helpers.GetField(typeof(FI_BaseClass), "_privateStringField"); + FieldInfo field = TypeExtensions.GetField(typeof(FI_BaseClass), "_privateStringField", Helpers.AllFlags); Assert.Throws(() => field.GetValue(null)); } } diff --git a/src/libraries/System.Reflection.TypeExtensions/tests/Helpers.cs b/src/libraries/System.Reflection.TypeExtensions/tests/Helpers.cs index 258c0e8f6f12..ff690ba85759 100644 --- a/src/libraries/System.Reflection.TypeExtensions/tests/Helpers.cs +++ b/src/libraries/System.Reflection.TypeExtensions/tests/Helpers.cs @@ -5,11 +5,6 @@ namespace System.Reflection.Tests { public class Helpers { - private const BindingFlags AllFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance; - - public static EventInfo GetEvent(Type type, string name) => type.GetEvent(name, AllFlags); - public static FieldInfo GetField(Type type, string name) => type.GetField(name, AllFlags); - public static PropertyInfo GetProperty(Type type, string name) => type.GetProperty(name, AllFlags); - public static MethodInfo GetMethod(Type type, string name) => type.GetMethod(name, AllFlags); + public const BindingFlags AllFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance; } } diff --git a/src/libraries/System.Reflection.TypeExtensions/tests/MetadataTokenTests.cs b/src/libraries/System.Reflection.TypeExtensions/tests/MetadataTokenTests.cs index e35ae25b21e2..a41695d5b784 100644 --- a/src/libraries/System.Reflection.TypeExtensions/tests/MetadataTokenTests.cs +++ b/src/libraries/System.Reflection.TypeExtensions/tests/MetadataTokenTests.cs @@ -1,8 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Collections.Generic; -using System.Linq; using System.Reflection.Emit; using Xunit; diff --git a/src/libraries/System.Reflection.TypeExtensions/tests/MethodBaseTests.cs b/src/libraries/System.Reflection.TypeExtensions/tests/MethodBaseTests.cs index affd32505977..740668a9bec3 100644 --- a/src/libraries/System.Reflection.TypeExtensions/tests/MethodBaseTests.cs +++ b/src/libraries/System.Reflection.TypeExtensions/tests/MethodBaseTests.cs @@ -11,24 +11,24 @@ public class MethodBaseTests public static IEnumerable ContainsGenericParameters_TestData() { // Methods - yield return new object[] { Helpers.GetMethod(typeof(NonGenericClass), nameof(NonGenericClass.TestGenericMethod)), true }; - yield return new object[] { Helpers.GetMethod(typeof(NonGenericClass), nameof(NonGenericClass.TestGenericMethod)).MakeGenericMethod(typeof(int)), false }; - yield return new object[] { Helpers.GetMethod(typeof(NonGenericClass), nameof(NonGenericClass.TestMethod)), false }; - yield return new object[] { Helpers.GetMethod(typeof(NonGenericClass), nameof(NonGenericClass.TestPartialGenericMethod)), true }; - yield return new object[] { Helpers.GetMethod(typeof(NonGenericClass), nameof(NonGenericClass.TestGenericReturnTypeMethod)), true }; - - yield return new object[] { Helpers.GetMethod(typeof(GenericClass), nameof(GenericClass.TestMethod)), false }; - yield return new object[] { Helpers.GetMethod(typeof(GenericClass<>), nameof(GenericClass.TestMethod)), true }; - yield return new object[] { Helpers.GetMethod(typeof(GenericClass<>), nameof(GenericClass.TestMultipleGenericMethod)), true }; - yield return new object[] { Helpers.GetMethod(typeof(GenericClass), nameof(GenericClass.TestMultipleGenericMethod)), true }; - yield return new object[] { Helpers.GetMethod(typeof(GenericClass<>), nameof(GenericClass.TestVoidMethod)), true }; - yield return new object[] { Helpers.GetMethod(typeof(GenericClass), nameof(GenericClass.TestVoidMethod)), false }; + yield return new object[] { TypeExtensions.GetMethod(typeof(NonGenericClass), nameof(NonGenericClass.TestGenericMethod), Helpers.AllFlags), true }; + yield return new object[] { TypeExtensions.GetMethod(typeof(NonGenericClass), nameof(NonGenericClass.TestGenericMethod), Helpers.AllFlags).MakeGenericMethod(typeof(int)), false }; + yield return new object[] { TypeExtensions.GetMethod(typeof(NonGenericClass), nameof(NonGenericClass.TestMethod), Helpers.AllFlags), false }; + yield return new object[] { TypeExtensions.GetMethod(typeof(NonGenericClass), nameof(NonGenericClass.TestPartialGenericMethod), Helpers.AllFlags), true }; + yield return new object[] { TypeExtensions.GetMethod(typeof(NonGenericClass), nameof(NonGenericClass.TestGenericReturnTypeMethod), Helpers.AllFlags), true }; + + yield return new object[] { TypeExtensions.GetMethod(typeof(GenericClass), nameof(GenericClass.TestMethod), Helpers.AllFlags), false }; + yield return new object[] { TypeExtensions.GetMethod(typeof(GenericClass<>), nameof(GenericClass.TestMethod), Helpers.AllFlags), true }; + yield return new object[] { TypeExtensions.GetMethod(typeof(GenericClass<>), nameof(GenericClass.TestMultipleGenericMethod), Helpers.AllFlags), true }; + yield return new object[] { TypeExtensions.GetMethod(typeof(GenericClass), nameof(GenericClass.TestMultipleGenericMethod), Helpers.AllFlags), true }; + yield return new object[] { TypeExtensions.GetMethod(typeof(GenericClass<>), nameof(GenericClass.TestVoidMethod), Helpers.AllFlags), true }; + yield return new object[] { TypeExtensions.GetMethod(typeof(GenericClass), nameof(GenericClass.TestVoidMethod), Helpers.AllFlags), false }; // Constructors - yield return new object[] { typeof(NonGenericClass).GetConstructor(new Type[0]), false }; - yield return new object[] { typeof(NonGenericClass).GetConstructor(new Type[] { typeof(int) }), false }; + yield return new object[] { TypeExtensions.GetConstructor(typeof(NonGenericClass), new Type[0]), false }; + yield return new object[] { TypeExtensions.GetConstructor(typeof(NonGenericClass), new Type[] { typeof(int) }), false }; - foreach (MethodBase constructor in typeof(GenericClass<>).GetConstructors()) + foreach (MethodBase constructor in TypeExtensions.GetConstructors(typeof(GenericClass<>))) { // ContainsGenericParameters should behave same for both methods and constructors. // If method/ctor or the declaring type contains uninstantiated open generic parameter, @@ -36,7 +36,7 @@ public static IEnumerable ContainsGenericParameters_TestData() yield return new object[] { constructor, true }; } - foreach (MethodBase constructor in typeof(GenericClass).GetConstructors()) + foreach (MethodBase constructor in TypeExtensions.GetConstructors(typeof(GenericClass))) { yield return new object[] { constructor, false }; } @@ -53,7 +53,7 @@ public void ContainsGenericParameters(MethodBase methodBase, bool expected) [InlineData(typeof(NonGenericClass), "TestMethod2", new Type[] { typeof(int), typeof(float), typeof(string) })] public void GetMethod_String_Type(Type type, string name, Type[] typeArguments) { - MethodInfo method = type.GetMethod(name, typeArguments); + MethodInfo method = TypeExtensions.GetMethod(type, name, typeArguments); Assert.Equal(name, method.Name); } diff --git a/src/libraries/System.Reflection.TypeExtensions/tests/MethodInfoTests.cs b/src/libraries/System.Reflection.TypeExtensions/tests/MethodInfoTests.cs index 8989bd1d8e34..d7e81f4a2884 100644 --- a/src/libraries/System.Reflection.TypeExtensions/tests/MethodInfoTests.cs +++ b/src/libraries/System.Reflection.TypeExtensions/tests/MethodInfoTests.cs @@ -15,7 +15,7 @@ public class MethodInfoTests [InlineData(typeof(StringImpersonator), nameof(StringImpersonator.IsNullOrEmpty))] public void Properties(Type type, string name) { - MethodInfo method = Helpers.GetMethod(type, name); + MethodInfo method = TypeExtensions.GetMethod(type, name, Helpers.AllFlags); Assert.Equal(type, method.DeclaringType); Assert.Equal(type.GetTypeInfo().Module, method.Module); @@ -44,7 +44,7 @@ public void Properties(Type type, string name) [InlineData(typeof(MI_ClassWithInterface), nameof(MI_ClassWithInterface.MethodA), new Type[0], typeof(MI_ClassWithInterface))] public void GetBaseDefinition(Type type, string name, Type[] typeArguments, Type declaringType) { - MethodInfo method = type.GetMethod(name, typeArguments); + MethodInfo method = TypeExtensions.GetMethod(type, name, typeArguments); MethodInfo baseDefinition = method.GetBaseDefinition(); Assert.Equal(name, baseDefinition.Name); @@ -69,7 +69,7 @@ public static IEnumerable GetGenericArguments_TestData() [MemberData(nameof(GetGenericArguments_TestData))] public void GetGenericArguments(Type type, string name, string[] argumentNames) { - MethodInfo method = Helpers.GetMethod(type, name); + MethodInfo method = TypeExtensions.GetMethod(type, name, Helpers.AllFlags); Type[] arguments = method.GetGenericArguments(); Assert.Equal(argumentNames.Length, arguments.Length); Assert.Equal(argumentNames, arguments.Select(argumentType => argumentType.Name)); @@ -78,7 +78,7 @@ public void GetGenericArguments(Type type, string name, string[] argumentNames) [Fact] public void Invoke_StringArgument_ReturnsString() { - MethodInfo method = typeof(MI_NonGenericClass).GetMethod(nameof(MI_NonGenericClass.MethodA), new Type[] { typeof(string) }); + MethodInfo method = TypeExtensions.GetMethod(typeof(MI_NonGenericClass), nameof(MI_NonGenericClass.MethodA), new Type[] { typeof(string) }); Assert.Equal("test string", method.Invoke(new MI_NonGenericClass(), new object[] { "test string" })); } } diff --git a/src/libraries/System.Reflection.TypeExtensions/tests/PropertyInfoTests.cs b/src/libraries/System.Reflection.TypeExtensions/tests/PropertyInfoTests.cs index 0bf74b581df4..b0cd7b967c5b 100644 --- a/src/libraries/System.Reflection.TypeExtensions/tests/PropertyInfoTests.cs +++ b/src/libraries/System.Reflection.TypeExtensions/tests/PropertyInfoTests.cs @@ -15,7 +15,7 @@ public class PropertyInfoTests [InlineData(typeof(string), nameof(string.Length))] public void Properties(Type type, string name) { - PropertyInfo property = Helpers.GetProperty(type, name); + PropertyInfo property = TypeExtensions.GetProperty(type, name, Helpers.AllFlags); Assert.Equal(type, property.DeclaringType); Assert.Equal(type.GetTypeInfo().Module, property.Module); Assert.Equal(name, property.Name); @@ -26,7 +26,7 @@ public void Properties(Type type, string name) [Fact] public void SetValue_CantWrite_ThrowsArgumentException() { - PropertyInfo property = Helpers.GetProperty(typeof(PI_SubClass), nameof(PI_BaseClass.PublicGetPrivateSetProperty)); + PropertyInfo property = TypeExtensions.GetProperty(typeof(PI_SubClass), nameof(PI_BaseClass.PublicGetPrivateSetProperty), Helpers.AllFlags); Assert.False(property.CanWrite); AssertExtensions.Throws(null, () => property.SetValue(new PI_SubClass(), 5)); } @@ -47,7 +47,7 @@ public void SetValue_CantWrite_ThrowsArgumentException() [InlineData(typeof(PI_SubClass), nameof(PI_BaseClass.PublicGetPrivateSetProperty), true, false, false, false)] public void GetGetMethod_GetSetMethod(Type type, string name, bool hasGetter, bool nonPublicGetter, bool hasSetter, bool nonPublicSetter) { - PropertyInfo property = Helpers.GetProperty(type, name); + PropertyInfo property = TypeExtensions.GetProperty(type, name, Helpers.AllFlags); VerifyGetMethod(property, property.GetGetMethod(), hasGetter && !nonPublicGetter, nonPublicGetter); Assert.Equal(property.GetGetMethod(), property.GetGetMethod(false)); diff --git a/src/libraries/System.Reflection.TypeExtensions/tests/TypeTests.cs b/src/libraries/System.Reflection.TypeExtensions/tests/TypeTests.cs index 74baa7bd1422..20f91ef81bfe 100644 --- a/src/libraries/System.Reflection.TypeExtensions/tests/TypeTests.cs +++ b/src/libraries/System.Reflection.TypeExtensions/tests/TypeTests.cs @@ -32,7 +32,7 @@ public void Properties(Type type, string name, MemberTypes memberType) [InlineData(typeof(GenericClass), new string[] { "Int32 ReturnAndSetField(Int32)" })] public void GetDefaultMembers(Type type, string[] expectedNames) { - string[] memberNames = type.GetDefaultMembers().Select(member => member.Name).ToArray(); + string[] memberNames = TypeExtensions.GetDefaultMembers(type).Select(member => member.Name).ToArray(); Assert.Equal(expectedNames.Length, memberNames.Length); Assert.All(expectedNames, toString => memberNames.Contains(toString)); } @@ -132,11 +132,11 @@ public void GetEvents(BindingFlags bindingAttributes, string[] expectedNames) { if (bindingAttributes == DefaultBindingFlags) { - string[] eventNames1 = typeof(Cat).GetEvents().Select(eventInfo => eventInfo.Name).ToArray(); + string[] eventNames1 = TypeExtensions.GetEvents(typeof(Cat)).Select(eventInfo => eventInfo.Name).ToArray(); Assert.Equal(expectedNames.Length, eventNames1.Length); Assert.All(expectedNames, name => eventNames1.Contains(name)); } - string[] eventNames2 = typeof(Cat).GetEvents(bindingAttributes).Select(eventInfo => eventInfo.Name).ToArray(); + string[] eventNames2 = TypeExtensions.GetEvents(typeof(Cat), bindingAttributes).Select(eventInfo => eventInfo.Name).ToArray(); Assert.Equal(expectedNames.Length, eventNames2.Length); Assert.All(expectedNames, name => eventNames2.Contains(name)); } @@ -154,7 +154,7 @@ public static IEnumerable GetFields_TestData() [MemberData(nameof(GetFields_TestData))] public void GetFields(Type type, string[] expectedNames) { - string[] fieldNames = type.GetFields().Select(field => field.Name).ToArray(); + string[] fieldNames = TypeExtensions.GetFields(type).Select(field => field.Name).ToArray(); Assert.Equal(expectedNames.Length, fieldNames.Length); Assert.All(expectedNames, name => fieldNames.Contains(name)); } @@ -173,7 +173,7 @@ public void GetFields(Type type, string[] expectedNames) [InlineData(typeof(TI_Struct?), new Type[0])] public void GetInterfaces(Type type, Type[] expected) { - Type[] interfaces = type.GetInterfaces(); + Type[] interfaces = TypeExtensions.GetInterfaces(type); Assert.Equal(expected.Length, interfaces.Length); Assert.All(expected, interfaceType => interfaces.Equals(interfaceType)); } @@ -181,7 +181,7 @@ public void GetInterfaces(Type type, Type[] expected) [Fact] public void GetInterfaces_GenericInterfaceWithTypeParameter_ReturnsExpectedToString() { - Type[] interfaces = typeof(GenericClassWithInterface<>).GetInterfaces(); + Type[] interfaces = TypeExtensions.GetInterfaces(typeof(GenericClassWithInterface<>)); Assert.Equal(1, interfaces.Length); Assert.Equal("System.Reflection.Tests.IGenericInterface`1[T]", interfaces[0].ToString()); } @@ -213,7 +213,7 @@ public void GetMember(Type type, string name, BindingFlags bindingAttributes, st { if (bindingAttributes == DefaultBindingFlags) { - string[] memberNames1 = type.GetMember(name).Select(member => member.Name).ToArray(); + string[] memberNames1 = TypeExtensions.GetMember(type, name).Select(member => member.Name).ToArray(); Assert.Equal(expectedNames.Length, memberNames1.Length); Assert.All(expectedNames, expectedName => memberNames1.Contains(expectedName)); if (name == "*") @@ -225,13 +225,13 @@ public void GetMember(Type type, string name, BindingFlags bindingAttributes, st Assert.All(memberNamesFromAsterix1, memberInfo => memberNamesFromMethod1.Contains(memberInfo)); } } - string[] memberNames2 = type.GetMember(name, bindingAttributes).Select(member => member.Name).ToArray(); + string[] memberNames2 = TypeExtensions.GetMember(type, name, bindingAttributes).Select(member => member.Name).ToArray(); Assert.Equal(expectedNames.Length, memberNames2.Length); Assert.All(expectedNames, expectedName => memberNames2.Contains(expectedName)); if (name == "*") { - MemberInfo[] memberNamesFromAsterix2 = type.GetMember(name, bindingAttributes); - MemberInfo[] memberNamesFromMethod2 = type.GetMembers(bindingAttributes); + MemberInfo[] memberNamesFromAsterix2 = TypeExtensions.GetMember(type, name, bindingAttributes); + MemberInfo[] memberNamesFromMethod2 = TypeExtensions.GetMembers(type, bindingAttributes); Assert.Equal(memberNamesFromAsterix2.Length, memberNamesFromMethod2.Length); Assert.All(memberNamesFromAsterix2, memberInfo => memberNamesFromMethod2.Contains(memberInfo)); @@ -334,11 +334,11 @@ public void GetMethods(Type type, BindingFlags bindingAttributes, string[] expec { if (bindingAttributes == DefaultBindingFlags) { - string[] methodNames1 = type.GetMethods().Select(method => method.Name).ToArray(); + string[] methodNames1 = TypeExtensions.GetMethods(type).Select(method => method.Name).ToArray(); Assert.Equal(expectedNames.Length, methodNames1.Length); Assert.All(expectedNames, name => methodNames1.Contains(name)); } - string[] methodNames2 = type.GetMethods(bindingAttributes).Select(method => method.Name).ToArray(); + string[] methodNames2 = TypeExtensions.GetMethods(type, bindingAttributes).Select(method => method.Name).ToArray(); Assert.Equal(expectedNames.Length, methodNames2.Length); Assert.All(expectedNames, name => methodNames2.Contains(name)); } @@ -419,11 +419,11 @@ public void GetProperties(Type type, BindingFlags bindingAttributes, string[] ex { if (bindingAttributes == DefaultBindingFlags) { - string[] propertyNames1 = type.GetProperties().Select(method => method.Name).ToArray(); + string[] propertyNames1 = TypeExtensions.GetProperties(type).Select(method => method.Name).ToArray(); Assert.Equal(expectedNames.Length, propertyNames1.Length); Assert.All(expectedNames, name => propertyNames1.Contains(name)); } - string[] propertyNames2 = type.GetProperties(bindingAttributes).Select(method => method.Name).ToArray(); + string[] propertyNames2 = TypeExtensions.GetProperties(type, bindingAttributes).Select(method => method.Name).ToArray(); Assert.Equal(expectedNames.Length, propertyNames2.Length); Assert.All(expectedNames, name => propertyNames2.Contains(name)); } @@ -446,17 +446,17 @@ public void GetProperty(Type type, string name, BindingFlags bindingAttributes, { if (bindingAttributes == DefaultBindingFlags) { - Assert.Equal(name, type.GetProperty(name).Name); + Assert.Equal(name, TypeExtensions.GetProperty(type, name).Name); } - Assert.Equal(name, type.GetProperty(name, bindingAttributes).Name); + Assert.Equal(name, TypeExtensions.GetProperty(type, name, bindingAttributes).Name); } else { if (types.Length == 0) { - Assert.Equal(name, type.GetProperty(name, returnType).Name); + Assert.Equal(name, TypeExtensions.GetProperty(type, name, returnType).Name); } - Assert.Equal(name, type.GetProperty(name, returnType, types).Name); + Assert.Equal(name, TypeExtensions.GetProperty(type, name, returnType, types).Name); } } @@ -542,13 +542,13 @@ public static IEnumerable IsInstanceOfType_TestData() [MemberData(nameof(IsInstanceOfType_TestData))] public void IsInstanceOfType(Type type, object value, bool expected) { - Assert.Equal(expected, type.IsInstanceOfType(value)); + Assert.Equal(expected, TypeExtensions.IsInstanceOfType(type, value)); } [Fact] public void IsInstanceOfType_NullableTypeAndValue_ReturnsTrue() { - Assert.True(typeof(int?).IsInstanceOfType((int?)100)); + Assert.True(TypeExtensions.IsInstanceOfType(typeof(int?), (int?)100)); } [Theory] @@ -567,21 +567,21 @@ public void Methods_SameAsUnderlyingType(Type type) TypeInfo typeInfo = type.GetTypeInfo(); BindingFlags declaredFlags = BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance; - Assert.Equal(type.GetMethod("ProtectedMethod", declaredFlags), typeInfo.GetDeclaredMethods("ProtectedMethod").First()); - Assert.Equal(type.GetNestedType("PublicNestedType", declaredFlags), typeInfo.GetDeclaredNestedType("PublicNestedType").AsType()); - Assert.Equal(type.GetProperty("PrivateProperty", declaredFlags), typeInfo.GetDeclaredProperty("PrivateProperty")); - - Assert.All(type.GetFields(declaredFlags), field => typeInfo.DeclaredFields.Contains(field)); - Assert.All(type.GetMethods(declaredFlags), method => typeInfo.DeclaredMethods.Contains(method)); - Assert.All(type.GetNestedTypes(declaredFlags), nestedType => typeInfo.DeclaredNestedTypes.Contains(nestedType.GetTypeInfo())); - Assert.All(type.GetProperties(declaredFlags), property => typeInfo.DeclaredProperties.Contains(property)); - Assert.All(type.GetEvents(declaredFlags), eventInfo => typeInfo.DeclaredEvents.Contains(eventInfo)); - Assert.All(type.GetConstructors(declaredFlags), constructor => typeInfo.DeclaredConstructors.Contains(constructor)); - - Assert.All(type.GetEvents(), eventInfo => typeInfo.AsType().GetEvents().Contains(eventInfo)); - Assert.All(type.GetFields(), fieldInfo => typeInfo.AsType().GetFields().Contains(fieldInfo)); - Assert.All(type.GetMethods(), methodInfo => typeInfo.AsType().GetMethods().Contains(methodInfo)); - Assert.All(type.GetProperties(), propertyInfo => typeInfo.AsType().GetProperties().Contains(propertyInfo)); + Assert.Equal(TypeExtensions.GetMethod(type, "ProtectedMethod", declaredFlags), typeInfo.GetDeclaredMethods("ProtectedMethod").First()); + Assert.Equal(TypeExtensions.GetNestedType(type, "PublicNestedType", declaredFlags), typeInfo.GetDeclaredNestedType("PublicNestedType").AsType()); + Assert.Equal(TypeExtensions.GetProperty(type, "PrivateProperty", declaredFlags), typeInfo.GetDeclaredProperty("PrivateProperty")); + + Assert.All(TypeExtensions.GetFields(type, declaredFlags), field => typeInfo.DeclaredFields.Contains(field)); + Assert.All(TypeExtensions.GetMethods(type, declaredFlags), method => typeInfo.DeclaredMethods.Contains(method)); + Assert.All(TypeExtensions.GetNestedTypes(type, declaredFlags), nestedType => typeInfo.DeclaredNestedTypes.Contains(nestedType.GetTypeInfo())); + Assert.All(TypeExtensions.GetProperties(type, declaredFlags), property => typeInfo.DeclaredProperties.Contains(property)); + Assert.All(TypeExtensions.GetEvents(type, declaredFlags), eventInfo => typeInfo.DeclaredEvents.Contains(eventInfo)); + Assert.All(TypeExtensions.GetConstructors(type, declaredFlags), constructor => typeInfo.DeclaredConstructors.Contains(constructor)); + + Assert.All(TypeExtensions.GetEvents(type), eventInfo => typeInfo.AsType().GetEvents().Contains(eventInfo)); + Assert.All(TypeExtensions.GetFields(type), fieldInfo => typeInfo.AsType().GetFields().Contains(fieldInfo)); + Assert.All(TypeExtensions.GetMethods(type), methodInfo => typeInfo.AsType().GetMethods().Contains(methodInfo)); + Assert.All(TypeExtensions.GetProperties(type), propertyInfo => typeInfo.AsType().GetProperties().Contains(propertyInfo)); Assert.Equal(type.GetType(), typeInfo.GetType()); Assert.True(type.Equals(typeInfo)); diff --git a/src/libraries/System.Resources.Extensions/pkg/System.Resources.Extensions.pkgproj b/src/libraries/System.Resources.Extensions/pkg/System.Resources.Extensions.pkgproj index d7fc3d112136..3ac0955a841c 100644 --- a/src/libraries/System.Resources.Extensions/pkg/System.Resources.Extensions.pkgproj +++ b/src/libraries/System.Resources.Extensions/pkg/System.Resources.Extensions.pkgproj @@ -1,10 +1,9 @@  - + uap10.0.16299;net461;netcoreapp2.0;$(AllXamarinFrameworks) - \ No newline at end of file diff --git a/src/libraries/System.Resources.Extensions/src/System.Resources.Extensions.csproj b/src/libraries/System.Resources.Extensions/src/System.Resources.Extensions.csproj index 100a496b86af..00a7a46104f0 100644 --- a/src/libraries/System.Resources.Extensions/src/System.Resources.Extensions.csproj +++ b/src/libraries/System.Resources.Extensions/src/System.Resources.Extensions.csproj @@ -1,7 +1,8 @@ true - netstandard2.0 + netstandard2.0;net461;$(NetFrameworkCurrent) + true $(DefineConstants);RESOURCES_EXTENSIONS annotations @@ -32,4 +33,34 @@ + + + + + + + <_packageTargetsFile>$(IntermediateOutputPath)$(AssemblyName).targets + + + + + <_packageTargetsFileContent> + + + + + +]]> + + + + + + diff --git a/src/libraries/System.Resources.Extensions/src/System/Resources/Extensions/DeserializingResourceReader.cs b/src/libraries/System.Resources.Extensions/src/System/Resources/Extensions/DeserializingResourceReader.cs index defc47de9c91..da143cb11b3e 100644 --- a/src/libraries/System.Resources.Extensions/src/System/Resources/Extensions/DeserializingResourceReader.cs +++ b/src/libraries/System.Resources.Extensions/src/System/Resources/Extensions/DeserializingResourceReader.cs @@ -34,6 +34,7 @@ private bool ValidateReaderType(string readerType) return false; } + // Issue https://github.com/dotnet/runtime/issues/39292 tracks finding an alternative to BinaryFormatter private object ReadBinaryFormattedObject() { if (_formatter == null) diff --git a/src/libraries/System.Resources.Extensions/tests/BinaryResourceWriterUnitTest.cs b/src/libraries/System.Resources.Extensions/tests/BinaryResourceWriterUnitTest.cs index a98ccea1bc2d..c6061a82de2b 100644 --- a/src/libraries/System.Resources.Extensions/tests/BinaryResourceWriterUnitTest.cs +++ b/src/libraries/System.Resources.Extensions/tests/BinaryResourceWriterUnitTest.cs @@ -262,7 +262,7 @@ public static void PrimitiveResourcesAsStrings() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/34495", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] [ActiveIssue("https://github.com/dotnet/runtime/issues/34008", TestPlatforms.Linux, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] public static void BinaryFormattedResources() @@ -300,7 +300,7 @@ public static void BinaryFormattedResources() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/34495", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] [ActiveIssue("https://github.com/dotnet/runtime/issues/34008", TestPlatforms.Linux, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] public static void BinaryFormattedResourcesWithoutTypeName() @@ -436,7 +436,7 @@ public static void StreamResources() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] public static void CanReadViaResourceManager() { ResourceManager resourceManager = new ResourceManager(typeof(TestData)); @@ -474,7 +474,7 @@ public static void ResourceManagerLoadsCorrectReader() Assert.IsType(reader); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] public static void EmbeddedResourcesAreUpToDate() { // this is meant to catch a case where our embedded test resources are out of date with respect to the current writer. diff --git a/src/libraries/System.Resources.ResourceManager/tests/NeutralResourcesLanguageAttributeTests.cs b/src/libraries/System.Resources.ResourceManager/tests/NeutralResourcesLanguageAttributeTests.cs index cc363114ffcf..962e45b055c0 100644 --- a/src/libraries/System.Resources.ResourceManager/tests/NeutralResourcesLanguageAttributeTests.cs +++ b/src/libraries/System.Resources.ResourceManager/tests/NeutralResourcesLanguageAttributeTests.cs @@ -2,6 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using Xunit; +using System.Linq; +using System.Reflection; +using System.Globalization; namespace System.Resources.Tests { @@ -23,5 +26,24 @@ public static void ConstructorArgumentNull() { Assert.Throws(() => new NeutralResourcesLanguageAttribute(null)); } + + [Theory] + [InlineData(typeof(object))] // System.Private.CoreLib, + [InlineData(typeof(System.Collections.Stack))] // System.Collections.NonGeneric + [InlineData(typeof(System.Collections.Specialized.ListDictionary))] // System.Collections.Specialized + [InlineData(typeof(System.Collections.Immutable.IImmutableList))] // System.Collections.Immutable + [InlineData(typeof(System.Collections.Concurrent.ConcurrentBag))] // System.Collections.Concurrent + [InlineData(typeof(System.Console))] // System.Console + [InlineData(typeof(System.IO.Directory))] // System.IO.FileSystem + [InlineData(typeof(System.Linq.Enumerable))] // System.Linq + [InlineData(typeof(System.Net.Http.HttpClient))] // System.Net.Http + [InlineData(typeof(System.Text.RegularExpressions.Regex))] // System.Text.RegularExpressions + [InlineData(typeof(System.Threading.Barrier))] // System.Threading + public static void TestAttributeExistence(Type type) => Assert.Equal("en-US", ChildResourceManager.GetNeutralResourcesCulture(type.Assembly).Name); + + public class ChildResourceManager : ResourceManager + { + public static CultureInfo GetNeutralResourcesCulture(Assembly a) => ResourceManager.GetNeutralResourcesLanguage(a); + } } } diff --git a/src/libraries/System.Resources.ResourceManager/tests/ResourceManagerTests.cs b/src/libraries/System.Resources.ResourceManager/tests/ResourceManagerTests.cs index ba15e0990a49..9c038b540e12 100644 --- a/src/libraries/System.Resources.ResourceManager/tests/ResourceManagerTests.cs +++ b/src/libraries/System.Resources.ResourceManager/tests/ResourceManagerTests.cs @@ -228,7 +228,7 @@ public static IEnumerable EnglishNonStringResourceData() yield return new object[] { "Size", new Size(20, 30), true }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] [MemberData(nameof(EnglishNonStringResourceData))] public static void GetObject(string key, object expectedValue, bool requiresBinaryFormatter) { @@ -299,7 +299,7 @@ public static void GetResourceSet_Strings(string key, string expectedValue) Assert.Equal(expectedValue, set.GetString(key)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] [MemberData(nameof(EnglishNonStringResourceData))] public static void GetResourceSet_NonStrings(string key, object expectedValue, bool requiresBinaryFormatter) { diff --git a/src/libraries/System.Runtime.CompilerServices.Unsafe/ref/System.Runtime.CompilerServices.Unsafe.cs b/src/libraries/System.Runtime.CompilerServices.Unsafe/ref/System.Runtime.CompilerServices.Unsafe.cs index d5c70b5b398f..ae977a0cdc33 100644 --- a/src/libraries/System.Runtime.CompilerServices.Unsafe/ref/System.Runtime.CompilerServices.Unsafe.cs +++ b/src/libraries/System.Runtime.CompilerServices.Unsafe/ref/System.Runtime.CompilerServices.Unsafe.cs @@ -17,7 +17,7 @@ public static partial class Unsafe public static unsafe ref T AsRef(void* source) { throw null; } public static ref T AsRef(in T source) { throw null; } #if NETSTANDARD2_1 - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("o")] #endif public static T As(object? o) where T : class? { throw null; } diff --git a/src/libraries/System.Runtime.CompilerServices.Unsafe/ref/System.Runtime.CompilerServices.Unsafe.csproj b/src/libraries/System.Runtime.CompilerServices.Unsafe/ref/System.Runtime.CompilerServices.Unsafe.csproj index 5985f51fda7b..a0fa82e4ab51 100644 --- a/src/libraries/System.Runtime.CompilerServices.Unsafe/ref/System.Runtime.CompilerServices.Unsafe.csproj +++ b/src/libraries/System.Runtime.CompilerServices.Unsafe/ref/System.Runtime.CompilerServices.Unsafe.csproj @@ -3,10 +3,14 @@ true false enable - netstandard2.0;netstandard1.0;netstandard2.1 + netstandard2.0;netstandard1.0;netstandard2.1;net461;$(NetFrameworkCurrent) + true + + + \ No newline at end of file diff --git a/src/libraries/System.Runtime.CompilerServices.VisualC/ref/System.Runtime.CompilerServices.VisualC.cs b/src/libraries/System.Runtime.CompilerServices.VisualC/ref/System.Runtime.CompilerServices.VisualC.cs index 6ae4dfadad07..f636324e4f4e 100644 --- a/src/libraries/System.Runtime.CompilerServices.VisualC/ref/System.Runtime.CompilerServices.VisualC.cs +++ b/src/libraries/System.Runtime.CompilerServices.VisualC/ref/System.Runtime.CompilerServices.VisualC.cs @@ -49,7 +49,7 @@ public sealed partial class NativeCppClassAttribute : System.Attribute { public NativeCppClassAttribute() { } } - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple=true)] + [AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple=true)] public sealed class CppInlineNamespaceAttribute : Attribute { public CppInlineNamespaceAttribute(string dottedName) {} diff --git a/src/libraries/System.Runtime.CompilerServices.VisualC/ref/System.Runtime.CompilerServices.VisualC.manual.cs b/src/libraries/System.Runtime.CompilerServices.VisualC/ref/System.Runtime.CompilerServices.VisualC.manual.cs index c828b4881384..6db2458156ab 100644 --- a/src/libraries/System.Runtime.CompilerServices.VisualC/ref/System.Runtime.CompilerServices.VisualC.manual.cs +++ b/src/libraries/System.Runtime.CompilerServices.VisualC/ref/System.Runtime.CompilerServices.VisualC.manual.cs @@ -36,12 +36,12 @@ internal AssemblyAttributesGoHereSM() { } } - [System.AttributeUsage(System.AttributeTargets.All)] + [System.AttributeUsageAttribute(System.AttributeTargets.All)] internal sealed class DecoratedNameAttribute : System.Attribute { public DecoratedNameAttribute(string decoratedName) {} } - [AttributeUsage(AttributeTargets.Class | + [AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Field | diff --git a/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs b/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs index b3d13e3d8776..89ec53ebd419 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs @@ -44,6 +44,7 @@ public void RelativeSearchPath_Is_Null() } [Fact] + [PlatformSpecific(~TestPlatforms.Browser)] // throws pNSE public void TargetFrameworkTest() { const int ExpectedExitCode = 0; @@ -129,7 +130,7 @@ public void FriendlyName() // GetEntryAssembly may be null (i.e. desktop) if (expected == null) - expected = Assembly.GetExecutingAssembly().GetName().Name; + expected = "DefaultDomain"; Assert.Equal(expected, s); } @@ -357,6 +358,7 @@ public void Load() } [Fact] + [PlatformSpecific(~TestPlatforms.Browser)] public void LoadBytes() { Assembly assembly = typeof(AppDomainTests).Assembly; @@ -371,6 +373,7 @@ public void ReflectionOnlyGetAssemblies() } [Fact] + [PlatformSpecific(~TestPlatforms.Browser)] // Throws PNSE public void MonitoringIsEnabled() { Assert.True(AppDomain.MonitoringIsEnabled); diff --git a/src/libraries/System.Runtime.Extensions/tests/System/Environment.Exit.cs b/src/libraries/System.Runtime.Extensions/tests/System/Environment.Exit.cs index 34fde94009ca..0ba249373cc7 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/Environment.Exit.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/Environment.Exit.cs @@ -41,6 +41,7 @@ public static void ExitCode_Roundtrips(int exitCode) [InlineData(1)] // setting ExitCode and exiting Main [InlineData(2)] // setting ExitCode both from Main and from an Unloading event handler. [InlineData(3)] // using Exit(exitCode) + [PlatformSpecific(~TestPlatforms.Browser)] // throws PNSE public static void ExitCode_VoidMainAppReturnsSetValue(int mode) { int expectedExitCode = 123; diff --git a/src/libraries/System.Runtime.Extensions/tests/System/Environment.MachineName.cs b/src/libraries/System.Runtime.Extensions/tests/System/Environment.MachineName.cs index 1d12af5cbd53..eac8bf18bb12 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/Environment.MachineName.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/Environment.MachineName.cs @@ -20,6 +20,8 @@ internal static string GetComputerName() #if !Unix return Environment.GetEnvironmentVariable("COMPUTERNAME"); #else + if (PlatformDetection.IsBrowser) + return "localhost"; string temp = Interop.Sys.GetNodeName(); int index = temp.IndexOf('.'); return index < 0 ? temp : temp.Substring(0, index); diff --git a/src/libraries/System.Runtime.Extensions/tests/System/Environment.StackTrace.cs b/src/libraries/System.Runtime.Extensions/tests/System/Environment.StackTrace.cs index e3fa2c36d28f..4077019d7010 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/Environment.StackTrace.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/Environment.StackTrace.cs @@ -68,6 +68,7 @@ public TestClass() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39223", TestPlatforms.Browser)] public void StackTraceDoesNotStartWithInternalFrame() { string stackTrace = Environment.StackTrace; diff --git a/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs b/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs index 41e2dfdd946c..ff8eb26cd243 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs @@ -142,7 +142,7 @@ public void OSVersion_ValidVersion() Assert.Contains(version.ToString(2), versionString); - string expectedOS = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "Windows" : RuntimeInformation.IsOSPlatform(OSPlatform.Browser) ? "Other" : "Unix"; + string expectedOS = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "Windows " : RuntimeInformation.IsOSPlatform(OSPlatform.Browser) ? "Other " : "Unix "; Assert.Contains(expectedOS, versionString); } @@ -221,7 +221,10 @@ public void Version_Valid() [Fact] public void WorkingSet_Valid() { - Assert.True(Environment.WorkingSet > 0, "Expected positive WorkingSet value"); + if (PlatformDetection.IsBrowser) + Assert.Equal(0, Environment.WorkingSet); + else + Assert.True(Environment.WorkingSet > 0, "Expected positive WorkingSet value"); } [Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // fail fast crashes the process diff --git a/src/libraries/System.Runtime.Extensions/tests/System/IO/PathTests.cs b/src/libraries/System.Runtime.Extensions/tests/System/IO/PathTests.cs index 45023c0873fd..2ef46ada0d0b 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/IO/PathTests.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/IO/PathTests.cs @@ -216,8 +216,6 @@ public static TheoryData GetFullPath_BasicExpansions { currentDirectory, currentDirectory }, // "." => current directory { ".", currentDirectory }, - // ".." => up a directory - { "..", Path.GetDirectoryName(currentDirectory) }, // "dir/./././." => "dir" { Path.Combine(currentDirectory, ".", ".", ".", ".", "."), currentDirectory }, // "dir///." => "dir" @@ -234,6 +232,12 @@ public static TheoryData GetFullPath_BasicExpansions { root + new string(Path.DirectorySeparatorChar, 3), root }, }; + if (currentDirectory != Path.GetPathRoot(currentDirectory)) + { + // ".." => up a directory + data.Add("..", Path.GetDirectoryName(currentDirectory)); + } + // Path longer than MaxPath that normalizes down to less than MaxPath const int Iters = 10000; var longPath = new StringBuilder(currentDirectory, currentDirectory.Length + (Iters * 2)); diff --git a/src/libraries/System.Runtime.Extensions/tests/System/Reflection/AssemblyNameProxyTests.cs b/src/libraries/System.Runtime.Extensions/tests/System/Reflection/AssemblyNameProxyTests.cs index 14dc0a0f1d0b..39059fa7eba1 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/Reflection/AssemblyNameProxyTests.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/Reflection/AssemblyNameProxyTests.cs @@ -13,6 +13,7 @@ namespace System.Reflection.Tests public static class AssemblyNameProxyTests { [Fact] + [PlatformSpecific(~TestPlatforms.Browser)] public static void GetAssemblyName_AssemblyNameProxy() { AssemblyNameProxy anp = new AssemblyNameProxy(); diff --git a/src/libraries/System.Runtime.Extensions/tests/System/StringComparer.cs b/src/libraries/System.Runtime.Extensions/tests/System/StringComparer.cs index b60edf9c26fb..62edd56f51cb 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/StringComparer.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/StringComparer.cs @@ -86,8 +86,12 @@ public static IEnumerable UpperLowerCasing_TestData() // lower upper Culture yield return new object[] { "abcd", "ABCD", "en-US" }; yield return new object[] { "latin i", "LATIN I", "en-US" }; - yield return new object[] { "turky \u0131", "TURKY I", "tr-TR" }; - yield return new object[] { "turky i", "TURKY \u0130", "tr-TR" }; + + if (PlatformDetection.IsNotInvariantGlobalization) + { + yield return new object[] { "turky \u0131", "TURKY I", "tr-TR" }; + yield return new object[] { "turky i", "TURKY \u0130", "tr-TR" }; + } } [Theory] @@ -159,27 +163,28 @@ public static void FromComparisonInvalidTest() AssertExtensions.Throws("comparisonType", () => StringComparer.FromComparison(maxInvalid)); } - public static TheoryData CreateFromCultureAndOptionsData => new TheoryData - { - { "abcd", "ABCD", "en-US", CompareOptions.None, false}, - { "latin i", "LATIN I", "en-US", CompareOptions.None, false}, - { "turky \u0131", "TURKY I", "tr-TR", CompareOptions.None, false}, - { "turky i", "TURKY \u0130", "tr-TR", CompareOptions.None, false}, - { "abcd", "ABCD", "en-US", CompareOptions.IgnoreCase, true}, - { "latin i", "LATIN I", "en-US", CompareOptions.IgnoreCase, true}, - { "turky \u0131", "TURKY I", "tr-TR", CompareOptions.IgnoreCase, true}, - { "turky i", "TURKY \u0130", "tr-TR", CompareOptions.IgnoreCase, true}, - { "abcd", "ab cd", "en-US", CompareOptions.IgnoreSymbols, true }, - { "abcd", "ab+cd", "en-US", CompareOptions.IgnoreSymbols, true }, - { "abcd", "ab%cd", "en-US", CompareOptions.IgnoreSymbols, true }, - { "abcd", "ab&cd", "en-US", CompareOptions.IgnoreSymbols, true }, - { "abcd", "ab$cd", "en-US", CompareOptions.IgnoreSymbols, true }, - { "abcd", "ab$cd", "en-US", CompareOptions.IgnoreSymbols, true }, - { "a-bcd", "ab$cd", "en-US", CompareOptions.IgnoreSymbols, true }, - { "abcd*", "ab$cd", "en-US", CompareOptions.IgnoreSymbols, true }, - { "ab$dd", "ab$cd", "en-US", CompareOptions.IgnoreSymbols, false }, - { "abcd", "ab$cd", "en-US", CompareOptions.IgnoreSymbols, true }, - }; + public static TheoryData CreateFromCultureAndOptionsData => + new TheoryData + { + { "abcd", "ABCD", "en-US", CompareOptions.None, false}, + { "latin i", "LATIN I", "en-US", CompareOptions.None, false}, + { "turky \u0131", "TURKY I", "tr-TR", CompareOptions.None, false}, + { "turky i", "TURKY \u0130", "tr-TR", CompareOptions.None, false}, + { "abcd", "ABCD", "en-US", CompareOptions.IgnoreCase, true}, + { "latin i", "LATIN I", "en-US", CompareOptions.IgnoreCase, true}, + { "turky \u0131", "TURKY I", "tr-TR", CompareOptions.IgnoreCase, true}, + { "turky i", "TURKY \u0130", "tr-TR", CompareOptions.IgnoreCase, true}, + { "abcd", "ab cd", "en-US", CompareOptions.IgnoreSymbols, true }, + { "abcd", "ab+cd", "en-US", CompareOptions.IgnoreSymbols, true }, + { "abcd", "ab%cd", "en-US", CompareOptions.IgnoreSymbols, true }, + { "abcd", "ab&cd", "en-US", CompareOptions.IgnoreSymbols, true }, + { "abcd", "ab$cd", "en-US", CompareOptions.IgnoreSymbols, true }, + { "abcd", "ab$cd", "en-US", CompareOptions.IgnoreSymbols, true }, + { "a-bcd", "ab$cd", "en-US", CompareOptions.IgnoreSymbols, true }, + { "abcd*", "ab$cd", "en-US", CompareOptions.IgnoreSymbols, true }, + { "ab$dd", "ab$cd", "en-US", CompareOptions.IgnoreSymbols, false }, + { "abcd", "ab$cd", "en-US", CompareOptions.IgnoreSymbols, true }, + }; public static TheoryData CreateFromCultureAndOptionsStringSortData => new TheoryData { @@ -187,7 +192,7 @@ public static void FromComparisonInvalidTest() { "abcd", "ABcd", "en-US", CompareOptions.StringSort, false }, }; - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(CreateFromCultureAndOptionsData))] [MemberData(nameof(CreateFromCultureAndOptionsStringSortData))] public static void CreateFromCultureAndOptions(string actualString, string expectedString, string cultureName, CompareOptions options, bool result) @@ -199,7 +204,7 @@ public static void CreateFromCultureAndOptions(string actualString, string expec Assert.Equal(result, sc.Equals((object)actualString, (object)expectedString)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(CreateFromCultureAndOptionsData))] public static void CreateFromCultureAndOptionsStringSort(string actualString, string expectedString, string cultureName, CompareOptions options, bool result) { diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.Tests.csproj b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.Tests.csproj index 959eefad70b6..0bb06264f93e 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.Tests.csproj @@ -13,5 +13,7 @@ + + \ No newline at end of file diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System/Runtime/InteropServices/JavaScript/HelperMarshal.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System/Runtime/InteropServices/JavaScript/HelperMarshal.cs new file mode 100644 index 000000000000..15771c307fa1 --- /dev/null +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System/Runtime/InteropServices/JavaScript/HelperMarshal.cs @@ -0,0 +1,336 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices.JavaScript; +using System.Collections.Generic; +using System.Linq; +using Xunit; + +namespace System.Runtime.InteropServices.JavaScript.Tests +{ + public static class HelperMarshal + { + internal const string INTEROP_CLASS = "[System.Runtime.InteropServices.JavaScript.Tests]System.Runtime.InteropServices.JavaScript.Tests.HelperMarshal:"; + internal static int _i32Value; + private static void InvokeI32(int a, int b) + { + _i32Value = a + b; + } + + internal static float _f32Value; + private static void InvokeFloat(float f) + { + _f32Value = f; + } + + internal static double _f64Value; + private static void InvokeDouble(double d) + { + _f64Value = d; + } + + internal static long _i64Value; + private static void InvokeLong(long l) + { + _i64Value = l; + } + + internal static byte[] _byteBuffer; + private static void MarshalArrayBuffer(ArrayBuffer buffer) + { + using (var bytes = new Uint8Array(buffer)) + _byteBuffer = bytes.ToArray(); + } + + private static void MarshalByteBuffer(Uint8Array buffer) + { + _byteBuffer = buffer.ToArray(); + } + + internal static int[] _intBuffer; + private static void MarshalArrayBufferToInt32Array(ArrayBuffer buffer) + { + using (var ints = new Int32Array(buffer)) + _intBuffer = ints.ToArray(); + } + + internal static string _stringResource; + private static void InvokeString(string s) + { + _stringResource = s; + } + + internal static string _marshalledString; + private static string InvokeMarshalString() + { + _marshalledString = "Hic Sunt Dracones"; + return _marshalledString; + } + + internal static object _object1; + private static object InvokeObj1(object obj) + { + _object1 = obj; + return obj; + } + + internal static object _object2; + private static object InvokeObj2(object obj) + { + _object2 = obj; + return obj; + } + + internal static object _marshalledObject; + private static object InvokeMarshalObj() + { + _marshalledObject = new object(); + return _marshalledObject; + } + + internal static int _valOne, _valTwo; + private static void ManipulateObject(JSObject obj) + { + _valOne = (int)obj.Invoke("inc"); + _valTwo = (int)obj.Invoke("add", 20); + } + + internal static object[] _jsObjects; + private static void MinipulateObjTypes(JSObject obj) + { + _jsObjects = new object[4]; + _jsObjects[0] = obj.Invoke("return_int"); + _jsObjects[1] = obj.Invoke("return_double"); + _jsObjects[2] = obj.Invoke("return_string"); + _jsObjects[3] = obj.Invoke("return_bool"); + } + + internal static int _jsAddFunctionResult; + private static void UseFunction(JSObject obj) + { + _jsAddFunctionResult = (int)obj.Invoke("call", null, 10, 20); + } + + internal static int _jsAddAsFunctionResult; + private static void UseAsFunction(Function func) + { + _jsAddAsFunctionResult = (int)func.Call(null, 20, 30); + } + + internal static int _functionResultValue; + private static Func CreateFunctionDelegate() + { + return (a, b) => + { + _functionResultValue = a + b; + return _functionResultValue; + }; + } + + internal static int _intValue; + private static void InvokeInt(int value) + { + _intValue = value; + } + + internal static IntPtr _intPtrValue; + private static void InvokeIntPtr(IntPtr i) + { + _intPtrValue = i; + } + + internal static IntPtr _marshaledIntPtrValue; + private static IntPtr InvokeMarshalIntPtr() + { + _marshaledIntPtrValue = (IntPtr)42; + return _marshaledIntPtrValue; + } + + internal static object[] _jsProperties; + private static void RetrieveObjectProperties(JSObject obj) + { + _jsProperties = new object[4]; + _jsProperties[0] = obj.GetObjectProperty("myInt"); + _jsProperties[1] = obj.GetObjectProperty("myDouble"); + _jsProperties[2] = obj.GetObjectProperty("myString"); + _jsProperties[3] = obj.GetObjectProperty("myBoolean"); + } + + private static void PopulateObjectProperties(JSObject obj, bool createIfNotExist) + { + _jsProperties = new object[4]; + obj.SetObjectProperty("myInt", 100, createIfNotExist); + obj.SetObjectProperty("myDouble", 4.5, createIfNotExist); + obj.SetObjectProperty("myString", "qwerty", createIfNotExist); + obj.SetObjectProperty("myBoolean", true, createIfNotExist); + } + + private static void MarshalByteBufferToInts(ArrayBuffer buffer) + { + using (var bytes = new Uint8Array(buffer)) + { + var byteBuffer = bytes.ToArray(); + _intBuffer = new int[bytes.Length / sizeof(int)]; + for (int i = 0; i < bytes.Length; i += sizeof(int)) + _intBuffer[i / sizeof(int)] = BitConverter.ToInt32(byteBuffer, i); + } + } + + private static void MarshalInt32Array(Int32Array buffer) + { + _intBuffer = buffer.ToArray(); + } + + internal static float[] _floatBuffer; + private static void MarshalFloat32Array(Float32Array buffer) + { + _floatBuffer = buffer.ToArray(); + } + private static void MarshalArrayBufferToFloat32Array(ArrayBuffer buffer) + { + using (var floats = new Float32Array(buffer)) + _floatBuffer = floats.ToArray(); + } + + internal static double[] _doubleBuffer; + private static void MarshalFloat64Array(Float64Array buffer) + { + _doubleBuffer = buffer.ToArray(); + } + + private static void MarshalArrayBufferToFloat64Array(ArrayBuffer buffer) + { + using (var doubles = new Float64Array(buffer)) + _doubleBuffer = doubles.ToArray(); + } + + private static void MarshalByteBufferToDoubles(ArrayBuffer buffer) + { + using (var doubles = new Float64Array(buffer)) + _doubleBuffer = doubles.ToArray(); + } + + private static void SetTypedArraySByte(JSObject obj) + { + sbyte[] buffer = Enumerable.Repeat((sbyte)0x20, 11).ToArray(); + obj.SetObjectProperty("typedArray", Int8Array.From(buffer)); + } + + internal static sbyte[] _taSByte; + private static void GetTypedArraySByte(JSObject obj) + { + _taSByte = ((Int8Array)obj.GetObjectProperty("typedArray")).ToArray(); + } + + private static void SetTypedArrayByte(JSObject obj) + { + var dragons = "hic sunt dracones"; + byte[] buffer = System.Text.Encoding.ASCII.GetBytes(dragons); + obj.SetObjectProperty("dracones", Uint8Array.From(buffer)); + } + + internal static byte[] _taByte; + private static void GetTypedArrayByte(JSObject obj) + { + _taByte = ((Uint8Array)obj.GetObjectProperty("dracones")).ToArray(); + } + + private static void SetTypedArrayShort(JSObject obj) + { + short[] buffer = Enumerable.Repeat((short)0x20, 13).ToArray(); + obj.SetObjectProperty("typedArray", Int16Array.From(buffer)); + } + + internal static short[] _taShort; + private static void GetTypedArrayShort(JSObject obj) + { + _taShort = ((Int16Array)obj.GetObjectProperty("typedArray")).ToArray(); + } + + private static void SetTypedArrayUShort(JSObject obj) + { + ushort[] buffer = Enumerable.Repeat((ushort)0x20, 14).ToArray(); + obj.SetObjectProperty("typedArray", Uint16Array.From(buffer)); + } + + internal static ushort[] _taUShort; + private static void GetTypedArrayUShort(JSObject obj) + { + _taUShort = ((Uint16Array)obj.GetObjectProperty("typedArray")).ToArray(); + } + + private static void SetTypedArrayInt(JSObject obj) + { + int[] buffer = Enumerable.Repeat((int)0x20, 15).ToArray(); + obj.SetObjectProperty("typedArray", Int32Array.From(buffer)); + } + + internal static int[] _taInt; + private static void GetTypedArrayInt(JSObject obj) + { + _taInt = ((Int32Array)obj.GetObjectProperty("typedArray")).ToArray(); + } + + public static void SetTypedArrayUInt(JSObject obj) + { + uint[] buffer = Enumerable.Repeat((uint)0x20, 16).ToArray(); + obj.SetObjectProperty("typedArray", Uint32Array.From(buffer)); + } + + internal static uint[] _taUInt; + private static void GetTypedArrayUInt(JSObject obj) + { + _taUInt = ((Uint32Array)obj.GetObjectProperty("typedArray")).ToArray(); + } + + private static void SetTypedArrayFloat(JSObject obj) + { + float[] buffer = Enumerable.Repeat(3.14f, 17).ToArray(); + obj.SetObjectProperty("typedArray", Float32Array.From(buffer)); + } + + internal static float[] _taFloat; + private static void GetTypedArrayFloat(JSObject obj) + { + _taFloat = ((Float32Array)obj.GetObjectProperty("typedArray")).ToArray(); + } + + private static void SetTypedArrayDouble(JSObject obj) + { + double[] buffer = Enumerable.Repeat(3.14d, 18).ToArray(); + obj.SetObjectProperty("typedArray", Float64Array.From(buffer)); + } + + internal static double[] _taDouble; + private static void GetTypedArrayDouble(JSObject obj) + { + _taDouble = ((Float64Array)obj.GetObjectProperty("typedArray")).ToArray(); + } + + private static Function _sumFunction; + private static void CreateFunctionSum() + { + _sumFunction = new Function("a", "b", "return a + b"); + } + + internal static int _sumValue = 0; + private static void CallFunctionSum() + { + _sumValue = (int)_sumFunction.Call(null, 3, 5); + } + + private static Function _mathMinFunction; + private static void CreateFunctionApply() + { + var math = (JSObject)Runtime.GetGlobalObject("Math"); + _mathMinFunction = (Function)math.GetObjectProperty("min"); + + } + + internal static int _minValue = 0; + private static void CallFunctionApply() + { + _minValue = (int)_mathMinFunction.Apply(null, new object[] { 5, 6, 2, 3, 7 }); + } + } +} diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System/Runtime/InteropServices/JavaScript/MarshalTests.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System/Runtime/InteropServices/JavaScript/MarshalTests.cs new file mode 100644 index 000000000000..68f16e673f19 --- /dev/null +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System/Runtime/InteropServices/JavaScript/MarshalTests.cs @@ -0,0 +1,569 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices.JavaScript; +using System.Collections.Generic; +using Xunit; + +namespace System.Runtime.InteropServices.JavaScript.Tests +{ + public static class MarshalTests + { + [Fact] + public static void MarshalPrimitivesToCS() + { + HelperMarshal._i32Value = 0; + Runtime.InvokeJS("App.call_test_method (\"InvokeI32\", [10, 20])"); + Assert.Equal(30, HelperMarshal._i32Value); + + HelperMarshal._f32Value = 0; + Runtime.InvokeJS("App.call_test_method (\"InvokeFloat\", [1.5])"); + Assert.Equal(1.5f, HelperMarshal._f32Value); + + HelperMarshal._f64Value = 0; + Runtime.InvokeJS("App.call_test_method (\"InvokeDouble\", [4.5])"); + Assert.Equal(4.5, HelperMarshal._f64Value); + + HelperMarshal._i64Value = 0; + Runtime.InvokeJS("App.call_test_method (\"InvokeLong\", [99])"); + Assert.Equal(99, HelperMarshal._i64Value); + } + + [Fact] + public static void MarshalArrayBuffer() + { + Runtime.InvokeJS(@" + var buffer = new ArrayBuffer(16); + App.call_test_method (""MarshalArrayBuffer"", [ buffer ]); + "); + Assert.Equal(16, HelperMarshal._byteBuffer.Length); + } + + [Fact] + public static void MarshalArrayBuffer2Int() + { + Runtime.InvokeJS(@" + var buffer = new ArrayBuffer(16); + var int32View = new Int32Array(buffer); + for (var i = 0; i < int32View.length; i++) { + int32View[i] = i * 2; + } + App.call_test_method (""MarshalArrayBufferToInt32Array"", [ buffer ]); + "); + + Assert.Equal(4, HelperMarshal._intBuffer.Length); + Assert.Equal(0, HelperMarshal._intBuffer[0]); + Assert.Equal(2, HelperMarshal._intBuffer[1]); + Assert.Equal(4, HelperMarshal._intBuffer[2]); + Assert.Equal(6, HelperMarshal._intBuffer[3]); + } + + [Fact] + public static void MarshalArrayBuffer2Int2() + { + Runtime.InvokeJS(@" + var buffer = new ArrayBuffer(16); + var int32View = new Int32Array(buffer); + for (var i = 0; i < int32View.length; i++) { + int32View[i] = i * 2; + } + App.call_test_method (""MarshalByteBufferToInts"", [ buffer ]); + "); + + Assert.Equal(4, HelperMarshal._intBuffer.Length); + Assert.Equal(0, HelperMarshal._intBuffer[0]); + Assert.Equal(2, HelperMarshal._intBuffer[1]); + Assert.Equal(4, HelperMarshal._intBuffer[2]); + Assert.Equal(6, HelperMarshal._intBuffer[3]); + } + + [Fact] + public static void MarshalStringToCS() + { + HelperMarshal._stringResource = null; + Runtime.InvokeJS("App.call_test_method(\"InvokeString\", [\"hello\"])"); + Assert.Equal("hello", HelperMarshal._stringResource); + } + + [Fact] + public static void MarshalStringToJS() + { + HelperMarshal._marshalledString = HelperMarshal._stringResource = null; + Runtime.InvokeJS(@" + var str = App.call_test_method (""InvokeMarshalString""); + App.call_test_method (""InvokeString"", [ str ]); + "); + Assert.NotNull(HelperMarshal._marshalledString); + Assert.Equal(HelperMarshal._marshalledString, HelperMarshal._stringResource); + } + + [Fact] + public static void JSObjectKeepIdentityAcrossCalls() + { + HelperMarshal._object1 = HelperMarshal._object2 = null; + Runtime.InvokeJS(@" + var obj = { foo: 10 }; + var res = App.call_test_method (""InvokeObj1"", [ obj ]); + App.call_test_method (""InvokeObj2"", [ res ]); + "); + + Assert.NotNull(HelperMarshal._object1); + Assert.Same(HelperMarshal._object1, HelperMarshal._object2); + } + + [Fact] + public static void CSObjectKeepIdentityAcrossCalls() + { + HelperMarshal._marshalledObject = HelperMarshal._object1 = HelperMarshal._object2 = null; + Runtime.InvokeJS(@" + var obj = App.call_test_method (""InvokeMarshalObj""); + var res = App.call_test_method (""InvokeObj1"", [ obj ]); + App.call_test_method (""InvokeObj2"", [ res ]); + "); + + Assert.NotNull(HelperMarshal._object1); + Assert.Same(HelperMarshal._marshalledObject, HelperMarshal._object1); + Assert.Same(HelperMarshal._object1, HelperMarshal._object2); + } + + [Fact] + public static void JSInvokeInt() + { + Runtime.InvokeJS(@" + var obj = { + foo: 10, + inc: function() { + var c = this.foo; + ++this.foo; + return c; + }, + add: function(val){ + return this.foo + val; + } + }; + App.call_test_method (""ManipulateObject"", [ obj ]); + "); + Assert.Equal(10, HelperMarshal._valOne); + Assert.Equal(31, HelperMarshal._valTwo); + } + + [Fact] + public static void JSInvokeTypes() + { + Runtime.InvokeJS(@" + var obj = { + return_int: function() { return 100; }, + return_double: function() { return 4.5; }, + return_string: function() { return 'Hic Sunt Dracones'; }, + return_bool: function() { return true; }, + }; + App.call_test_method (""MinipulateObjTypes"", [ obj ]); + "); + + Assert.Equal(100, HelperMarshal._jsObjects[0]); + Assert.Equal(4.5, HelperMarshal._jsObjects[1]); + Assert.Equal("Hic Sunt Dracones", HelperMarshal._jsObjects[2]); + Assert.NotEqual("HIC SVNT LEONES", HelperMarshal._jsObjects[2]); + Assert.Equal(true, HelperMarshal._jsObjects[3]); + } + + [Fact] + public static void JSObjectApply() + { + Runtime.InvokeJS(@" + var do_add = function(a, b) { return a + b }; + App.call_test_method (""UseFunction"", [ do_add ]); + "); + Assert.Equal(30, HelperMarshal._jsAddFunctionResult); + } + + [Fact] + public static void JSObjectAsFunction() + { + Runtime.InvokeJS(@" + var do_add = function(a, b) { return a + b }; + App.call_test_method (""UseAsFunction"", [ do_add ]); + "); + Assert.Equal(50, HelperMarshal._jsAddAsFunctionResult); + } + + [Fact] + public static void MarshalDelegate() + { + HelperMarshal._object1 = null; + Runtime.InvokeJS(@" + var funcDelegate = App.call_test_method (""CreateFunctionDelegate"", [ ]); + var res = funcDelegate (10, 20); + App.call_test_method (""InvokeI32"", [ res, res ]); + "); + + Assert.Equal(30, HelperMarshal._functionResultValue); + Assert.Equal(60, HelperMarshal._i32Value); + } + [Fact] + public static void BindStaticMethod() + { + HelperMarshal._intValue = 0; + Runtime.InvokeJS(@$" + var invoke_int = Module.mono_bind_static_method (""{HelperMarshal.INTEROP_CLASS}InvokeInt""); + invoke_int (200); + "); + + Assert.Equal(200, HelperMarshal._intValue); + } + + [Fact] + public static void BindIntPtrStaticMethod() + { + HelperMarshal._intPtrValue = IntPtr.Zero; + Runtime.InvokeJS(@$" + var invoke_int_ptr = Module.mono_bind_static_method (""{HelperMarshal.INTEROP_CLASS}InvokeIntPtr""); + invoke_int_ptr (42); + "); + Assert.Equal(42, (int)HelperMarshal._intPtrValue); + } + + [Fact] + public static void MarshalIntPtrToJS() + { + HelperMarshal._marshaledIntPtrValue = IntPtr.Zero; + Runtime.InvokeJS(@$" + var invokeMarshalIntPtr = Module.mono_bind_static_method (""{HelperMarshal.INTEROP_CLASS}InvokeMarshalIntPtr""); + var r = invokeMarshalIntPtr (); + + if (r != 42) throw `Invalid int_ptr value`; + "); + Assert.Equal(42, (int)HelperMarshal._marshaledIntPtrValue); + } + + [Fact] + public static void InvokeStaticMethod() + { + HelperMarshal._intValue = 0; + Runtime.InvokeJS(@$" + Module.mono_call_static_method (""{HelperMarshal.INTEROP_CLASS}InvokeInt"", [ 300 ]); + "); + + Assert.Equal(300, HelperMarshal._intValue); + } + + [Fact] + public static void ResolveMethod() + { + HelperMarshal._intValue = 0; + Runtime.InvokeJS(@$" + var invoke_int = Module.mono_method_resolve (""{HelperMarshal.INTEROP_CLASS}InvokeInt""); + App.call_test_method (""InvokeInt"", [ invoke_int ]); + "); + + Assert.NotEqual(0, HelperMarshal._intValue); + } + + [Fact] + public static void GetObjectProperties() + { + Runtime.InvokeJS(@" + var obj = {myInt: 100, myDouble: 4.5, myString: ""Hic Sunt Dracones"", myBoolean: true}; + App.call_test_method (""RetrieveObjectProperties"", [ obj ]); + "); + + Assert.Equal(100, HelperMarshal._jsProperties[0]); + Assert.Equal(4.5, HelperMarshal._jsProperties[1]); + Assert.Equal("Hic Sunt Dracones", HelperMarshal._jsProperties[2]); + Assert.Equal(true, HelperMarshal._jsProperties[3]); + } + + [Fact] + public static void SetObjectProperties() + { + Runtime.InvokeJS(@" + var obj = {myInt: 200, myDouble: 0, myString: ""foo"", myBoolean: false}; + App.call_test_method (""PopulateObjectProperties"", [ obj, false ]); + App.call_test_method (""RetrieveObjectProperties"", [ obj ]); + "); + + Assert.Equal(100, HelperMarshal._jsProperties[0]); + Assert.Equal(4.5, HelperMarshal._jsProperties[1]); + Assert.Equal("qwerty", HelperMarshal._jsProperties[2]); + Assert.Equal(true, HelperMarshal._jsProperties[3]); + } + + [Fact] + public static void SetObjectPropertiesIfNotExistsFalse() + { + // This test will not create the properties if they do not already exist + Runtime.InvokeJS(@" + var obj = {myInt: 200}; + App.call_test_method (""PopulateObjectProperties"", [ obj, false ]); + App.call_test_method (""RetrieveObjectProperties"", [ obj ]); + "); + + Assert.Equal(100, HelperMarshal._jsProperties[0]); + Assert.Null(HelperMarshal._jsProperties[1]); + Assert.Null(HelperMarshal._jsProperties[2]); + Assert.Null(HelperMarshal._jsProperties[3]); + } + + [Fact] + public static void SetObjectPropertiesIfNotExistsTrue() + { + // This test will set the value of the property if it exists and will create and + // set the value if it does not exists + Runtime.InvokeJS(@" + var obj = {myInt: 200}; + App.call_test_method (""PopulateObjectProperties"", [ obj, true ]); + App.call_test_method (""RetrieveObjectProperties"", [ obj ]); + "); + + Assert.Equal(100, HelperMarshal._jsProperties[0]); + Assert.Equal(4.5, HelperMarshal._jsProperties[1]); + Assert.Equal("qwerty", HelperMarshal._jsProperties[2]); + Assert.Equal(true, HelperMarshal._jsProperties[3]); + } + + [Fact] + public static void MarshalTypedArray() + { + Runtime.InvokeJS(@" + var buffer = new ArrayBuffer(16); + var uint8View = new Uint8Array(buffer); + App.call_test_method (""MarshalByteBuffer"", [ uint8View ]); + "); + + Assert.Equal(16, HelperMarshal._byteBuffer.Length); + } + + [Fact] + public static void MarshalTypedArray2Int() + { + Runtime.InvokeJS(@" + var buffer = new ArrayBuffer(16); + var int32View = new Int32Array(buffer); + for (var i = 0; i < int32View.length; i++) { + int32View[i] = i * 2; + } + App.call_test_method (""MarshalInt32Array"", [ int32View ]); + "); + + Assert.Equal(4, HelperMarshal._intBuffer.Length); + Assert.Equal(0, HelperMarshal._intBuffer[0]); + Assert.Equal(2, HelperMarshal._intBuffer[1]); + Assert.Equal(4, HelperMarshal._intBuffer[2]); + Assert.Equal(6, HelperMarshal._intBuffer[3]); + } + + [Fact] + public static void MarshalTypedArray2Float() + { + Runtime.InvokeJS(@" + var typedArray = new Float32Array([1, 2.1334, 3, 4.2, 5]); + App.call_test_method (""MarshalFloat32Array"", [ typedArray ]); + "); + + Assert.Equal(1, HelperMarshal._floatBuffer[0]); + Assert.Equal(2.1334f, HelperMarshal._floatBuffer[1]); + Assert.Equal(3, HelperMarshal._floatBuffer[2]); + Assert.Equal(4.2f, HelperMarshal._floatBuffer[3]); + Assert.Equal(5, HelperMarshal._floatBuffer[4]); + } + + [Fact] + public static void MarshalArrayBuffer2Float2() + { + Runtime.InvokeJS(@" + var buffer = new ArrayBuffer(16); + var float32View = new Float32Array(buffer); + for (var i = 0; i < float32View.length; i++) { + float32View[i] = i * 2.5; + } + App.call_test_method (""MarshalArrayBufferToFloat32Array"", [ buffer ]); + "); + + Assert.Equal(4, HelperMarshal._floatBuffer.Length); + Assert.Equal(0, HelperMarshal._floatBuffer[0]); + Assert.Equal(2.5f, HelperMarshal._floatBuffer[1]); + Assert.Equal(5, HelperMarshal._floatBuffer[2]); + Assert.Equal(7.5f, HelperMarshal._floatBuffer[3]); + } + + [Fact] + public static void MarshalTypedArray2Double() + { + Runtime.InvokeJS(@" + var typedArray = new Float64Array([1, 2.1334, 3, 4.2, 5]); + App.call_test_method (""MarshalFloat64Array"", [ typedArray ]); + "); + + Assert.Equal(1, HelperMarshal._doubleBuffer[0]); + Assert.Equal(2.1334d, HelperMarshal._doubleBuffer[1]); + Assert.Equal(3, HelperMarshal._doubleBuffer[2]); + Assert.Equal(4.2d, HelperMarshal._doubleBuffer[3]); + Assert.Equal(5, HelperMarshal._doubleBuffer[4]); + } + + [Fact] + public static void MarshalArrayBuffer2Double() + { + Runtime.InvokeJS(@" + var buffer = new ArrayBuffer(32); + var float64View = new Float64Array(buffer); + for (var i = 0; i < float64View.length; i++) { + float64View[i] = i * 2.5; + } + App.call_test_method (""MarshalByteBufferToDoubles"", [ buffer ]); + "); + + Assert.Equal(4, HelperMarshal._doubleBuffer.Length); + Assert.Equal(0, HelperMarshal._doubleBuffer[0]); + Assert.Equal(2.5d, HelperMarshal._doubleBuffer[1]); + Assert.Equal(5, HelperMarshal._doubleBuffer[2]); + Assert.Equal(7.5d, HelperMarshal._doubleBuffer[3]); + } + + [Fact] + public static void MarshalArrayBuffer2Double2() + { + Runtime.InvokeJS(@" + var buffer = new ArrayBuffer(32); + var float64View = new Float64Array(buffer); + for (var i = 0; i < float64View.length; i++) { + float64View[i] = i * 2.5; + } + App.call_test_method (""MarshalArrayBufferToFloat64Array"", [ buffer ]); + "); + + Assert.Equal(4, HelperMarshal._doubleBuffer.Length); + Assert.Equal(0, HelperMarshal._doubleBuffer[0]); + Assert.Equal(2.5f, HelperMarshal._doubleBuffer[1]); + Assert.Equal(5, HelperMarshal._doubleBuffer[2]); + Assert.Equal(7.5f, HelperMarshal._doubleBuffer[3]); + } + + [Fact] + public static void MarshalTypedArraySByte() + { + Runtime.InvokeJS(@" + var obj = { }; + App.call_test_method (""SetTypedArraySByte"", [ obj ]); + App.call_test_method (""GetTypedArraySByte"", [ obj ]); + "); + Assert.Equal(11, HelperMarshal._taSByte.Length); + Assert.Equal(32, HelperMarshal._taSByte[0]); + Assert.Equal(32, HelperMarshal._taSByte[HelperMarshal._taSByte.Length - 1]); + } + + [Fact] + public static void MarshalTypedArrayByte() + { + Runtime.InvokeJS(@" + var obj = { }; + App.call_test_method (""SetTypedArrayByte"", [ obj ]); + App.call_test_method (""GetTypedArrayByte"", [ obj ]); + "); + Assert.Equal(11, HelperMarshal._taSByte.Length); + Assert.Equal(104, HelperMarshal._taByte[0]); + Assert.Equal(115, HelperMarshal._taByte[HelperMarshal._taByte.Length - 1]); + Assert.Equal("hic sunt dracones", System.Text.Encoding.Default.GetString(HelperMarshal._taByte)); + } + + [Fact] + public static void MarshalTypedArrayShort() + { + Runtime.InvokeJS(@" + var obj = { }; + App.call_test_method (""SetTypedArrayShort"", [ obj ]); + App.call_test_method (""GetTypedArrayShort"", [ obj ]); + "); + Assert.Equal(13, HelperMarshal._taShort.Length); + Assert.Equal(32, HelperMarshal._taShort[0]); + Assert.Equal(32, HelperMarshal._taShort[HelperMarshal._taShort.Length - 1]); + } + + [Fact] + public static void MarshalTypedArrayUShort() + { + Runtime.InvokeJS(@" + var obj = { }; + App.call_test_method (""SetTypedArrayUShort"", [ obj ]); + App.call_test_method (""GetTypedArrayUShort"", [ obj ]); + "); + Assert.Equal(14, HelperMarshal._taUShort.Length); + Assert.Equal(32, HelperMarshal._taUShort[0]); + Assert.Equal(32, HelperMarshal._taUShort[HelperMarshal._taUShort.Length - 1]); + } + + [Fact] + public static void MarshalTypedArrayInt() + { + Runtime.InvokeJS(@" + var obj = { }; + App.call_test_method (""SetTypedArrayInt"", ""o"", [ obj ]); + App.call_test_method (""GetTypedArrayInt"", ""o"", [ obj ]); + "); + Assert.Equal(15, HelperMarshal._taInt.Length); + Assert.Equal(32, HelperMarshal._taInt[0]); + Assert.Equal(32, HelperMarshal._taInt[HelperMarshal._taInt.Length - 1]); + } + + [Fact] + public static void MarshalTypedArrayUInt() + { + Runtime.InvokeJS(@" + var obj = { }; + App.call_test_method (""SetTypedArrayUInt"", [ obj ]); + App.call_test_method (""GetTypedArrayUInt"", [ obj ]); + "); + Assert.Equal(16, HelperMarshal._taUInt.Length); + Assert.Equal(32, (int)HelperMarshal._taUInt[0]); + Assert.Equal(32, (int)HelperMarshal._taUInt[HelperMarshal._taUInt.Length - 1]); + } + + [Fact] + public static void MarshalTypedArrayFloat() + { + Runtime.InvokeJS(@" + var obj = { }; + App.call_test_method (""SetTypedArrayFloat"", [ obj ]); + App.call_test_method (""GetTypedArrayFloat"", [ obj ]); + "); + Assert.Equal(17, HelperMarshal._taFloat.Length); + Assert.Equal(3.14f, HelperMarshal._taFloat[0]); + Assert.Equal(3.14f, HelperMarshal._taFloat[HelperMarshal._taFloat.Length - 1]); + } + + [Fact] + public static void MarshalTypedArrayDouble() + { + Runtime.InvokeJS(@" + var obj = { }; + App.call_test_method (""SetTypedArrayDouble"", ""o"", [ obj ]); + App.call_test_method (""GetTypedArrayDouble"", ""o"", [ obj ]); + "); + Assert.Equal(18, HelperMarshal._taDouble.Length); + Assert.Equal(3.14d, HelperMarshal._taDouble[0]); + Assert.Equal(3.14d, HelperMarshal._taDouble[HelperMarshal._taDouble.Length - 1]); + } + + [Fact] + public static void TestFunctionSum() + { + HelperMarshal._sumValue = 0; + Runtime.InvokeJS(@" + App.call_test_method (""CreateFunctionSum"", null, [ ]); + App.call_test_method (""CallFunctionSum"", null, [ ]); + "); + Assert.Equal(8, HelperMarshal._sumValue); + } + + [Fact] + public static void TestFunctionApply() + { + HelperMarshal._minValue = 0; + Runtime.InvokeJS(@" + App.call_test_method (""CreateFunctionApply"", null, [ ]); + App.call_test_method (""CallFunctionApply"", null, [ ]); + "); + Assert.Equal(2, HelperMarshal._minValue); + } + } +} diff --git a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/ref/System.Runtime.InteropServices.RuntimeInformation.cs b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/ref/System.Runtime.InteropServices.RuntimeInformation.cs index e9c675b61f2e..46d2dd5159e2 100644 --- a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/ref/System.Runtime.InteropServices.RuntimeInformation.cs +++ b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/ref/System.Runtime.InteropServices.RuntimeInformation.cs @@ -23,6 +23,8 @@ public enum Architecture public static System.Runtime.InteropServices.OSPlatform FreeBSD { get { throw null; } } public static System.Runtime.InteropServices.OSPlatform iOS { get { throw null; } } public static System.Runtime.InteropServices.OSPlatform Linux { get { throw null; } } + public static System.Runtime.InteropServices.OSPlatform macOS { get { throw null; } } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] public static System.Runtime.InteropServices.OSPlatform OSX { get { throw null; } } public static System.Runtime.InteropServices.OSPlatform tvOS { get { throw null; } } public static System.Runtime.InteropServices.OSPlatform watchOS { get { throw null; } } diff --git a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/OSPlatform.cs b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/OSPlatform.cs index 39f956e164bd..18e45643d216 100644 --- a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/OSPlatform.cs +++ b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/OSPlatform.cs @@ -15,6 +15,9 @@ namespace System.Runtime.InteropServices public static OSPlatform Linux { get; } = new OSPlatform("LINUX"); + public static OSPlatform macOS { get; } = new OSPlatform("MACOS"); + + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] // superseded by macOS public static OSPlatform OSX { get; } = new OSPlatform("OSX"); public static OSPlatform iOS { get; } = new OSPlatform("IOS"); @@ -25,14 +28,21 @@ namespace System.Runtime.InteropServices public static OSPlatform Windows { get; } = new OSPlatform("WINDOWS"); + internal bool IsCurrent { get; } // this information is cached because it's frequently used + private OSPlatform(string osPlatform) { if (osPlatform == null) throw new ArgumentNullException(nameof(osPlatform)); if (osPlatform.Length == 0) throw new ArgumentException(SR.Argument_EmptyValue, nameof(osPlatform)); _osPlatform = osPlatform; + IsCurrent = RuntimeInformation.IsCurrentOSPlatform(osPlatform); } + /// + /// Creates a new OSPlatform instance. + /// + /// If you plan to call this method frequently, please consider caching its result. public static OSPlatform Create(string osPlatform) { return new OSPlatform(osPlatform); @@ -45,17 +55,17 @@ public bool Equals(OSPlatform other) internal bool Equals(string? other) { - return string.Equals(_osPlatform, other, StringComparison.Ordinal); + return string.Equals(_osPlatform, other, StringComparison.OrdinalIgnoreCase); } public override bool Equals(object? obj) { - return obj is OSPlatform && Equals((OSPlatform)obj); + return obj is OSPlatform osPlatform && Equals(osPlatform); } public override int GetHashCode() { - return _osPlatform == null ? 0 : _osPlatform.GetHashCode(); + return _osPlatform == null ? 0 : _osPlatform.GetHashCode(StringComparison.OrdinalIgnoreCase); } public override string ToString() diff --git a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Browser.cs b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Browser.cs index 769d4ae38f30..838aa49c2e76 100644 --- a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Browser.cs +++ b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Browser.cs @@ -5,7 +5,7 @@ namespace System.Runtime.InteropServices { public static partial class RuntimeInformation { - public static bool IsOSPlatform(OSPlatform osPlatform) => osPlatform.Equals(OSPlatform.Browser); + internal static bool IsCurrentOSPlatform(string osPlatform) => osPlatform.Equals("BROWSER", StringComparison.OrdinalIgnoreCase); public static string OSDescription => "Browser"; diff --git a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Unix.cs b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Unix.cs index c930aac92540..01da110b0373 100644 --- a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Unix.cs +++ b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Unix.cs @@ -7,88 +7,37 @@ namespace System.Runtime.InteropServices { public static partial class RuntimeInformation { - private static readonly object s_osLock = new object(); - private static readonly object s_processLock = new object(); private static string? s_osPlatformName; private static string? s_osDescription; - private static Architecture? s_osArch; - private static Architecture? s_processArch; - public static bool IsOSPlatform(OSPlatform osPlatform) + internal static bool IsCurrentOSPlatform(string osPlatform) { string name = s_osPlatformName ??= Interop.Sys.GetUnixName(); - return osPlatform.Equals(name); + + return osPlatform.Equals(name, StringComparison.OrdinalIgnoreCase) + || (name == "OSX" && osPlatform.Equals("MACOS", StringComparison.OrdinalIgnoreCase)); // GetUnixName returns OSX on macOS } public static string OSDescription => s_osDescription ??= Interop.Sys.GetUnixVersion(); - public static Architecture OSArchitecture - { - get - { - lock (s_osLock) - { - if (null == s_osArch) - { - Interop.Sys.ProcessorArchitecture arch = (Interop.Sys.ProcessorArchitecture)Interop.Sys.GetOSArchitecture(); - switch (arch) - { - case Interop.Sys.ProcessorArchitecture.ARM: - s_osArch = Architecture.Arm; - break; - - case Interop.Sys.ProcessorArchitecture.x64: - s_osArch = Architecture.X64; - break; - - case Interop.Sys.ProcessorArchitecture.x86: - s_osArch = Architecture.X86; - break; - - case Interop.Sys.ProcessorArchitecture.ARM64: - s_osArch = Architecture.Arm64; - break; - } - } - } + public static Architecture OSArchitecture { get; } = Map((Interop.Sys.ProcessorArchitecture)Interop.Sys.GetOSArchitecture()); - Debug.Assert(s_osArch != null); - return s_osArch.Value; - } - } + public static Architecture ProcessArchitecture { get; } = Map((Interop.Sys.ProcessorArchitecture)Interop.Sys.GetProcessArchitecture()); - public static Architecture ProcessArchitecture + private static Architecture Map(Interop.Sys.ProcessorArchitecture arch) { - get + switch (arch) { - lock (s_processLock) - { - if (null == s_processArch) - { - Interop.Sys.ProcessorArchitecture arch = (Interop.Sys.ProcessorArchitecture)Interop.Sys.GetProcessArchitecture(); - switch (arch) - { - case Interop.Sys.ProcessorArchitecture.ARM: - s_processArch = Architecture.Arm; - break; - - case Interop.Sys.ProcessorArchitecture.x64: - s_processArch = Architecture.X64; - break; - - case Interop.Sys.ProcessorArchitecture.x86: - s_processArch = Architecture.X86; - break; - - case Interop.Sys.ProcessorArchitecture.ARM64: - s_processArch = Architecture.Arm64; - break; - } - } - } - - Debug.Assert(s_processArch != null); - return s_processArch.Value; + case Interop.Sys.ProcessorArchitecture.ARM: + return Architecture.Arm; + case Interop.Sys.ProcessorArchitecture.x64: + return Architecture.X64; + case Interop.Sys.ProcessorArchitecture.ARM64: + return Architecture.Arm64; + case Interop.Sys.ProcessorArchitecture.x86: + default: + Debug.Assert(arch == Interop.Sys.ProcessorArchitecture.x86, "Unidentified Architecture"); + return Architecture.X86; } } } diff --git a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Windows.cs b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Windows.cs index 0ccc9deb9300..668b84391b76 100644 --- a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Windows.cs +++ b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.Windows.cs @@ -8,15 +8,10 @@ namespace System.Runtime.InteropServices public static partial class RuntimeInformation { private static string? s_osDescription; - private static readonly object s_osLock = new object(); - private static readonly object s_processLock = new object(); - private static Architecture? s_osArch; - private static Architecture? s_processArch; + private static volatile int s_osArch = -1; + private static volatile int s_processArch = -1; - public static bool IsOSPlatform(OSPlatform osPlatform) - { - return OSPlatform.Windows == osPlatform; - } + internal static bool IsCurrentOSPlatform(string osPlatform) => osPlatform.Equals("WINDOWS", StringComparison.OrdinalIgnoreCase); public static string OSDescription { @@ -42,34 +37,17 @@ public static Architecture OSArchitecture { get { - lock (s_osLock) - { - if (null == s_osArch) - { - Interop.Kernel32.SYSTEM_INFO sysInfo; - Interop.Kernel32.GetNativeSystemInfo(out sysInfo); + Debug.Assert(sizeof(Architecture) == sizeof(int)); - switch ((Interop.Kernel32.ProcessorArchitecture)sysInfo.wProcessorArchitecture) - { - case Interop.Kernel32.ProcessorArchitecture.Processor_Architecture_ARM64: - s_osArch = Architecture.Arm64; - break; - case Interop.Kernel32.ProcessorArchitecture.Processor_Architecture_ARM: - s_osArch = Architecture.Arm; - break; - case Interop.Kernel32.ProcessorArchitecture.Processor_Architecture_AMD64: - s_osArch = Architecture.X64; - break; - case Interop.Kernel32.ProcessorArchitecture.Processor_Architecture_INTEL: - s_osArch = Architecture.X86; - break; - } + int osArch = s_osArch; - } + if (osArch == -1) + { + Interop.Kernel32.GetNativeSystemInfo(out Interop.Kernel32.SYSTEM_INFO sysInfo); + osArch = s_osArch = (int)Map((Interop.Kernel32.ProcessorArchitecture)sysInfo.wProcessorArchitecture); } - Debug.Assert(s_osArch != null); - return s_osArch.Value; + return (Architecture)osArch; } } @@ -77,33 +55,34 @@ public static Architecture ProcessArchitecture { get { - lock (s_processLock) - { - if (null == s_processArch) - { - Interop.Kernel32.SYSTEM_INFO sysInfo; - Interop.Kernel32.GetSystemInfo(out sysInfo); + Debug.Assert(sizeof(Architecture) == sizeof(int)); + + int processArch = s_processArch; - switch ((Interop.Kernel32.ProcessorArchitecture)sysInfo.wProcessorArchitecture) - { - case Interop.Kernel32.ProcessorArchitecture.Processor_Architecture_ARM64: - s_processArch = Architecture.Arm64; - break; - case Interop.Kernel32.ProcessorArchitecture.Processor_Architecture_ARM: - s_processArch = Architecture.Arm; - break; - case Interop.Kernel32.ProcessorArchitecture.Processor_Architecture_AMD64: - s_processArch = Architecture.X64; - break; - case Interop.Kernel32.ProcessorArchitecture.Processor_Architecture_INTEL: - s_processArch = Architecture.X86; - break; - } - } + if (processArch == -1) + { + Interop.Kernel32.GetSystemInfo(out Interop.Kernel32.SYSTEM_INFO sysInfo); + processArch = s_processArch = (int)Map((Interop.Kernel32.ProcessorArchitecture)sysInfo.wProcessorArchitecture); } - Debug.Assert(s_processArch != null); - return s_processArch.Value; + return (Architecture)processArch; + } + } + + private static Architecture Map(Interop.Kernel32.ProcessorArchitecture processorArchitecture) + { + switch (processorArchitecture) + { + case Interop.Kernel32.ProcessorArchitecture.Processor_Architecture_ARM64: + return Architecture.Arm64; + case Interop.Kernel32.ProcessorArchitecture.Processor_Architecture_ARM: + return Architecture.Arm; + case Interop.Kernel32.ProcessorArchitecture.Processor_Architecture_AMD64: + return Architecture.X64; + case Interop.Kernel32.ProcessorArchitecture.Processor_Architecture_INTEL: + default: + Debug.Assert(processorArchitecture == Interop.Kernel32.ProcessorArchitecture.Processor_Architecture_INTEL, "Unidentified Architecture"); + return Architecture.X86; } } } diff --git a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.cs b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.cs index 8e43d13ec463..95b1b62b4cdb 100644 --- a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.cs +++ b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.cs @@ -48,5 +48,10 @@ public static string FrameworkDescription /// public static string RuntimeIdentifier => s_runtimeIdentifier ??= AppContext.GetData("RUNTIME_IDENTIFIER") as string ?? "unknown"; + + /// + /// Indicates whether the current application is running on the specified platform. + /// + public static bool IsOSPlatform(OSPlatform osPlatform) => osPlatform.IsCurrent; } } diff --git a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/CheckPlatformTests.cs b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/CheckPlatformTests.cs index 1264c5c0d850..e40f9f8b310a 100644 --- a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/CheckPlatformTests.cs +++ b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/CheckPlatformTests.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Runtime.InteropServices; using Xunit; namespace System.Runtime.InteropServices.RuntimeInformationTests @@ -13,10 +12,10 @@ public void CheckLinux() { Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Linux)); Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("LINUX"))); + Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("linux"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("DARWIN"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD"))); - Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("linux"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NetBSD"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("netbsd"))); @@ -31,9 +30,9 @@ public void CheckLinux() public void CheckNetBSD() { Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD"))); + Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NetBSD"))); + Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("netbsd"))); - Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NetBSD"))); - Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("netbsd"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("DARWIN"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("LINUX"))); @@ -51,12 +50,16 @@ public void CheckOSX() { Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.OSX)); Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("OSX"))); + Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("osx"))); + Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.macOS)); + Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACOS"))); + Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("macOS"))); + Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("macos"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NetBSD"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("netbsd"))); - Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("osx"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("mac"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("DARWIN"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACOSX"))); @@ -70,6 +73,8 @@ public void CheckiOS() { Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.iOS)); Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS"))); + Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("iOS"))); + Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("ios"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD"))); @@ -89,6 +94,8 @@ public void ChecktvOS() { Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.tvOS)); Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("TVOS"))); + Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("tvOS"))); + Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("tvos"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD"))); @@ -108,6 +115,7 @@ public void CheckAndroid() { Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Android)); Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("ANDROID"))); + Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("android"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD"))); @@ -127,6 +135,7 @@ public void CheckBrowser() { Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Browser)); Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER"))); + Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("browser"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD"))); @@ -146,13 +155,14 @@ public void CheckWindows() { Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("WINDOWS"))); + Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("windows"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NetBSD"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("netbsd"))); - Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("windows"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("Windows NT"))); + Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("win"))); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Linux)); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.OSX)); Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD)); @@ -213,5 +223,17 @@ public void CheckOSPlatform() Assert.Equal(0, defaultObj.GetHashCode()); Assert.Equal(defaultObj.GetHashCode(), conObj.GetHashCode()); } + + [Fact] + public void StringComparisonOrdinalIgnoreCaseIsUsed() + { + Assert.Equal(OSPlatform.Create("A"), OSPlatform.Create("a")); + Assert.Equal(OSPlatform.Create("A"), OSPlatform.Create("A")); + Assert.Equal(OSPlatform.Create("a"), OSPlatform.Create("a")); + + Assert.Equal(OSPlatform.Create("A").GetHashCode(), OSPlatform.Create("a").GetHashCode()); + Assert.Equal(OSPlatform.Create("A").GetHashCode(), OSPlatform.Create("A").GetHashCode()); + Assert.Equal(OSPlatform.Create("a").GetHashCode(), OSPlatform.Create("a").GetHashCode()); + } } } diff --git a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/PlatformVersionTests.cs b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/PlatformVersionTests.cs index c00ace314903..b612d2e065bc 100644 --- a/src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/PlatformVersionTests.cs +++ b/src/libraries/System.Runtime.InteropServices.RuntimeInformation/tests/PlatformVersionTests.cs @@ -14,6 +14,11 @@ public static IEnumerable AllKnownOsPlatforms() yield return new object[] { OSPlatform.Linux }; yield return new object[] { OSPlatform.OSX }; yield return new object[] { OSPlatform.Browser }; + yield return new object[] { OSPlatform.macOS }; + yield return new object[] { OSPlatform.iOS }; + yield return new object[] { OSPlatform.tvOS }; + yield return new object[] { OSPlatform.watchOS }; + yield return new object[] { OSPlatform.Android }; } [Fact] @@ -49,6 +54,8 @@ public void IsOSPlatformOrLater_ReturnsTrue_ForCurrentOS(OSPlatform osPlatform) Version current = Environment.OSVersion.Version; Assert.Equal(isCurrentPlatfom, RuntimeInformation.IsOSPlatformOrLater($"{osPlatform}{current}")); + Assert.Equal(isCurrentPlatfom, RuntimeInformation.IsOSPlatformOrLater($"{osPlatform.ToString().ToLower()}{current}")); + Assert.Equal(isCurrentPlatfom, RuntimeInformation.IsOSPlatformOrLater($"{osPlatform.ToString().ToUpper()}{current}")); Assert.Equal(isCurrentPlatfom, RuntimeInformation.IsOSPlatformOrLater(osPlatform, current.Major)); @@ -78,6 +85,8 @@ public void IsOSPlatformOrLater_ReturnsFalse_ForNewerVersionOfCurrentOS(OSPlatfo Version newer = new Version(currentVersion.Major + 1, 0); Assert.False(RuntimeInformation.IsOSPlatformOrLater($"{osPlatform}{newer}")); + Assert.False(RuntimeInformation.IsOSPlatformOrLater($"{osPlatform.ToString().ToLower()}{newer}")); + Assert.False(RuntimeInformation.IsOSPlatformOrLater($"{osPlatform.ToString().ToUpper()}{newer}")); Assert.False(RuntimeInformation.IsOSPlatformOrLater(osPlatform, newer.Major)); newer = new Version(currentVersion.Major, currentVersion.Minor + 1); @@ -104,6 +113,8 @@ public void IsOSPlatformOrLater_ReturnsTrue_ForOlderVersionOfCurrentOS(OSPlatfor Version older = new Version(current.Major - 1, 0); Assert.Equal(isCurrentPlatfom, RuntimeInformation.IsOSPlatformOrLater($"{osPlatform}{older}")); + Assert.Equal(isCurrentPlatfom, RuntimeInformation.IsOSPlatformOrLater($"{osPlatform.ToString().ToLower()}{older}")); + Assert.Equal(isCurrentPlatfom, RuntimeInformation.IsOSPlatformOrLater($"{osPlatform.ToString().ToUpper()}{older}")); Assert.Equal(isCurrentPlatfom, RuntimeInformation.IsOSPlatformOrLater(osPlatform, older.Major)); if (current.Minor > 0) @@ -160,6 +171,8 @@ public void IsOSPlatformEarlierThan_ReturnsFalse_ForCurrentOS(OSPlatform osPlatf Version current = Environment.OSVersion.Version; Assert.False(RuntimeInformation.IsOSPlatformEarlierThan($"{osPlatform}{current}")); + Assert.False(RuntimeInformation.IsOSPlatformEarlierThan($"{osPlatform.ToString().ToLower()}{current}")); + Assert.False(RuntimeInformation.IsOSPlatformEarlierThan($"{osPlatform.ToString().ToUpper()}{current}")); Assert.False(RuntimeInformation.IsOSPlatformEarlierThan(osPlatform, current.Major)); @@ -190,6 +203,8 @@ public void IsOSPlatformEarlierThan_ReturnsTrue_ForNewerVersionOfCurrentOS(OSPla Version newer = new Version(current.Major + 1, 0); Assert.Equal(isCurrentPlatfom, RuntimeInformation.IsOSPlatformEarlierThan($"{osPlatform}{newer}")); + Assert.Equal(isCurrentPlatfom, RuntimeInformation.IsOSPlatformEarlierThan($"{osPlatform.ToString().ToLower()}{newer}")); + Assert.Equal(isCurrentPlatfom, RuntimeInformation.IsOSPlatformEarlierThan($"{osPlatform.ToString().ToUpper()}{newer}")); Assert.Equal(isCurrentPlatfom, RuntimeInformation.IsOSPlatformEarlierThan(osPlatform, newer.Major)); newer = new Version(current.Major, current.Minor + 1); @@ -215,6 +230,8 @@ public void IsOSPlatformEarlierThan_ReturnsFalse_ForOlderVersionOfCurrentOS(OSPl Version older = new Version(current.Major - 1, 0); Assert.False(RuntimeInformation.IsOSPlatformEarlierThan($"{osPlatform}{older}")); + Assert.False(RuntimeInformation.IsOSPlatformEarlierThan($"{osPlatform.ToString().ToLower()}{older}")); + Assert.False(RuntimeInformation.IsOSPlatformEarlierThan($"{osPlatform.ToString().ToUpper()}{older}")); Assert.False(RuntimeInformation.IsOSPlatformEarlierThan(osPlatform, older.Major)); if (current.Minor > 0) diff --git a/src/libraries/System.Runtime.InteropServices/Directory.Build.props b/src/libraries/System.Runtime.InteropServices/Directory.Build.props index 465e1110d6b0..42c6eafce67e 100644 --- a/src/libraries/System.Runtime.InteropServices/Directory.Build.props +++ b/src/libraries/System.Runtime.InteropServices/Directory.Build.props @@ -3,5 +3,6 @@ Microsoft true + true \ No newline at end of file diff --git a/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs b/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs index cfdb1310efec..62a712405472 100644 --- a/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs +++ b/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs @@ -316,6 +316,7 @@ public DefaultParameterValueAttribute(object? value) { } public sealed partial class DispatchWrapper { public DispatchWrapper(object? obj) { } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public object? WrappedObject { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited=false)] @@ -350,7 +351,7 @@ public enum DllImportSearchPath System32 = 2048, SafeDirectories = 4096, } - [System.AttributeUsage(System.AttributeTargets.Interface, AllowMultiple=false, Inherited=false)] + [System.AttributeUsageAttribute(System.AttributeTargets.Interface, AllowMultiple=false, Inherited=false)] public sealed class DynamicInterfaceCastableImplementationAttribute : Attribute { public DynamicInterfaceCastableImplementationAttribute() { } @@ -461,12 +462,15 @@ public static partial class Marshal { public static readonly int SystemDefaultCharSize; public static readonly int SystemMaxDBCSCharSize; + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static int AddRef(System.IntPtr pUnk) { throw null; } public static System.IntPtr AllocCoTaskMem(int cb) { throw null; } public static System.IntPtr AllocHGlobal(int cb) { throw null; } public static System.IntPtr AllocHGlobal(System.IntPtr cb) { throw null; } public static bool AreComObjectsAvailableForCleanup() { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static object BindToMoniker(string monikerName) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static void ChangeWrapperHandleStrength(object otp, bool fIsWeak) { } public static void CleanupUnusedObjectsInCurrentContext() { } public static void Copy(byte[] source, int startIndex, System.IntPtr destination, int length) { } @@ -485,31 +489,40 @@ public static void Copy(System.IntPtr source, System.IntPtr[] destination, int s public static void Copy(System.IntPtr source, float[] destination, int startIndex, int length) { } public static void Copy(System.IntPtr[] source, int startIndex, System.IntPtr destination, int length) { } public static void Copy(float[] source, int startIndex, System.IntPtr destination, int length) { } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.IntPtr CreateAggregatedObject(System.IntPtr pOuter, object o) { throw null; } public static System.IntPtr CreateAggregatedObject(System.IntPtr pOuter, T o) where T : notnull { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("o")] public static object? CreateWrapperOfType(object? o, System.Type t) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static TWrapper CreateWrapperOfType([System.Diagnostics.CodeAnalysis.AllowNullAttribute] T o) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static void DestroyStructure(System.IntPtr ptr, System.Type structuretype) { } public static void DestroyStructure(System.IntPtr ptr) { } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static int FinalReleaseComObject(object o) { throw null; } public static void FreeBSTR(System.IntPtr ptr) { } public static void FreeCoTaskMem(System.IntPtr ptr) { } public static void FreeHGlobal(System.IntPtr hglobal) { } public static System.Guid GenerateGuidForType(System.Type type) { throw null; } public static string? GenerateProgIdForType(System.Type type) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.IntPtr GetComInterfaceForObject(object o, System.Type T) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.IntPtr GetComInterfaceForObject(object o, System.Type T, System.Runtime.InteropServices.CustomQueryInterfaceMode mode) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static System.IntPtr GetComInterfaceForObject([System.Diagnostics.CodeAnalysis.DisallowNullAttribute] T o) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static object? GetComObjectData(object obj, object key) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.Delegate GetDelegateForFunctionPointer(System.IntPtr ptr, System.Type t) { throw null; } public static TDelegate GetDelegateForFunctionPointer(System.IntPtr ptr) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static int GetEndComSlot(System.Type t) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("GetExceptionCode() may be unavailable in future releases.")] @@ -523,27 +536,41 @@ public static void FreeHGlobal(System.IntPtr hglobal) { } public static System.IntPtr GetHINSTANCE(System.Reflection.Module m) { throw null; } public static int GetHRForException(System.Exception? e) { throw null; } public static int GetHRForLastWin32Error() { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static System.IntPtr GetIDispatchForObject(object o) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static System.IntPtr GetIUnknownForObject(object o) { throw null; } public static int GetLastWin32Error() { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static void GetNativeVariantForObject(object? obj, System.IntPtr pDstNativeVariant) { } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static void GetNativeVariantForObject([System.Diagnostics.CodeAnalysis.AllowNullAttribute] T obj, System.IntPtr pDstNativeVariant) { } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static object GetObjectForIUnknown(System.IntPtr pUnk) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static object? GetObjectForNativeVariant(System.IntPtr pSrcNativeVariant) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] public static T GetObjectForNativeVariant(System.IntPtr pSrcNativeVariant) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static object?[] GetObjectsForNativeVariants(System.IntPtr aSrcNativeVariant, int cVars) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static T[] GetObjectsForNativeVariants(System.IntPtr aSrcNativeVariant, int cVars) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static int GetStartComSlot(System.Type t) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static object GetTypedObjectForIUnknown(System.IntPtr pUnk, System.Type t) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static System.Type GetTypeFromCLSID(System.Guid clsid) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static string GetTypeInfoName(System.Runtime.InteropServices.ComTypes.ITypeInfo typeInfo) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static object GetUniqueObjectForIUnknown(System.IntPtr unknown) { throw null; } public static bool IsComObject(object o) { throw null; } public static bool IsTypeVisibleFromCom(System.Type t) { throw null; } @@ -568,6 +595,7 @@ public static void PtrToStructure(System.IntPtr ptr, object structure) { } [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] public static T PtrToStructure(System.IntPtr ptr) { throw null; } public static void PtrToStructure(System.IntPtr ptr, [System.Diagnostics.CodeAnalysis.DisallowNullAttribute] T structure) { } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static int QueryInterface(System.IntPtr pUnk, ref System.Guid iid, out System.IntPtr ppv) { throw null; } public static byte ReadByte(System.IntPtr ptr) { throw null; } public static byte ReadByte(System.IntPtr ptr, int ofs) { throw null; } @@ -596,13 +624,16 @@ public static void PtrToStructure(System.IntPtr ptr, [System.Diagnostics.Code public static System.IntPtr ReadIntPtr(object ptr, int ofs) { throw null; } public static System.IntPtr ReAllocCoTaskMem(System.IntPtr pv, int cb) { throw null; } public static System.IntPtr ReAllocHGlobal(System.IntPtr pv, System.IntPtr cb) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static int Release(System.IntPtr pUnk) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static int ReleaseComObject(object o) { throw null; } public static System.IntPtr SecureStringToBSTR(System.Security.SecureString s) { throw null; } public static System.IntPtr SecureStringToCoTaskMemAnsi(System.Security.SecureString s) { throw null; } public static System.IntPtr SecureStringToCoTaskMemUnicode(System.Security.SecureString s) { throw null; } public static System.IntPtr SecureStringToGlobalAllocAnsi(System.Security.SecureString s) { throw null; } public static System.IntPtr SecureStringToGlobalAllocUnicode(System.Security.SecureString s) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static bool SetComObjectData(object obj, object key, object? data) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static int SizeOf(object structure) { throw null; } diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetDelegateForFunctionPointerTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetDelegateForFunctionPointerTests.cs index c04d683d45b5..6f12389d33fc 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetDelegateForFunctionPointerTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetDelegateForFunctionPointerTests.cs @@ -10,6 +10,7 @@ namespace System.Runtime.InteropServices.Tests { + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public class GetDelegateForFunctionPointerTests { [Theory] diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetFunctionPointerForDelegateTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetFunctionPointerForDelegateTests.cs index 70204afc8897..85328ac80269 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetFunctionPointerForDelegateTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetFunctionPointerForDelegateTests.cs @@ -11,6 +11,7 @@ namespace System.Runtime.InteropServices.Tests public class GetFunctionPointerForDelegateTests { [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public void GetFunctionPointerForDelegate_NormalDelegateNonGeneric_ReturnsExpected() { MethodInfo targetMethod = typeof(GetFunctionPointerForDelegateTests).GetMethod(nameof(Method), BindingFlags.NonPublic | BindingFlags.Static); @@ -23,6 +24,7 @@ public void GetFunctionPointerForDelegate_NormalDelegateNonGeneric_ReturnsExpect } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public void GetFunctionPointerForDelegate_MarshalledDelegateNonGeneric_ReturnsExpected() { MethodInfo targetMethod = typeof(GetFunctionPointerForDelegateTests).GetMethod(nameof(Method), BindingFlags.NonPublic | BindingFlags.Static); @@ -39,6 +41,7 @@ public void GetFunctionPointerForDelegate_MarshalledDelegateNonGeneric_ReturnsEx } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public void GetFunctionPointerForDelegate_NormalDelegateGeneric_ReturnsExpected() { MethodInfo targetMethod = typeof(GetFunctionPointerForDelegateTests).GetMethod(nameof(Method), BindingFlags.NonPublic | BindingFlags.Static); @@ -51,6 +54,7 @@ public void GetFunctionPointerForDelegate_NormalDelegateGeneric_ReturnsExpected( } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public void GetFunctionPointerForDelegate_MarshalledDelegateGeneric_ReturnsExpected() { MethodInfo targetMethod = typeof(GetFunctionPointerForDelegateTests).GetMethod(nameof(Method), BindingFlags.NonPublic | BindingFlags.Static); diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/OffsetOfTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/OffsetOfTests.cs index df8381a578e1..5ed3fd5313c6 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/OffsetOfTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/OffsetOfTests.cs @@ -109,7 +109,7 @@ public void OffsetOf_Decimal_ReturnsExpected() { Type t = typeof(FieldAlignmentTest_Decimal); - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || (RuntimeInformation.ProcessArchitecture != Architecture.X86)) + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || (RuntimeInformation.ProcessArchitecture != Architecture.X86 && RuntimeInformation.ProcessArchitecture != Architecture.Wasm)) { Assert.Equal(96, Marshal.SizeOf(t)); } @@ -121,7 +121,7 @@ public void OffsetOf_Decimal_ReturnsExpected() Assert.Equal(new IntPtr(0), Marshal.OffsetOf(t, nameof(FieldAlignmentTest_Decimal.b))); Assert.Equal(new IntPtr(8), Marshal.OffsetOf(t, nameof(FieldAlignmentTest_Decimal.p))); - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || (RuntimeInformation.ProcessArchitecture != Architecture.X86)) + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || (RuntimeInformation.ProcessArchitecture != Architecture.X86 && RuntimeInformation.ProcessArchitecture != Architecture.Wasm)) { Assert.Equal(new IntPtr(88), Marshal.OffsetOf(t, nameof(FieldAlignmentTest_Decimal.s))); } diff --git a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs index 695ed82d2a6b..4fc9a2dab9e8 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -2366,6 +2366,52 @@ internal Arm64() { } public static System.Runtime.Intrinsics.Vector128 Sqrt(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 Sqrt(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector64 Sqrt(System.Runtime.Intrinsics.Vector64 value) { throw null; } + public unsafe static void StorePair(byte* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePair(byte* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePair(double* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePair(double* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePair(short* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePair(short* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePair(int* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePair(int* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePair(long* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePair(long* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePair(sbyte* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePair(sbyte* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePair(float* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePair(float* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePair(ushort* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePair(ushort* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePair(uint* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePair(uint* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePair(ulong* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePair(ulong* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePairNonTemporal(byte* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePairNonTemporal(byte* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePairNonTemporal(double* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePairNonTemporal(double* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePairNonTemporal(short* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePairNonTemporal(short* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePairNonTemporal(int* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePairNonTemporal(int* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePairNonTemporal(long* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePairNonTemporal(long* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePairNonTemporal(sbyte* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePairNonTemporal(sbyte* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePairNonTemporal(float* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePairNonTemporal(float* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePairNonTemporal(ushort* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePairNonTemporal(ushort* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePairNonTemporal(uint* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePairNonTemporal(uint* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePairNonTemporal(ulong* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } + public unsafe static void StorePairNonTemporal(ulong* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePairScalar(int* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePairScalar(float* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePairScalar(uint* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePairScalarNonTemporal(int* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePairScalarNonTemporal(float* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } + public unsafe static void StorePairScalarNonTemporal(uint* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } public static System.Runtime.Intrinsics.Vector128 Subtract(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector64 SubtractSaturateScalar(System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right) { throw null; } public static System.Runtime.Intrinsics.Vector64 SubtractSaturateScalar(System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right) { throw null; } @@ -2541,6 +2587,76 @@ internal Arm64() { } } } [System.CLSCompliantAttribute(false)] + public abstract partial class Dp : System.Runtime.Intrinsics.Arm.AdvSimd + { + internal Dp() { } + public static new bool IsSupported { get { throw null; } } + public static System.Runtime.Intrinsics.Vector128 DotProduct(System.Runtime.Intrinsics.Vector128 addend, System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } + public static System.Runtime.Intrinsics.Vector128 DotProduct(System.Runtime.Intrinsics.Vector128 addend, System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } + public static System.Runtime.Intrinsics.Vector64 DotProduct(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right) { throw null; } + public static System.Runtime.Intrinsics.Vector64 DotProduct(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right) { throw null; } + public static System.Runtime.Intrinsics.Vector128 DotProductBySelectedQuadruplet(System.Runtime.Intrinsics.Vector128 addend, System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right, byte rightScaledIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector128 DotProductBySelectedQuadruplet(System.Runtime.Intrinsics.Vector128 addend, System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector64 right, byte rightScaledIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector128 DotProductBySelectedQuadruplet(System.Runtime.Intrinsics.Vector128 addend, System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right, byte rightScaledIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector128 DotProductBySelectedQuadruplet(System.Runtime.Intrinsics.Vector128 addend, System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector64 right, byte rightScaledIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 DotProductBySelectedQuadruplet(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector128 right, byte rightScaledIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 DotProductBySelectedQuadruplet(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right, byte rightScaledIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 DotProductBySelectedQuadruplet(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector128 right, byte rightScaledIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 DotProductBySelectedQuadruplet(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right, byte rightScaledIndex) { throw null; } + public new abstract partial class Arm64 : System.Runtime.Intrinsics.Arm.AdvSimd.Arm64 + { + internal Arm64() { } + public static new bool IsSupported { get { throw null; } } + } + } + [System.CLSCompliantAttribute(false)] + public abstract partial class Rdm : System.Runtime.Intrinsics.Arm.AdvSimd + { + internal Rdm() { } + public static new bool IsSupported { get { throw null; } } + public static System.Runtime.Intrinsics.Vector128 MultiplyRoundedDoublingAndAddSaturateHigh(System.Runtime.Intrinsics.Vector128 addend, System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } + public static System.Runtime.Intrinsics.Vector128 MultiplyRoundedDoublingAndAddSaturateHigh(System.Runtime.Intrinsics.Vector128 addend, System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingAndAddSaturateHigh(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingAndAddSaturateHigh(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right) { throw null; } + public static System.Runtime.Intrinsics.Vector128 MultiplyRoundedDoublingAndSubtractSaturateHigh(System.Runtime.Intrinsics.Vector128 minuend, System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } + public static System.Runtime.Intrinsics.Vector128 MultiplyRoundedDoublingAndSubtractSaturateHigh(System.Runtime.Intrinsics.Vector128 minuend, System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingAndSubtractSaturateHigh(System.Runtime.Intrinsics.Vector64 minuend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingAndSubtractSaturateHigh(System.Runtime.Intrinsics.Vector64 minuend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right) { throw null; } + public static System.Runtime.Intrinsics.Vector128 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(System.Runtime.Intrinsics.Vector128 addend, System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector128 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(System.Runtime.Intrinsics.Vector128 addend, System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector64 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector128 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(System.Runtime.Intrinsics.Vector128 addend, System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector128 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(System.Runtime.Intrinsics.Vector128 addend, System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector64 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector128 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector128 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector128 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(System.Runtime.Intrinsics.Vector128 minuend, System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector128 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(System.Runtime.Intrinsics.Vector128 minuend, System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector64 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector128 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(System.Runtime.Intrinsics.Vector128 minuend, System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector128 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(System.Runtime.Intrinsics.Vector128 minuend, System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector64 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(System.Runtime.Intrinsics.Vector64 minuend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector128 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(System.Runtime.Intrinsics.Vector64 minuend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(System.Runtime.Intrinsics.Vector64 minuend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector128 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(System.Runtime.Intrinsics.Vector64 minuend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right, byte rightIndex) { throw null; } + public new abstract partial class Arm64 : System.Runtime.Intrinsics.Arm.AdvSimd.Arm64 + { + internal Arm64() { } + public static new bool IsSupported { get { throw null; } } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingAndAddSaturateHighScalar(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingAndAddSaturateHighScalar(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingAndSubtractSaturateHighScalar(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingAndSubtractSaturateHighScalar(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector128 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector128 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(System.Runtime.Intrinsics.Vector64 addend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(System.Runtime.Intrinsics.Vector64 minuend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector128 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(System.Runtime.Intrinsics.Vector64 minuend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(System.Runtime.Intrinsics.Vector64 minuend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector128 right, byte rightIndex) { throw null; } + public static System.Runtime.Intrinsics.Vector64 MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(System.Runtime.Intrinsics.Vector64 minuend, System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right, byte rightIndex) { throw null; } + } + } + [System.CLSCompliantAttribute(false)] public abstract partial class Sha1 : System.Runtime.Intrinsics.Arm.ArmBase { internal Sha1() { } diff --git a/src/libraries/System.Runtime.Loader/tests/AssemblyLoadContextTest.cs b/src/libraries/System.Runtime.Loader/tests/AssemblyLoadContextTest.cs index 3979d76aeadb..290cb3ca06b3 100644 --- a/src/libraries/System.Runtime.Loader/tests/AssemblyLoadContextTest.cs +++ b/src/libraries/System.Runtime.Loader/tests/AssemblyLoadContextTest.cs @@ -18,6 +18,7 @@ public partial class AssemblyLoadContextTest private const string TestAssemblyNotSupported = "System.Runtime.Loader.Test.AssemblyNotSupported"; [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39379", TestPlatforms.Browser)] public static void GetAssemblyNameTest_ValidAssembly() { var expectedName = typeof(AssemblyLoadContextTest).Assembly.GetName(); diff --git a/src/libraries/System.Runtime.Loader/tests/CollectibleAssemblyLoadContextTest.cs b/src/libraries/System.Runtime.Loader/tests/CollectibleAssemblyLoadContextTest.cs index f5bcccb6d91f..90527c3d0be9 100644 --- a/src/libraries/System.Runtime.Loader/tests/CollectibleAssemblyLoadContextTest.cs +++ b/src/libraries/System.Runtime.Loader/tests/CollectibleAssemblyLoadContextTest.cs @@ -39,7 +39,7 @@ public static void Unload_CollectibleWithNoAssemblyLoaded() checker.GcAndCheck(); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] public static void Finalizer_CollectibleWithNoAssemblyLoaded() { // Use a collectible ALC, let the finalizer call Unload diff --git a/src/libraries/System.Runtime.Loader/tests/DefaultContext/DefaultLoadContextTest.cs b/src/libraries/System.Runtime.Loader/tests/DefaultContext/DefaultLoadContextTest.cs index 3dcd6893e08f..1bf6847ed550 100644 --- a/src/libraries/System.Runtime.Loader/tests/DefaultContext/DefaultLoadContextTest.cs +++ b/src/libraries/System.Runtime.Loader/tests/DefaultContext/DefaultLoadContextTest.cs @@ -83,6 +83,7 @@ private Assembly ResolveNullAssembly(AssemblyLoadContext sender, AssemblyName as } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39202", TestPlatforms.Browser)] public void LoadInDefaultContext() { // This will attempt to load an assembly, by path, in the Default Load context via the Resolving event diff --git a/src/libraries/System.Runtime.Loader/tests/SatelliteAssemblies.cs b/src/libraries/System.Runtime.Loader/tests/SatelliteAssemblies.cs index a4401ca973c1..658d1f42a128 100644 --- a/src/libraries/System.Runtime.Loader/tests/SatelliteAssemblies.cs +++ b/src/libraries/System.Runtime.Loader/tests/SatelliteAssemblies.cs @@ -18,19 +18,22 @@ public class SatelliteAssembliesTestsFixture public SatelliteAssembliesTestsFixture() { AssemblyLoadContext satelliteAssembliesTests = new AssemblyLoadContext("SatelliteAssembliesTests"); - satelliteAssembliesTests.LoadFromAssemblyPath(typeof(SatelliteAssembliesTests).Assembly.Location); + var satelliteAssembliesTestsPath = (PlatformDetection.IsBrowser ? "/" : "") + typeof(SatelliteAssembliesTests).Assembly.Location; + satelliteAssembliesTests.LoadFromAssemblyPath(satelliteAssembliesTestsPath); AssemblyLoadContext referencedClassLib = new AssemblyLoadContext("ReferencedClassLib"); - referencedClassLib.LoadFromAssemblyPath(typeof(ReferencedClassLib.Program).Assembly.Location); + var referencedClassLibPath = (PlatformDetection.IsBrowser ? "/" : "") + typeof(ReferencedClassLib.Program).Assembly.Location; + referencedClassLib.LoadFromAssemblyPath(referencedClassLibPath); AssemblyLoadContext referencedClassLibNeutralIsSatellite = new AssemblyLoadContext("ReferencedClassLibNeutralIsSatellite"); - referencedClassLibNeutralIsSatellite.LoadFromAssemblyPath(typeof(ReferencedClassLibNeutralIsSatellite.Program).Assembly.Location); + var referencedClassLibNeutralIsSatellitePath = (PlatformDetection.IsBrowser ? "/" : "") + typeof(ReferencedClassLibNeutralIsSatellite.Program).Assembly.Location; + referencedClassLibNeutralIsSatellite.LoadFromAssemblyPath(referencedClassLibNeutralIsSatellitePath); new AssemblyLoadContext("Empty"); try { - Assembly assembly = Assembly.LoadFile(typeof(SatelliteAssembliesTests).Assembly.Location); + Assembly assembly = Assembly.LoadFile(satelliteAssembliesTestsPath); contexts["LoadFile"] = AssemblyLoadContext.GetLoadContext(assembly); } catch (Exception e) @@ -55,14 +58,24 @@ public SatelliteAssembliesTests(SatelliteAssembliesTestsFixture fixture) } #region DescribeTests + + public static IEnumerable MainResources_TestData() + { + yield return new object[] { "", "Neutral language Main description 1.0.0" }; + + if (PlatformDetection.IsNotInvariantGlobalization) + { + yield return new object[] { "en", "English language Main description 1.0.0" }; + yield return new object[] { "en-US", "English language Main description 1.0.0" }; + yield return new object[] { "es", "Neutral language Main description 1.0.0" }; + yield return new object[] { "es-MX", "Spanish (Mexico) language Main description 1.0.0" }; + yield return new object[] { "fr", "Neutral language Main description 1.0.0" }; + yield return new object[] { "fr-FR", "Neutral language Main description 1.0.0" }; + } + } + [Theory] - [InlineData("", "Neutral language Main description 1.0.0")] - [InlineData("en", "English language Main description 1.0.0")] - [InlineData("en-US", "English language Main description 1.0.0")] - [InlineData("es", "Neutral language Main description 1.0.0")] - [InlineData("es-MX", "Spanish (Mexico) language Main description 1.0.0")] - [InlineData("fr", "Neutral language Main description 1.0.0")] - [InlineData("fr-FR", "Neutral language Main description 1.0.0")] + [MemberData(nameof(MainResources_TestData))] public static void mainResources(string lang, string expected) { Assert.Equal(expected, Describe(lang)); @@ -77,44 +90,49 @@ public static string Describe(string lang) return rm.GetString("Describe", ci); } - [Theory] - [InlineData("Default", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "", "Neutral language Main description 1.0.0")] - [InlineData("Default", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "en", "English language Main description 1.0.0")] - [InlineData("Default", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "en-US", "English language Main description 1.0.0")] - [InlineData("Default", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "es", "Neutral language Main description 1.0.0")] - [InlineData("Default", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "es-MX", "Spanish (Mexico) language Main description 1.0.0")] - [InlineData("Default", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "fr", "Neutral language Main description 1.0.0")] - [InlineData("Default", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "fr-FR", "Neutral language Main description 1.0.0")] - [InlineData("SatelliteAssembliesTests", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "", "Neutral language Main description 1.0.0")] - [InlineData("SatelliteAssembliesTests", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "en", "English language Main description 1.0.0")] - [InlineData("SatelliteAssembliesTests", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "en-US", "English language Main description 1.0.0")] - [InlineData("SatelliteAssembliesTests", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "es", "Neutral language Main description 1.0.0")] - [InlineData("SatelliteAssembliesTests", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "es-MX", "Spanish (Mexico) language Main description 1.0.0")] - [InlineData("SatelliteAssembliesTests", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "fr", "Neutral language Main description 1.0.0")] - [InlineData("SatelliteAssembliesTests", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "fr-FR", "Neutral language Main description 1.0.0")] - [InlineData("LoadFile", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "", "Neutral language Main description 1.0.0")] - [InlineData("LoadFile", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "en", "English language Main description 1.0.0")] - [InlineData("LoadFile", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "en-US", "English language Main description 1.0.0")] - [InlineData("LoadFile", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "es", "Neutral language Main description 1.0.0")] - [InlineData("LoadFile", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "es-MX", "Spanish (Mexico) language Main description 1.0.0")] - [InlineData("LoadFile", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "fr", "Neutral language Main description 1.0.0")] - [InlineData("LoadFile", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "fr-FR", "Neutral language Main description 1.0.0")] - [InlineData("Default", "ReferencedClassLib.Program, ReferencedClassLib", "", "Neutral language ReferencedClassLib description 1.0.0")] - [InlineData("Default", "ReferencedClassLib.Program, ReferencedClassLib", "en", "English language ReferencedClassLib description 1.0.0")] - [InlineData("Default", "ReferencedClassLib.Program, ReferencedClassLib", "en-US", "English language ReferencedClassLib description 1.0.0")] - [InlineData("Default", "ReferencedClassLib.Program, ReferencedClassLib", "es", "Neutral language ReferencedClassLib description 1.0.0")] - [InlineData("Default", "ReferencedClassLibNeutralIsSatellite.Program, ReferencedClassLibNeutralIsSatellite", "", "Neutral (es) language ReferencedClassLibNeutralIsSatellite description 1.0.0")] - [InlineData("Default", "ReferencedClassLibNeutralIsSatellite.Program, ReferencedClassLibNeutralIsSatellite", "en", "English language ReferencedClassLibNeutralIsSatellite description 1.0.0")] - [InlineData("Default", "ReferencedClassLibNeutralIsSatellite.Program, ReferencedClassLibNeutralIsSatellite", "en-US", "English language ReferencedClassLibNeutralIsSatellite description 1.0.0")] - [InlineData("Default", "ReferencedClassLibNeutralIsSatellite.Program, ReferencedClassLibNeutralIsSatellite", "es", "Neutral (es) language ReferencedClassLibNeutralIsSatellite description 1.0.0")] - [InlineData("ReferencedClassLib", "ReferencedClassLib.Program, ReferencedClassLib", "", "Neutral language ReferencedClassLib description 1.0.0")] - [InlineData("ReferencedClassLib", "ReferencedClassLib.Program, ReferencedClassLib", "en", "English language ReferencedClassLib description 1.0.0")] - [InlineData("ReferencedClassLib", "ReferencedClassLib.Program, ReferencedClassLib", "en-US", "English language ReferencedClassLib description 1.0.0")] - [InlineData("ReferencedClassLib", "ReferencedClassLib.Program, ReferencedClassLib", "es", "Neutral language ReferencedClassLib description 1.0.0")] - [InlineData("ReferencedClassLibNeutralIsSatellite", "ReferencedClassLibNeutralIsSatellite.Program, ReferencedClassLibNeutralIsSatellite", "", "Neutral (es) language ReferencedClassLibNeutralIsSatellite description 1.0.0")] - [InlineData("ReferencedClassLibNeutralIsSatellite", "ReferencedClassLibNeutralIsSatellite.Program, ReferencedClassLibNeutralIsSatellite", "en", "English language ReferencedClassLibNeutralIsSatellite description 1.0.0")] - [InlineData("ReferencedClassLibNeutralIsSatellite", "ReferencedClassLibNeutralIsSatellite.Program, ReferencedClassLibNeutralIsSatellite", "en-US", "English language ReferencedClassLibNeutralIsSatellite description 1.0.0")] - [InlineData("ReferencedClassLibNeutralIsSatellite", "ReferencedClassLibNeutralIsSatellite.Program, ReferencedClassLibNeutralIsSatellite", "es", "Neutral (es) language ReferencedClassLibNeutralIsSatellite description 1.0.0")] + public static IEnumerable DescribeLib_TestData() + { + yield return new object[] { "Default", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "", "Neutral language Main description 1.0.0" }; + yield return new object[] { "Default", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "en", "English language Main description 1.0.0" }; + yield return new object[] { "Default", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "en-US", "English language Main description 1.0.0" }; + yield return new object[] { "Default", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "es", "Neutral language Main description 1.0.0" }; + yield return new object[] { "Default", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "es-MX", "Spanish (Mexico) language Main description 1.0.0" }; + yield return new object[] { "Default", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "fr", "Neutral language Main description 1.0.0" }; + yield return new object[] { "Default", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "fr-FR", "Neutral language Main description 1.0.0" }; + yield return new object[] { "SatelliteAssembliesTests", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "", "Neutral language Main description 1.0.0" }; + yield return new object[] { "SatelliteAssembliesTests", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "en", "English language Main description 1.0.0" }; + yield return new object[] { "SatelliteAssembliesTests", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "en-US", "English language Main description 1.0.0" }; + yield return new object[] { "SatelliteAssembliesTests", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "es", "Neutral language Main description 1.0.0" }; + yield return new object[] { "SatelliteAssembliesTests", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "es-MX", "Spanish (Mexico) language Main description 1.0.0" }; + yield return new object[] { "SatelliteAssembliesTests", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "fr", "Neutral language Main description 1.0.0" }; + yield return new object[] { "SatelliteAssembliesTests", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "fr-FR", "Neutral language Main description 1.0.0" }; + yield return new object[] { "LoadFile", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "", "Neutral language Main description 1.0.0" }; + yield return new object[] { "LoadFile", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "en", "English language Main description 1.0.0" }; + yield return new object[] { "LoadFile", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "en-US", "English language Main description 1.0.0" }; + yield return new object[] { "LoadFile", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "es", "Neutral language Main description 1.0.0" }; + yield return new object[] { "LoadFile", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "es-MX", "Spanish (Mexico) language Main description 1.0.0" }; + yield return new object[] { "LoadFile", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "fr", "Neutral language Main description 1.0.0" }; + yield return new object[] { "LoadFile", "System.Runtime.Loader.Tests.SatelliteAssembliesTests", "fr-FR", "Neutral language Main description 1.0.0" }; + yield return new object[] { "Default", "ReferencedClassLib.Program, ReferencedClassLib", "", "Neutral language ReferencedClassLib description 1.0.0" }; + yield return new object[] { "Default", "ReferencedClassLib.Program, ReferencedClassLib", "en", "English language ReferencedClassLib description 1.0.0" }; + yield return new object[] { "Default", "ReferencedClassLib.Program, ReferencedClassLib", "en-US", "English language ReferencedClassLib description 1.0.0" }; + yield return new object[] { "Default", "ReferencedClassLib.Program, ReferencedClassLib", "es", "Neutral language ReferencedClassLib description 1.0.0" }; + yield return new object[] { "Default", "ReferencedClassLibNeutralIsSatellite.Program, ReferencedClassLibNeutralIsSatellite", "", "Neutral (es) language ReferencedClassLibNeutralIsSatellite description 1.0.0" }; + yield return new object[] { "Default", "ReferencedClassLibNeutralIsSatellite.Program, ReferencedClassLibNeutralIsSatellite", "en", "English language ReferencedClassLibNeutralIsSatellite description 1.0.0" }; + yield return new object[] { "Default", "ReferencedClassLibNeutralIsSatellite.Program, ReferencedClassLibNeutralIsSatellite", "en-US", "English language ReferencedClassLibNeutralIsSatellite description 1.0.0" }; + yield return new object[] { "Default", "ReferencedClassLibNeutralIsSatellite.Program, ReferencedClassLibNeutralIsSatellite", "es", "Neutral (es) language ReferencedClassLibNeutralIsSatellite description 1.0.0" }; + yield return new object[] { "ReferencedClassLib", "ReferencedClassLib.Program, ReferencedClassLib", "", "Neutral language ReferencedClassLib description 1.0.0" }; + yield return new object[] { "ReferencedClassLib", "ReferencedClassLib.Program, ReferencedClassLib", "en", "English language ReferencedClassLib description 1.0.0" }; + yield return new object[] { "ReferencedClassLib", "ReferencedClassLib.Program, ReferencedClassLib", "en-US", "English language ReferencedClassLib description 1.0.0" }; + yield return new object[] { "ReferencedClassLib", "ReferencedClassLib.Program, ReferencedClassLib", "es", "Neutral language ReferencedClassLib description 1.0.0" }; + yield return new object[] { "ReferencedClassLibNeutralIsSatellite", "ReferencedClassLibNeutralIsSatellite.Program, ReferencedClassLibNeutralIsSatellite", "", "Neutral (es) language ReferencedClassLibNeutralIsSatellite description 1.0.0" }; + yield return new object[] { "ReferencedClassLibNeutralIsSatellite", "ReferencedClassLibNeutralIsSatellite.Program, ReferencedClassLibNeutralIsSatellite", "en", "English language ReferencedClassLibNeutralIsSatellite description 1.0.0" }; + yield return new object[] { "ReferencedClassLibNeutralIsSatellite", "ReferencedClassLibNeutralIsSatellite.Program, ReferencedClassLibNeutralIsSatellite", "en-US", "English language ReferencedClassLibNeutralIsSatellite description 1.0.0" }; + yield return new object[] { "ReferencedClassLibNeutralIsSatellite", "ReferencedClassLibNeutralIsSatellite.Program, ReferencedClassLibNeutralIsSatellite", "es", "Neutral (es) language ReferencedClassLibNeutralIsSatellite description 1.0.0" }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] + [MemberData(nameof(DescribeLib_TestData))] public void describeLib(string alc, string type, string culture, string expected) { string result = "Oops"; @@ -138,34 +156,40 @@ public void describeLib(string alc, string type, string culture, string expected } #endregion - [Theory] - [InlineData("Default", "System.Runtime.Loader.Tests", "en")] - [InlineData("Default", "System.Runtime.Loader.Tests", "es-MX")] - [InlineData("Empty", "System.Runtime.Loader.Tests", "en")] - [InlineData("Empty", "System.Runtime.Loader.Tests", "es-MX")] - [InlineData("ReferencedClassLib", "System.Runtime.Loader.Tests", "en")] - [InlineData("ReferencedClassLib", "System.Runtime.Loader.Tests", "es-MX")] - [InlineData("ReferencedClassLibNeutralIsSatellite", "System.Runtime.Loader.Tests", "en")] - [InlineData("ReferencedClassLibNeutralIsSatellite", "System.Runtime.Loader.Tests", "es-MX")] - [InlineData("SatelliteAssembliesTests", "System.Runtime.Loader.Tests", "en")] - [InlineData("SatelliteAssembliesTests", "System.Runtime.Loader.Tests", "es-MX")] - [InlineData("LoadFile", "System.Runtime.Loader.Tests", "en")] - [InlineData("LoadFile", "System.Runtime.Loader.Tests", "es-MX")] - [InlineData("Default", "ReferencedClassLib", "en")] - [InlineData("Default", "ReferencedClassLibNeutralIsSatellite", "en")] - [InlineData("Default", "ReferencedClassLibNeutralIsSatellite", "es")] - [InlineData("Empty", "ReferencedClassLib", "en")] - [InlineData("Empty", "ReferencedClassLibNeutralIsSatellite", "en")] - [InlineData("Empty", "ReferencedClassLibNeutralIsSatellite", "es")] - [InlineData("LoadFile", "ReferencedClassLib", "en")] - [InlineData("LoadFile", "ReferencedClassLibNeutralIsSatellite", "en")] - [InlineData("LoadFile", "ReferencedClassLibNeutralIsSatellite", "es")] - [InlineData("ReferencedClassLibNeutralIsSatellite", "ReferencedClassLib", "en")] - [InlineData("ReferencedClassLib", "ReferencedClassLibNeutralIsSatellite", "en")] - [InlineData("ReferencedClassLib", "ReferencedClassLibNeutralIsSatellite", "es")] - [InlineData("ReferencedClassLib", "ReferencedClassLib", "en")] - [InlineData("ReferencedClassLibNeutralIsSatellite", "ReferencedClassLibNeutralIsSatellite", "en")] - [InlineData("ReferencedClassLibNeutralIsSatellite", "ReferencedClassLibNeutralIsSatellite", "es")] + public static IEnumerable SatelliteLoadsCorrectly_TestData() + { + yield return new object[] { "Default", "System.Runtime.Loader.Tests", "en" }; + yield return new object[] { "Default", "System.Runtime.Loader.Tests", "es-MX" }; + yield return new object[] { "Empty", "System.Runtime.Loader.Tests", "en" }; + yield return new object[] { "Empty", "System.Runtime.Loader.Tests", "es-MX" }; + yield return new object[] { "ReferencedClassLib", "System.Runtime.Loader.Tests", "en" }; + yield return new object[] { "ReferencedClassLib", "System.Runtime.Loader.Tests", "es-MX" }; + yield return new object[] { "ReferencedClassLibNeutralIsSatellite", "System.Runtime.Loader.Tests", "en" }; + yield return new object[] { "ReferencedClassLibNeutralIsSatellite", "System.Runtime.Loader.Tests", "es-MX" }; + yield return new object[] { "SatelliteAssembliesTests", "System.Runtime.Loader.Tests", "en" }; + yield return new object[] { "SatelliteAssembliesTests", "System.Runtime.Loader.Tests", "es-MX" }; + yield return new object[] { "LoadFile", "System.Runtime.Loader.Tests", "en" }; + yield return new object[] { "LoadFile", "System.Runtime.Loader.Tests", "es-MX" }; + yield return new object[] { "Default", "ReferencedClassLib", "en" }; + yield return new object[] { "Default", "ReferencedClassLibNeutralIsSatellite", "en" }; + yield return new object[] { "Default", "ReferencedClassLibNeutralIsSatellite", "es" }; + yield return new object[] { "Empty", "ReferencedClassLib", "en" }; + yield return new object[] { "Empty", "ReferencedClassLibNeutralIsSatellite", "en" }; + yield return new object[] { "Empty", "ReferencedClassLibNeutralIsSatellite", "es" }; + yield return new object[] { "LoadFile", "ReferencedClassLib", "en" }; + yield return new object[] { "LoadFile", "ReferencedClassLibNeutralIsSatellite", "en" }; + yield return new object[] { "LoadFile", "ReferencedClassLibNeutralIsSatellite", "es" }; + yield return new object[] { "ReferencedClassLibNeutralIsSatellite", "ReferencedClassLib", "en" }; + yield return new object[] { "ReferencedClassLib", "ReferencedClassLibNeutralIsSatellite", "en" }; + yield return new object[] { "ReferencedClassLib", "ReferencedClassLibNeutralIsSatellite", "es" }; + yield return new object[] { "ReferencedClassLib", "ReferencedClassLib", "en" }; + yield return new object[] { "ReferencedClassLibNeutralIsSatellite", "ReferencedClassLibNeutralIsSatellite", "en" }; + yield return new object[] { "ReferencedClassLibNeutralIsSatellite", "ReferencedClassLibNeutralIsSatellite", "es" }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] + [MemberData(nameof(SatelliteLoadsCorrectly_TestData))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39379", TestPlatforms.Browser)] public void SatelliteLoadsCorrectly(string alc, string assemblyName, string culture) { AssemblyName satelliteAssemblyName = new AssemblyName(assemblyName + ".resources"); diff --git a/src/libraries/System.Runtime.Serialization.Formatters/ref/System.Runtime.Serialization.Formatters.cs b/src/libraries/System.Runtime.Serialization.Formatters/ref/System.Runtime.Serialization.Formatters.cs index 78cece9ec4fd..4681ba9721b7 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/ref/System.Runtime.Serialization.Formatters.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/ref/System.Runtime.Serialization.Formatters.cs @@ -15,9 +15,11 @@ protected Formatter() { } public abstract System.Runtime.Serialization.SerializationBinder? Binder { get; set; } public abstract System.Runtime.Serialization.StreamingContext Context { get; set; } public abstract System.Runtime.Serialization.ISurrogateSelector? SurrogateSelector { get; set; } + [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "MSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public abstract object Deserialize(System.IO.Stream serializationStream); protected virtual object? GetNext(out long objID) { throw null; } protected virtual long Schedule(object? obj) { throw null; } + [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "MSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public abstract void Serialize(System.IO.Stream serializationStream, object graph); protected abstract void WriteArray(object obj, string name, System.Type memberType); protected abstract void WriteBoolean(bool val, string name); @@ -85,7 +87,9 @@ public partial interface IFormatter System.Runtime.Serialization.SerializationBinder? Binder { get; set; } System.Runtime.Serialization.StreamingContext Context { get; set; } System.Runtime.Serialization.ISurrogateSelector? SurrogateSelector { get; set; } + [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "MSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] object Deserialize(System.IO.Stream serializationStream); + [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "MSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] void Serialize(System.IO.Stream serializationStream, object graph); } public partial interface ISerializationSurrogate @@ -179,7 +183,9 @@ public BinaryFormatter(System.Runtime.Serialization.ISurrogateSelector? selector public System.Runtime.Serialization.Formatters.TypeFilterLevel FilterLevel { get { throw null; } set { } } public System.Runtime.Serialization.ISurrogateSelector? SurrogateSelector { get { throw null; } set { } } public System.Runtime.Serialization.Formatters.FormatterTypeStyle TypeFormat { get { throw null; } set { } } + [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "MSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public object Deserialize(System.IO.Stream serializationStream) { throw null; } + [System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "MSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public void Serialize(System.IO.Stream serializationStream, object graph) { } } } diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/ILLink/ILLink.Substitutions.xml b/src/libraries/System.Runtime.Serialization.Formatters/src/ILLink/ILLink.Substitutions.xml new file mode 100644 index 000000000000..891fc4c11e4b --- /dev/null +++ b/src/libraries/System.Runtime.Serialization.Formatters/src/ILLink/ILLink.Substitutions.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/Resources/Strings.resx b/src/libraries/System.Runtime.Serialization.Formatters/src/Resources/Strings.resx index 078b0d67e059..db744f8c42ee 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/src/Resources/Strings.resx +++ b/src/libraries/System.Runtime.Serialization.Formatters/src/Resources/Strings.resx @@ -249,4 +249,7 @@ Unable to read beyond the end of the stream. + + BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information. + diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/System.Runtime.Serialization.Formatters.csproj b/src/libraries/System.Runtime.Serialization.Formatters/src/System.Runtime.Serialization.Formatters.csproj index e39003d146ac..9d66e0135880 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/src/System.Runtime.Serialization.Formatters.csproj +++ b/src/libraries/System.Runtime.Serialization.Formatters/src/System.Runtime.Serialization.Formatters.csproj @@ -2,9 +2,18 @@ System.Runtime.Serialization.Formatters System.Runtime.Serialization.Formatters - $(NetCoreAppCurrent) + $(NetCoreAppCurrent);$(NetCoreAppCurrent)-Browser enable + + $(NoWarn);CS0649 + + + $(MSBuildThisFileDirectory)ILLink\ + + + + @@ -14,9 +23,14 @@ + + + Common\System\LocalAppContextSwitches.Common.cs + + @@ -48,6 +62,8 @@ + + diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatter.cs b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatter.cs index fb744211f5c6..1fa2c68d14bc 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatter.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatter.cs @@ -20,6 +20,7 @@ protected Formatter() m_idGenerator = new ObjectIDGenerator(); } + [Obsolete(Obsoletions.InsecureSerializationMessage, DiagnosticId = Obsoletions.InsecureSerializationDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public abstract object Deserialize(Stream serializationStream); protected virtual object? GetNext(out long objID) @@ -59,6 +60,7 @@ protected virtual long Schedule(object? obj) return id; } + [Obsolete(Obsoletions.InsecureSerializationMessage, DiagnosticId = Obsoletions.InsecureSerializationDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public abstract void Serialize(Stream serializationStream, object graph); protected abstract void WriteArray(object obj, string name, Type memberType); diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.Core.cs b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.Core.cs new file mode 100644 index 000000000000..9183902f0d60 --- /dev/null +++ b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.Core.cs @@ -0,0 +1,82 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.IO; + +namespace System.Runtime.Serialization.Formatters.Binary +{ + public sealed partial class BinaryFormatter : IFormatter + { + [Obsolete(Obsoletions.InsecureSerializationMessage, DiagnosticId = Obsoletions.InsecureSerializationDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] + public object Deserialize(Stream serializationStream) + { + // don't refactor the 'throw' into a helper method; linker will have difficulty trimming + if (!LocalAppContextSwitches.BinaryFormatterEnabled) + { + throw new NotSupportedException(SR.BinaryFormatter_SerializationDisallowed); + } + + if (serializationStream == null) + { + throw new ArgumentNullException(nameof(serializationStream)); + } + if (serializationStream.CanSeek && (serializationStream.Length == 0)) + { + throw new SerializationException(SR.Serialization_Stream); + } + + var formatterEnums = new InternalFE() + { + _typeFormat = _typeFormat, + _serializerTypeEnum = InternalSerializerTypeE.Binary, + _assemblyFormat = _assemblyFormat, + _securityLevel = _securityLevel, + }; + + var reader = new ObjectReader(serializationStream, _surrogates, _context, formatterEnums, _binder) + { + _crossAppDomainArray = _crossAppDomainArray + }; + try + { + var parser = new BinaryParser(serializationStream, reader); + return reader.Deserialize(parser); + } + catch (SerializationException) + { + throw; + } + catch (Exception e) + { + throw new SerializationException(SR.Serialization_CorruptedStream, e); + } + } + + [Obsolete(Obsoletions.InsecureSerializationMessage, DiagnosticId = Obsoletions.InsecureSerializationDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] + public void Serialize(Stream serializationStream, object graph) + { + // don't refactor the 'throw' into a helper method; linker will have difficulty trimming + if (!LocalAppContextSwitches.BinaryFormatterEnabled) + { + throw new NotSupportedException(SR.BinaryFormatter_SerializationDisallowed); + } + + if (serializationStream == null) + { + throw new ArgumentNullException(nameof(serializationStream)); + } + + var formatterEnums = new InternalFE() + { + _typeFormat = _typeFormat, + _serializerTypeEnum = InternalSerializerTypeE.Binary, + _assemblyFormat = _assemblyFormat, + }; + + var sow = new ObjectWriter(_surrogates, _context, formatterEnums, _binder); + BinaryFormatterWriter binaryWriter = new BinaryFormatterWriter(serializationStream, sow, _typeFormat); + sow.Serialize(graph, binaryWriter); + _crossAppDomainArray = sow._crossAppDomainArray; + } + } +} diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.PlatformNotSupported.cs b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.PlatformNotSupported.cs new file mode 100644 index 000000000000..0a8bdd510a01 --- /dev/null +++ b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.PlatformNotSupported.cs @@ -0,0 +1,18 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.IO; + +namespace System.Runtime.Serialization.Formatters.Binary +{ + public sealed partial class BinaryFormatter : IFormatter + { + [Obsolete(Obsoletions.InsecureSerializationMessage, DiagnosticId = Obsoletions.InsecureSerializationDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] + public object Deserialize(Stream serializationStream) + => throw new PlatformNotSupportedException(SR.BinaryFormatter_SerializationDisallowed); + + [Obsolete(Obsoletions.InsecureSerializationMessage, DiagnosticId = Obsoletions.InsecureSerializationDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] + public void Serialize(Stream serializationStream, object graph) + => throw new PlatformNotSupportedException(SR.BinaryFormatter_SerializationDisallowed); + } +} diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.cs b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.cs index a44c8b692a45..59d2d519f42f 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.cs @@ -1,14 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.IO; using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Runtime.InteropServices; namespace System.Runtime.Serialization.Formatters.Binary { - public sealed class BinaryFormatter : IFormatter + public sealed partial class BinaryFormatter : IFormatter { private static readonly ConcurrentDictionary s_typeNameCache = new ConcurrentDictionary(); @@ -37,69 +34,6 @@ public BinaryFormatter(ISurrogateSelector? selector, StreamingContext context) _context = context; } - public object Deserialize(Stream serializationStream) => Deserialize(serializationStream, true); - - internal object Deserialize(Stream serializationStream, bool check) - { - if (serializationStream == null) - { - throw new ArgumentNullException(nameof(serializationStream)); - } - if (serializationStream.CanSeek && (serializationStream.Length == 0)) - { - throw new SerializationException(SR.Serialization_Stream); - } - - var formatterEnums = new InternalFE() - { - _typeFormat = _typeFormat, - _serializerTypeEnum = InternalSerializerTypeE.Binary, - _assemblyFormat = _assemblyFormat, - _securityLevel = _securityLevel, - }; - - var reader = new ObjectReader(serializationStream, _surrogates, _context, formatterEnums, _binder) - { - _crossAppDomainArray = _crossAppDomainArray - }; - try - { - var parser = new BinaryParser(serializationStream, reader); - return reader.Deserialize(parser, check); - } - catch (SerializationException) - { - throw; - } - catch (Exception e) - { - throw new SerializationException(SR.Serialization_CorruptedStream, e); - } - } - - public void Serialize(Stream serializationStream, object graph) => - Serialize(serializationStream, graph, true); - - internal void Serialize(Stream serializationStream, object graph, bool check) - { - if (serializationStream == null) - { - throw new ArgumentNullException(nameof(serializationStream)); - } - - var formatterEnums = new InternalFE() - { - _typeFormat = _typeFormat, - _serializerTypeEnum = InternalSerializerTypeE.Binary, - _assemblyFormat = _assemblyFormat, - }; - - var sow = new ObjectWriter(_surrogates, _context, formatterEnums, _binder); - BinaryFormatterWriter binaryWriter = new BinaryFormatterWriter(serializationStream, sow, _typeFormat); - sow.Serialize(graph, binaryWriter, check); - _crossAppDomainArray = sow._crossAppDomainArray; - } - internal static TypeInformation GetTypeInformation(Type type) => s_typeNameCache.GetOrAdd(type, t => { diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectReader.cs b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectReader.cs index 332db03043b3..cb1d8f45cd6b 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectReader.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectReader.cs @@ -74,7 +74,7 @@ internal ObjectReader(Stream stream, ISurrogateSelector? selector, StreamingCont _binder = binder; _formatterEnums = formatterEnums; } - internal object Deserialize(BinaryParser serParser, bool fCheck) + internal object Deserialize(BinaryParser serParser) { if (serParser == null) { diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectWriter.cs b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectWriter.cs index 2bde4e2f9e86..8ecc28256629 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectWriter.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectWriter.cs @@ -47,7 +47,7 @@ internal ObjectWriter(ISurrogateSelector? selector, StreamingContext context, In _objectManager = new SerializationObjectManager(context); } - internal void Serialize(object graph, BinaryFormatterWriter serWriter, bool fCheck) + internal void Serialize(object graph, BinaryFormatterWriter serWriter) { if (graph == null) { diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/IFormatter.cs b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/IFormatter.cs index 59c516c58f97..7fd7f9e3d478 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/IFormatter.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/IFormatter.cs @@ -7,7 +7,9 @@ namespace System.Runtime.Serialization { public interface IFormatter { + [Obsolete(Obsoletions.InsecureSerializationMessage, DiagnosticId = Obsoletions.InsecureSerializationDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] object Deserialize(Stream serializationStream); + [Obsolete(Obsoletions.InsecureSerializationMessage, DiagnosticId = Obsoletions.InsecureSerializationDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] void Serialize(Stream serializationStream, object graph); ISurrogateSelector? SurrogateSelector { get; set; } SerializationBinder? Binder { get; set; } diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/LocalAppContextSwitches.cs b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/LocalAppContextSwitches.cs new file mode 100644 index 000000000000..eead42d65a8c --- /dev/null +++ b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/LocalAppContextSwitches.cs @@ -0,0 +1,17 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +namespace System +{ + internal static partial class LocalAppContextSwitches + { + private static int s_binaryFormatterEnabled; + public static bool BinaryFormatterEnabled + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => GetCachedSwitchValue("System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization", ref s_binaryFormatterEnabled); + } + } +} diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Obsoletions.cs b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Obsoletions.cs new file mode 100644 index 000000000000..191d0fa071d9 --- /dev/null +++ b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Obsoletions.cs @@ -0,0 +1,13 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Runtime.Serialization +{ + internal static class Obsoletions + { + internal const string SharedUrlFormat = "https://aka.ms/dotnet-warnings/{0}"; + + internal const string InsecureSerializationMessage = "BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information."; + internal const string InsecureSerializationDiagId = "MSLIB0003"; + } +} diff --git a/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTests.cs b/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTests.cs index bdcf0e4f1a6d..8b5d1ab25bdd 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTests.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTests.cs @@ -18,6 +18,7 @@ namespace System.Runtime.Serialization.Formatters.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] public partial class BinaryFormatterTests : FileCleanupTestBase { // On 32-bit we can't test these high inputs as they cause OutOfMemoryExceptions. diff --git a/src/libraries/System.Runtime.Serialization.Formatters/tests/DisableBitTests.cs b/src/libraries/System.Runtime.Serialization.Formatters/tests/DisableBitTests.cs new file mode 100644 index 000000000000..331190767003 --- /dev/null +++ b/src/libraries/System.Runtime.Serialization.Formatters/tests/DisableBitTests.cs @@ -0,0 +1,60 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; +using Microsoft.DotNet.RemoteExecutor; +using Xunit; + +namespace System.Runtime.Serialization.Formatters.Tests +{ + public static class DisableBitTests + { + // these tests only make sense on platforms with both "feature switch" and RemoteExecutor support + public static bool ShouldRunFullFeatureSwitchEnablementChecks => !PlatformDetection.IsNetFramework && RemoteExecutor.IsSupported; + + // determines whether BinaryFormatter will always fail, regardless of config, on this platform + public static bool IsBinaryFormatterSuppressedOnThisPlatform => !PlatformDetection.IsBinaryFormatterSupported; + + private const string EnableBinaryFormatterSwitchName = "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization"; + private const string MoreInfoUrl = "https://aka.ms/binaryformatter"; + + [ConditionalFact(nameof(IsBinaryFormatterSuppressedOnThisPlatform))] + public static void DisabledAlwaysInBrowser() + { + // First, test serialization + + MemoryStream ms = new MemoryStream(); + BinaryFormatter bf = new BinaryFormatter(); + var ex = Assert.Throws(() => bf.Serialize(ms, "A string to serialize.")); + Assert.Contains(MoreInfoUrl, ex.Message, StringComparison.Ordinal); // error message should link to the more info URL + + // Then test deserialization + + ex = Assert.Throws(() => bf.Deserialize(ms)); + Assert.Contains(MoreInfoUrl, ex.Message, StringComparison.Ordinal); // error message should link to the more info URL + } + + [ConditionalFact(nameof(ShouldRunFullFeatureSwitchEnablementChecks))] + public static void DisabledThroughFeatureSwitch() + { + RemoteInvokeOptions options = new RemoteInvokeOptions(); + options.RuntimeConfigurationOptions[EnableBinaryFormatterSwitchName] = bool.FalseString; + + RemoteExecutor.Invoke(() => + { + // First, test serialization + + MemoryStream ms = new MemoryStream(); + BinaryFormatter bf = new BinaryFormatter(); + var ex = Assert.Throws(() => bf.Serialize(ms, "A string to serialize.")); + Assert.Contains(MoreInfoUrl, ex.Message, StringComparison.Ordinal); // error message should link to the more info URL + + // Then test deserialization + + ex = Assert.Throws(() => bf.Deserialize(ms)); + Assert.Contains(MoreInfoUrl, ex.Message, StringComparison.Ordinal); // error message should link to the more info URL + }, options).Dispose(); + } + } +} diff --git a/src/libraries/System.Runtime.Serialization.Formatters/tests/FormatterTests.cs b/src/libraries/System.Runtime.Serialization.Formatters/tests/FormatterTests.cs index eb06d7582efd..68ca34ee79d6 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/tests/FormatterTests.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/tests/FormatterTests.cs @@ -140,8 +140,10 @@ private sealed class TestFormatter : Formatter public override SerializationBinder Binder { get; set; } public override StreamingContext Context { get; set; } public override ISurrogateSelector SurrogateSelector { get; set; } +#pragma warning disable CS0672 // Member overrides obsolete member public override object Deserialize(Stream serializationStream) => null; public override void Serialize(Stream serializationStream, object graph) { } +#pragma warning restore CS0672 // Member overrides obsolete member } } } diff --git a/src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationBinderTests.cs b/src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationBinderTests.cs index 91201a4985e3..daf11b1f6867 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationBinderTests.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationBinderTests.cs @@ -21,7 +21,7 @@ public void BindToName_NullDefaults() Assert.Null(typeName); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] public void BindToType_AllValuesTracked() { var s = new MemoryStream(); diff --git a/src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationGuardTests.cs b/src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationGuardTests.cs index f0d3e9aaf3da..1d106217c0d7 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationGuardTests.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationGuardTests.cs @@ -12,6 +12,7 @@ namespace System.Runtime.Serialization.Formatters.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] public static class SerializationGuardTests { [Fact] diff --git a/src/libraries/System.Runtime.Serialization.Formatters/tests/System.Runtime.Serialization.Formatters.Tests.csproj b/src/libraries/System.Runtime.Serialization.Formatters/tests/System.Runtime.Serialization.Formatters.Tests.csproj index ff7628e9ebc6..635709d50421 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/tests/System.Runtime.Serialization.Formatters.Tests.csproj +++ b/src/libraries/System.Runtime.Serialization.Formatters/tests/System.Runtime.Serialization.Formatters.Tests.csproj @@ -7,6 +7,7 @@ + diff --git a/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs b/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs index d7ae52386523..87cd3085c99e 100644 --- a/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs +++ b/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs @@ -2559,7 +2559,7 @@ public static void DCJS_VerifyDateTimeForFormatStringDCJsonSerSetting() Assert.Equal(value, actual); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public static void DCJS_VerifyDateTimeForFormatStringDCJsonSerSettings() { var jsonTypes = new JsonTypes(); @@ -2619,7 +2619,7 @@ public static void DCJS_VerifyDateTimeForFormatStringDCJsonSerSettings() Assert.True(actual6 == dateTime); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public static void DCJS_VerifyDateTimeForDateTimeFormat() { var jsonTypes = new JsonTypes(); diff --git a/src/libraries/System.Runtime.Serialization.Primitives/tests/System/Runtime/Serialization/InvalidDataContractExceptionTests.cs b/src/libraries/System.Runtime.Serialization.Primitives/tests/System/Runtime/Serialization/InvalidDataContractExceptionTests.cs index 47f52e9f58d7..57a4d5ac54f4 100644 --- a/src/libraries/System.Runtime.Serialization.Primitives/tests/System/Runtime/Serialization/InvalidDataContractExceptionTests.cs +++ b/src/libraries/System.Runtime.Serialization.Primitives/tests/System/Runtime/Serialization/InvalidDataContractExceptionTests.cs @@ -36,7 +36,7 @@ public void Ctor_String_Exception(string message) Assert.Equal(innerException, exception.InnerException); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] public void Ctor_SerializationInfo_StreamingContext() { using (var memoryStream = new MemoryStream()) diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index 0baf6400f827..b5fb7114e9b1 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -1808,12 +1808,16 @@ protected Enum() { } public static string Format(System.Type enumType, object value, string format) { throw null; } public override int GetHashCode() { throw null; } public static string? GetName(System.Type enumType, object value) { throw null; } + public static string? GetName(TEnum value) where TEnum : struct, System.Enum { throw null; } public static string[] GetNames(System.Type enumType) { throw null; } + public static string[] GetNames() where TEnum: struct, System.Enum { throw null; } public System.TypeCode GetTypeCode() { throw null; } public static System.Type GetUnderlyingType(System.Type enumType) { throw null; } public static System.Array GetValues(System.Type enumType) { throw null; } + public static TEnum[] GetValues() where TEnum : struct, System.Enum { throw null; } public bool HasFlag(System.Enum flag) { throw null; } public static bool IsDefined(System.Type enumType, object value) { throw null; } + public static bool IsDefined(TEnum value) where TEnum : struct, System.Enum { throw null; } public static object Parse(System.Type enumType, string value) { throw null; } public static object Parse(System.Type enumType, string value, bool ignoreCase) { throw null; } public static TEnum Parse(string value) where TEnum : struct { throw null; } @@ -4654,7 +4658,7 @@ protected void GetObjectData(System.Runtime.Serialization.SerializationInfo seri [System.ObsoleteAttribute("The method has been deprecated. It is not used by the system. https://go.microsoft.com/fwlink/?linkid=14202")] protected virtual bool IsReservedCharacter(char character) { throw null; } public bool IsWellFormedOriginalString() { throw null; } - public static bool IsWellFormedUriString([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] string? uriString, System.UriKind uriKind) { throw null; } + public static bool IsWellFormedUriString([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? uriString, System.UriKind uriKind) { throw null; } [System.ObsoleteAttribute("The method has been deprecated. Please use MakeRelativeUri(Uri uri). https://go.microsoft.com/fwlink/?linkid=14202")] public string MakeRelative(System.Uri toUri) { throw null; } public System.Uri MakeRelativeUri(System.Uri uri) { throw null; } @@ -5720,8 +5724,9 @@ public DebuggerStepThroughAttribute() { } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Struct, AllowMultiple=true)] public sealed partial class DebuggerTypeProxyAttribute : System.Attribute { - public DebuggerTypeProxyAttribute(string typeName) { } - public DebuggerTypeProxyAttribute(System.Type type) { } + public DebuggerTypeProxyAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] string typeName) { } + public DebuggerTypeProxyAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type type) { } + [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] public string ProxyTypeName { get { throw null; } } public System.Type? Target { get { throw null; } set { } } public string? TargetTypeName { get { throw null; } set { } } @@ -9919,12 +9924,12 @@ public FrameworkName(string identifier, System.Version version, string? profile) public static bool operator !=(System.Runtime.Versioning.FrameworkName? left, System.Runtime.Versioning.FrameworkName? right) { throw null; } public override string ToString() { throw null; } } - [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple = true, Inherited = false)] + [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple = true, Inherited = false)] public sealed class MinimumOSPlatformAttribute : System.Runtime.Versioning.OSPlatformAttribute { public MinimumOSPlatformAttribute(string platformName) : base(platformName) { } } - [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple = true, Inherited = false)] + [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple = true, Inherited = false)] public sealed class ObsoletedInOSPlatformAttribute : System.Runtime.Versioning.OSPlatformAttribute { public ObsoletedInOSPlatformAttribute(string platformName) : base(platformName) { } @@ -9937,7 +9942,7 @@ public abstract class OSPlatformAttribute : System.Attribute private protected OSPlatformAttribute(string platformName) { } public string PlatformName { get; } } - [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple = true, Inherited = false)] + [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple = true, Inherited = false)] public sealed class RemovedInOSPlatformAttribute : System.Runtime.Versioning.OSPlatformAttribute { public RemovedInOSPlatformAttribute(string platformName) : base(platformName) { } diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj b/src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj index e58be38fd742..39ca7313460b 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj @@ -1,7 +1,7 @@ true - 1718 + $(NoWarn),1718 true true $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser diff --git a/src/libraries/System.Runtime/tests/System/ActivatorTests.cs b/src/libraries/System.Runtime/tests/System/ActivatorTests.cs index 8a92b10e7a60..05e07447a961 100644 --- a/src/libraries/System.Runtime/tests/System/ActivatorTests.cs +++ b/src/libraries/System.Runtime/tests/System/ActivatorTests.cs @@ -619,7 +619,7 @@ public void CreateInstance_PublicOnlyValueTypeWithPrivateDefaultConstructor_Thro } [Theory] - [ActiveIssue("https://github.com/dotnet/runtime/issues/34030", TestPlatforms.Linux, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/34030", TestPlatforms.Linux | TestPlatforms.Browser, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] [MemberData(nameof(TestingCreateInstanceFromObjectHandleData))] public static void TestingCreateInstanceFromObjectHandle(string physicalFileName, string assemblyFile, string type, string returnedFullNameType, Type exceptionType) { @@ -717,7 +717,7 @@ public static void TestingCreateInstanceObjectHandle(string assemblyName, string }; [Theory] - [ActiveIssue("https://github.com/dotnet/runtime/issues/34030", TestPlatforms.Linux, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/34030", TestPlatforms.Linux | TestPlatforms.Browser, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] [MemberData(nameof(TestingCreateInstanceFromObjectHandleFullSignatureData))] public static void TestingCreateInstanceFromObjectHandleFullSignature(string physicalFileName, string assemblyFile, string type, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes, string returnedFullNameType) { diff --git a/src/libraries/System.Runtime/tests/System/ArgIteratorTests.cs b/src/libraries/System.Runtime/tests/System/ArgIteratorTests.cs index 29baaf32646f..e194f4db7e04 100644 --- a/src/libraries/System.Runtime/tests/System/ArgIteratorTests.cs +++ b/src/libraries/System.Runtime/tests/System/ArgIteratorTests.cs @@ -9,6 +9,7 @@ namespace System.Tests { public static class ArgIteratorTests { + [ActiveIssue("https://github.com/dotnet/runtime/issues/39343", TestPlatforms.Browser)] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsArgIteratorSupported))] public static void ArgIterator_GetRemainingCount_GetNextArg() { diff --git a/src/libraries/System.Runtime/tests/System/ArrayTests.cs b/src/libraries/System.Runtime/tests/System/ArrayTests.cs index ba11f872ab63..bb83cb5e1139 100644 --- a/src/libraries/System.Runtime/tests/System/ArrayTests.cs +++ b/src/libraries/System.Runtime/tests/System/ArrayTests.cs @@ -1777,11 +1777,22 @@ public static unsafe IEnumerable CreateInstance_TestData() new object[] { typeof(IntPtr), default(IntPtr) }, new object[] { typeof(UIntPtr), default(UIntPtr) }, + // Primitives enums + new object[] { typeof(SByteEnum), default(SByteEnum) }, + new object[] { typeof(ByteEnum), default(ByteEnum) }, + new object[] { typeof(Int16Enum), default(Int16Enum) }, + new object[] { typeof(UInt16Enum), default(UInt16Enum) }, + new object[] { typeof(Int32Enum), default(Int32Enum) }, + new object[] { typeof(UInt32Enum), default(UInt32Enum) }, + new object[] { typeof(Int64Enum), default(Int64Enum) }, + new object[] { typeof(UInt64Enum), default(UInt64Enum) }, + // Array, pointers new object[] { typeof(int[]), default(int[]) }, + new object[] { typeof(string[]), default(string[]) }, new object[] { typeof(int*), null }, - // Classes, structs, interfaces, enums + // Classes, structs, interface new object[] { typeof(NonGenericClass1), default(NonGenericClass1) }, new object[] { typeof(GenericClass), default(GenericClass) }, new object[] { typeof(NonGenericStruct), default(NonGenericStruct) }, @@ -1790,7 +1801,6 @@ public static unsafe IEnumerable CreateInstance_TestData() new object[] { typeof(GenericInterface), default(GenericInterface) }, new object[] { typeof(AbstractClass), default(AbstractClass) }, new object[] { typeof(StaticClass), default(StaticClass) }, - new object[] { typeof(Int32Enum), default(Int32Enum) } }; } @@ -1871,6 +1881,10 @@ public static IEnumerable CreateInstance_NotSupportedType_TestData() yield return new object[] { typeof(GenericClass<>) }; yield return new object[] { typeof(GenericClass<>).MakeGenericType(typeof(GenericClass<>)) }; yield return new object[] { typeof(GenericClass<>).GetTypeInfo().GetGenericArguments()[0] }; + yield return new object[] { typeof(TypedReference) }; + yield return new object[] { typeof(ArgIterator) }; + yield return new object[] { typeof(RuntimeArgumentHandle) }; + yield return new object[] { typeof(Span) }; } [Theory] @@ -1885,6 +1899,21 @@ public void CreateInstance_NotSupportedType_ThrowsNotSupportedException(Type ele Assert.Throws(() => Array.CreateInstance(elementType, new int[1], new int[1])); } + [Fact] + public void CreateInstance_TypeNotRuntimeType_ThrowsArgumentException() + { + // This cannot be a [Theory] due to https://github.com/xunit/xunit/issues/1325. + foreach (Type elementType in Helpers.NonRuntimeTypes) + { + AssertExtensions.Throws("elementType", () => Array.CreateInstance(elementType, 1)); + AssertExtensions.Throws("elementType", () => Array.CreateInstance(elementType, 1, 1)); + AssertExtensions.Throws("elementType", () => Array.CreateInstance(elementType, 1, 1, 1)); + AssertExtensions.Throws("elementType", () => Array.CreateInstance(elementType, new int[1])); + AssertExtensions.Throws("elementType", () => Array.CreateInstance(elementType, new long[1])); + AssertExtensions.Throws("elementType", () => Array.CreateInstance(elementType, new int[1], new int[1])); + } + } + [Fact] public void CreateInstance_NegativeLength_ThrowsArgumentOutOfRangeException() { @@ -1948,6 +1977,18 @@ public void CreateInstance_LengthsAndLowerBoundsHaveDifferentLengths_ThrowsArgum AssertExtensions.Throws(null, () => Array.CreateInstance(typeof(int), new int[1], new int[length])); } + [Theory] + [InlineData(33)] + [InlineData(256)] + [InlineData(257)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39002", TestRuntimes.Mono)] + public void CreateInstance_RankMoreThanMaxRank_ThrowsTypeLoadException(int length) + { + var lengths = new int[length]; + var lowerBounds = new int[length]; + Assert.Throws(() => Array.CreateInstance(typeof(int), lengths, lowerBounds)); + } + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNonZeroLowerBoundArraySupported))] public void CreateInstance_Type_LengthsPlusLowerBoundOverflows_ThrowsArgumentOutOfRangeException() { @@ -4280,21 +4321,6 @@ public static void Reverse_NonSZArrayWithMinValueLowerBound() Reverse(array, int.MinValue, 2, new int[] { 2, 1, 3 }); } - [Fact] - public void CreateInstance_TypeNotRuntimeType_ThrowsArgumentException() - { - // This cannot be a [Theory] due to https://github.com/xunit/xunit/issues/1325. - foreach (Type elementType in Helpers.NonRuntimeTypes) - { - AssertExtensions.Throws("elementType", () => Array.CreateInstance(elementType, 1)); - AssertExtensions.Throws("elementType", () => Array.CreateInstance(elementType, 1, 1)); - AssertExtensions.Throws("elementType", () => Array.CreateInstance(elementType, 1, 1, 1)); - AssertExtensions.Throws("elementType", () => Array.CreateInstance(elementType, new int[1])); - AssertExtensions.Throws("elementType", () => Array.CreateInstance(elementType, new long[1])); - AssertExtensions.Throws("elementType", () => Array.CreateInstance(elementType, new int[1], new int[1])); - } - } - private static void VerifyArray(Array array, Type elementType, int[] lengths, int[] lowerBounds, object repeatedValue) { VerifyArray(array, elementType, lengths, lowerBounds); diff --git a/src/libraries/System.Runtime/tests/System/CharTests.cs b/src/libraries/System.Runtime/tests/System/CharTests.cs index cb8fb0394c3b..c8a14438e38e 100644 --- a/src/libraries/System.Runtime/tests/System/CharTests.cs +++ b/src/libraries/System.Runtime/tests/System/CharTests.cs @@ -942,16 +942,28 @@ private static IEnumerable GetTestChars(params UnicodeCategory[] categorie { for (int i = 0; i < categories.Length; i++) { - char[] latinSet = s_latinTestSet[(int)categories[i]]; + UnicodeCategory category = categories[i]; + char[] latinSet = s_latinTestSet[(int)category]; for (int j = 0; j < latinSet.Length; j++) - yield return latinSet[j]; + if (ShouldTestCasingForChar(latinSet[j], category)) + yield return latinSet[j]; - char[] unicodeSet = s_unicodeTestSet[(int)categories[i]]; + char[] unicodeSet = s_unicodeTestSet[(int)category]; for (int k = 0; k < unicodeSet.Length; k++) - yield return unicodeSet[k]; + if (ShouldTestCasingForChar(unicodeSet[k], category)) + yield return unicodeSet[k]; } } + private static bool ShouldTestCasingForChar(char ch, UnicodeCategory category) + { + return PlatformDetection.IsNotInvariantGlobalization || + (category != UnicodeCategory.UppercaseLetter && + category != UnicodeCategory.LowercaseLetter) || + ch >= 'a' && ch <= 'z' || + ch >= 'A' && ch <= 'Z'; + } + private static char[][] s_latinTestSet = new char[][] { new char[] {'\u0047','\u004c','\u0051','\u0056','\u00c0','\u00c5','\u00ca','\u00cf','\u00d4','\u00da'}, // UnicodeCategory.UppercaseLetter @@ -1063,11 +1075,15 @@ private static IEnumerable GetTestChars(params UnicodeCategory[] categorie public static IEnumerable UpperLowerCasing_TestData() { // lower upper Culture - yield return new object[] { 'a', 'A', "en-US" }; - yield return new object[] { 'i', 'I', "en-US" }; - yield return new object[] { '\u0131', 'I', "tr-TR" }; - yield return new object[] { 'i', '\u0130', "tr-TR" }; - yield return new object[] { '\u0660', '\u0660', "en-US" }; + yield return new object[] { 'a', 'A', "en-US" }; + yield return new object[] { 'i', 'I', "en-US" }; + + if (PlatformDetection.IsNotInvariantGlobalization) + { + yield return new object[] { '\u0131', 'I', "tr-TR" }; + yield return new object[] { 'i', '\u0130', "tr-TR" }; + yield return new object[] { '\u0660', '\u0660', "en-US" }; + } } [Fact] @@ -1076,7 +1092,7 @@ public static void LatinRangeTest() StringBuilder sb = new StringBuilder(256); string latineString = sb.ToString(); - for (int i=0; i < latineString.Length; i++) + for (int i = 0; i < latineString.Length; i++) { Assert.Equal(s_categoryForLatin1[i], char.GetUnicodeCategory(latineString[i])); Assert.Equal(s_categoryForLatin1[i], char.GetUnicodeCategory(latineString, i)); @@ -1086,14 +1102,14 @@ public static void LatinRangeTest() [Fact] public static void NonLatinRangeTest() { - for (int i=256; i <= 0xFFFF; i++) + for (int i = 256; i <= 0xFFFF; i++) { Assert.Equal(CharUnicodeInfo.GetUnicodeCategory((char)i), char.GetUnicodeCategory((char)i)); } string nonLatinString = "\u0100\u0200\u0300\u0400\u0500\u0600\u0700\u0800\u0900\u0A00\u0B00\u0C00\u0D00\u0E00\u0F00" + "\u1000\u2000\u3000\u4000\u5000\u6000\u7000\u8000\u9000\uA000\uB000\uC000\uD000\uE000\uF000"; - for (int i=0; i < nonLatinString.Length; i++) + for (int i = 0; i < nonLatinString.Length; i++) { Assert.Equal(CharUnicodeInfo.GetUnicodeCategory(nonLatinString[i]), char.GetUnicodeCategory(nonLatinString, i)); } diff --git a/src/libraries/System.Runtime/tests/System/DateTimeOffsetTests.cs b/src/libraries/System.Runtime/tests/System/DateTimeOffsetTests.cs index 950a2860ed32..940704fa9a04 100644 --- a/src/libraries/System.Runtime/tests/System/DateTimeOffsetTests.cs +++ b/src/libraries/System.Runtime/tests/System/DateTimeOffsetTests.cs @@ -1238,15 +1238,18 @@ public static IEnumerable ToString_MatchesExpected_MemberData() yield return new object[] { new DateTimeOffset(1617181518122280616, TimeSpan.FromSeconds(26280)), "O", null, "5125-08-24T20:50:12.2280616+07:18" }; // Year patterns - var enUS = new CultureInfo("en-US"); var thTH = new CultureInfo("th-TH"); yield return new object[] { new DateTimeOffset(new DateTime(1234, 5, 6)), "yy", enUS, "34" }; - yield return new object[] { DateTimeOffset.MaxValue, "yy", thTH, "42" }; + if (PlatformDetection.IsNotInvariantGlobalization) + yield return new object[] { DateTimeOffset.MaxValue, "yy", thTH, "42" }; + for (int i = 3; i < 20; i++) { yield return new object[] { new DateTimeOffset(new DateTime(1234, 5, 6)), new string('y', i), enUS, 1234.ToString("D" + i) }; - yield return new object[] { DateTimeOffset.MaxValue, new string('y', i), thTH, 10542.ToString("D" + i) }; + + if (PlatformDetection.IsNotInvariantGlobalization) + yield return new object[] { DateTimeOffset.MaxValue, new string('y', i), thTH, 10542.ToString("D" + i) }; } } @@ -1268,7 +1271,7 @@ public static IEnumerable ToString_WithCulture_MatchesExpected_MemberD yield return new object[] { new DateTimeOffset(636572516255571994, TimeSpan.FromHours(-5)), "Y", new CultureInfo("da-DK"), "marts 2018" }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(ToString_WithCulture_MatchesExpected_MemberData))] public static void ToString_WithCulture_MatchesExpected(DateTimeOffset dateTimeOffset, string format, CultureInfo culture, string expected) { @@ -1349,7 +1352,7 @@ public static void TryFormat_ToString_EqualResults() Assert.Equal(0, actual[actual.Length - 1]); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(ToString_MatchesExpected_MemberData))] public static void TryFormat_MatchesExpected(DateTimeOffset dateTimeOffset, string format, IFormatProvider provider, string expected) { diff --git a/src/libraries/System.Runtime/tests/System/DateTimeTests.cs b/src/libraries/System.Runtime/tests/System/DateTimeTests.cs index b7951f378725..09aacebf83d0 100644 --- a/src/libraries/System.Runtime/tests/System/DateTimeTests.cs +++ b/src/libraries/System.Runtime/tests/System/DateTimeTests.cs @@ -1711,13 +1711,16 @@ public static IEnumerable Parse_ValidInput_Succeeds_MemberData() yield return new object[] { "2 2 2Z", CultureInfo.InvariantCulture, TimeZoneInfo.ConvertTimeFromUtc(new DateTime(2002, 2, 2, 0, 0, 0, DateTimeKind.Utc), TimeZoneInfo.Local) }; yield return new object[] { "#10/10/2095#\0", CultureInfo.InvariantCulture, new DateTime(2095, 10, 10, 0, 0, 0) }; - DateTime today = DateTime.Today; - var hebrewCulture = new CultureInfo("he-IL"); - hebrewCulture.DateTimeFormat.Calendar = new HebrewCalendar(); - yield return new object[] { today.ToString(hebrewCulture), hebrewCulture, today }; + if (PlatformDetection.IsNotInvariantGlobalization) + { + DateTime today = DateTime.Today; + var hebrewCulture = new CultureInfo("he-IL"); + hebrewCulture.DateTimeFormat.Calendar = new HebrewCalendar(); + yield return new object[] { today.ToString(hebrewCulture), hebrewCulture, today }; - var mongolianCulture = new CultureInfo("mn-MN"); - yield return new object[] { today.ToString(mongolianCulture), mongolianCulture, today }; + var mongolianCulture = new CultureInfo("mn-MN"); + yield return new object[] { today.ToString(mongolianCulture), mongolianCulture, today }; + } } [Theory] @@ -1832,12 +1835,15 @@ public static IEnumerable ParseExact_ValidInput_Succeeds_MemberData() yield return new object[] { " 9 / 8 / 2017 10 : 11 : 12 AM", "M/d/yyyy HH':'mm':'ss tt\' \'", CultureInfo.InvariantCulture, DateTimeStyles.AllowWhiteSpaces, new DateTime(2017, 9, 8, 10, 11, 12) }; yield return new object[] { " 9 / 8 / 2017 10 : 11 : 12 AM", "M/d/yyyy HH':'mm':'ss tt\' \'", CultureInfo.InvariantCulture, DateTimeStyles.AllowWhiteSpaces, new DateTime(2017, 9, 8, 10, 11, 12) }; - var hebrewCulture = new CultureInfo("he-IL"); - hebrewCulture.DateTimeFormat.Calendar = new HebrewCalendar(); - DateTime today = DateTime.Today; - foreach (string pattern in hebrewCulture.DateTimeFormat.GetAllDateTimePatterns()) + if (PlatformDetection.IsNotInvariantGlobalization) { - yield return new object[] { today.ToString(pattern, hebrewCulture), pattern, hebrewCulture, DateTimeStyles.None, null }; + var hebrewCulture = new CultureInfo("he-IL"); + hebrewCulture.DateTimeFormat.Calendar = new HebrewCalendar(); + DateTime today = DateTime.Today; + foreach (string pattern in hebrewCulture.DateTimeFormat.GetAllDateTimePatterns()) + { + yield return new object[] { today.ToString(pattern, hebrewCulture), pattern, hebrewCulture, DateTimeStyles.None, null }; + } } } @@ -2004,15 +2010,27 @@ public static IEnumerable ToString_MatchesExpected_MemberData() yield return new object[] { new DateTime(221550163152616218, DateTimeKind.Utc), "r", null, "Sun, 25 Jan 0703 19:11:55 GMT" }; // Year patterns - - var enUS = new CultureInfo("en-US"); - var thTH = new CultureInfo("th-TH"); - yield return new object[] { new DateTime(1234, 5, 6), "yy", enUS, "34" }; - yield return new object[] { DateTime.MaxValue, "yy", thTH, "42" }; - for (int i = 3; i < 20; i++) + if (PlatformDetection.IsNotInvariantGlobalization) + { + var enUS = new CultureInfo("en-US"); + var thTH = new CultureInfo("th-TH"); + yield return new object[] { new DateTime(1234, 5, 6), "yy", enUS, "34" }; + yield return new object[] { DateTime.MaxValue, "yy", thTH, "42" }; + for (int i = 3; i < 20; i++) + { + yield return new object[] { new DateTime(1234, 5, 6), new string('y', i), enUS, 1234.ToString("D" + i) }; + yield return new object[] { DateTime.MaxValue, new string('y', i), thTH, 10542.ToString("D" + i) }; + } + } + else { - yield return new object[] { new DateTime(1234, 5, 6), new string('y', i), enUS, 1234.ToString("D" + i) }; - yield return new object[] { DateTime.MaxValue, new string('y', i), thTH, 10542.ToString("D" + i) }; + var invariant = new CultureInfo(""); + yield return new object[] { new DateTime(1234, 5, 6), "yy", invariant, "34" }; + + for (int i = 3; i < 20; i++) + { + yield return new object[] { new DateTime(1234, 5, 6), new string('y', i), invariant, 1234.ToString("D" + i) }; + } } } @@ -2299,7 +2317,7 @@ public static void TryFormat_MatchesToString(string format) Assert.Equal(0, dest[dest.Length - 1]); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] [MemberData(nameof(ToString_MatchesExpected_MemberData))] public static void TryFormat_MatchesExpected(DateTime dateTime, string format, IFormatProvider provider, string expected) { diff --git a/src/libraries/System.Runtime/tests/System/EnumTests.cs b/src/libraries/System.Runtime/tests/System/EnumTests.cs index 33b5f3d233b7..3f62f2341233 100644 --- a/src/libraries/System.Runtime/tests/System/EnumTests.cs +++ b/src/libraries/System.Runtime/tests/System/EnumTests.cs @@ -261,120 +261,198 @@ private static void Parse_Generic_Invalid(Type enumType, string value, bool i } } - public static IEnumerable GetName_TestData() + [Theory] + [InlineData(SByteEnum.Min, "Min")] + [InlineData(SByteEnum.One, "One")] + [InlineData(SByteEnum.Two, "Two")] + [InlineData(SByteEnum.Max, "Max")] + [InlineData(sbyte.MinValue, "Min")] + [InlineData((sbyte)1, "One")] + [InlineData((sbyte)2, "Two")] + [InlineData(sbyte.MaxValue, "Max")] + [InlineData((sbyte)3, null)] + public void GetName_InvokeSByteEnum_ReturnsExpected(object value, string expected) { - // SByte - yield return new object[] { typeof(SByteEnum), SByteEnum.Min, "Min" }; - yield return new object[] { typeof(SByteEnum), SByteEnum.One, "One" }; - yield return new object[] { typeof(SByteEnum), SByteEnum.Two, "Two" }; - yield return new object[] { typeof(SByteEnum), SByteEnum.Max, "Max" }; - yield return new object[] { typeof(SByteEnum), sbyte.MinValue, "Min" }; - yield return new object[] { typeof(SByteEnum), (sbyte)1, "One" }; - yield return new object[] { typeof(SByteEnum), (sbyte)2, "Two" }; - yield return new object[] { typeof(SByteEnum), sbyte.MaxValue, "Max" }; - yield return new object[] { typeof(SByteEnum), (sbyte)3, null }; - - // Byte - yield return new object[] { typeof(ByteEnum), ByteEnum.Min, "Min" }; - yield return new object[] { typeof(ByteEnum), ByteEnum.One, "One" }; - yield return new object[] { typeof(ByteEnum), ByteEnum.Two, "Two" }; - yield return new object[] { typeof(ByteEnum), ByteEnum.Max, "Max" }; - yield return new object[] { typeof(ByteEnum), byte.MinValue, "Min" }; - yield return new object[] { typeof(ByteEnum), (byte)1, "One" }; - yield return new object[] { typeof(ByteEnum), (byte)2, "Two" }; - yield return new object[] { typeof(ByteEnum), byte.MaxValue, "Max" }; - yield return new object[] { typeof(ByteEnum), (byte)3, null }; - - // Int16 - yield return new object[] { typeof(Int16Enum), Int16Enum.Min, "Min" }; - yield return new object[] { typeof(Int16Enum), Int16Enum.One, "One" }; - yield return new object[] { typeof(Int16Enum), Int16Enum.Two, "Two" }; - yield return new object[] { typeof(Int16Enum), Int16Enum.Max, "Max" }; - yield return new object[] { typeof(Int16Enum), short.MinValue, "Min" }; - yield return new object[] { typeof(Int16Enum), (short)1, "One" }; - yield return new object[] { typeof(Int16Enum), (short)2, "Two" }; - yield return new object[] { typeof(Int16Enum), short.MaxValue, "Max" }; - yield return new object[] { typeof(Int16Enum), (short)3, null }; - - // UInt16 - yield return new object[] { typeof(UInt16Enum), UInt16Enum.Min, "Min" }; - yield return new object[] { typeof(UInt16Enum), UInt16Enum.One, "One" }; - yield return new object[] { typeof(UInt16Enum), UInt16Enum.Two, "Two" }; - yield return new object[] { typeof(UInt16Enum), UInt16Enum.Max, "Max" }; - yield return new object[] { typeof(UInt16Enum), ushort.MinValue, "Min" }; - yield return new object[] { typeof(UInt16Enum), (ushort)1, "One" }; - yield return new object[] { typeof(UInt16Enum), (ushort)2, "Two" }; - yield return new object[] { typeof(UInt16Enum), ushort.MaxValue, "Max" }; - yield return new object[] { typeof(UInt16Enum), (ushort)3, null }; + TestGetName(typeof(SByteEnum), value, expected); + if (!(value is SByteEnum enumValue)) + { + enumValue = (SByteEnum)(sbyte)value; + } + Assert.Equal(expected, Enum.GetName(enumValue)); + } - // Int32 - yield return new object[] { typeof(Int32Enum), Int32Enum.Min, "Min" }; - yield return new object[] { typeof(Int32Enum), Int32Enum.One, "One" }; - yield return new object[] { typeof(Int32Enum), Int32Enum.Two, "Two" }; - yield return new object[] { typeof(Int32Enum), Int32Enum.Max, "Max" }; - yield return new object[] { typeof(Int32Enum), int.MinValue, "Min" }; - yield return new object[] { typeof(Int32Enum), 1, "One" }; - yield return new object[] { typeof(Int32Enum), 2, "Two" }; - yield return new object[] { typeof(Int32Enum), int.MaxValue, "Max" }; - yield return new object[] { typeof(Int32Enum), 3, null }; - - yield return new object[] { typeof(SimpleEnum), 99, null }; - yield return new object[] { typeof(SimpleEnum), SimpleEnum.Red, "Red" }; - yield return new object[] { typeof(SimpleEnum), 1, "Red" }; + [Theory] + [InlineData(ByteEnum.Min, "Min")] + [InlineData(ByteEnum.One, "One")] + [InlineData(ByteEnum.Two, "Two")] + [InlineData(ByteEnum.Max, "Max")] + [InlineData(byte.MinValue, "Min")] + [InlineData((byte)1, "One")] + [InlineData((byte)2, "Two")] + [InlineData(byte.MaxValue, "Max")] + [InlineData((byte)3, null)] + public void GetName_InvokeByteEnum_ReturnsExpected(object value, string expected) + { + TestGetName(typeof(ByteEnum), value, expected); + if (!(value is ByteEnum enumValue)) + { + enumValue = (ByteEnum)(byte)value; + } + Assert.Equal(expected, Enum.GetName(enumValue)); + } - // UInt32 - yield return new object[] { typeof(UInt32Enum), UInt32Enum.Min, "Min" }; - yield return new object[] { typeof(UInt32Enum), UInt32Enum.One, "One" }; - yield return new object[] { typeof(UInt32Enum), UInt32Enum.Two, "Two" }; - yield return new object[] { typeof(UInt32Enum), UInt32Enum.Max, "Max" }; - yield return new object[] { typeof(UInt32Enum), uint.MinValue, "Min" }; - yield return new object[] { typeof(UInt32Enum), (uint)1, "One" }; - yield return new object[] { typeof(UInt32Enum), (uint)2, "Two" }; - yield return new object[] { typeof(UInt32Enum), uint.MaxValue, "Max" }; - yield return new object[] { typeof(UInt32Enum), (uint)3, null }; + [Theory] + [InlineData(Int16Enum.Min, "Min")] + [InlineData(Int16Enum.One, "One")] + [InlineData(Int16Enum.Two, "Two")] + [InlineData(Int16Enum.Max, "Max")] + [InlineData(short.MinValue, "Min")] + [InlineData((short)1, "One")] + [InlineData((short)2, "Two")] + [InlineData(short.MaxValue, "Max")] + [InlineData((short)3, null)] + public void GetName_InvokeInt16Enum_ReturnsExpected(object value, string expected) + { + TestGetName(typeof(Int16Enum), value, expected); + if (!(value is Int16Enum enumValue)) + { + enumValue = (Int16Enum)(short)value; + } + Assert.Equal(expected, Enum.GetName(enumValue)); + } - // Int64 - yield return new object[] { typeof(Int64Enum), Int64Enum.Min, "Min" }; - yield return new object[] { typeof(Int64Enum), Int64Enum.One, "One" }; - yield return new object[] { typeof(Int64Enum), Int64Enum.Two, "Two" }; - yield return new object[] { typeof(Int64Enum), Int64Enum.Max, "Max" }; - yield return new object[] { typeof(Int64Enum), long.MinValue, "Min" }; - yield return new object[] { typeof(Int64Enum), (long)1, "One" }; - yield return new object[] { typeof(Int64Enum), (long)2, "Two" }; - yield return new object[] { typeof(Int64Enum), long.MaxValue, "Max" }; - yield return new object[] { typeof(Int64Enum), (long)3, null }; + [Theory] + [InlineData(UInt16Enum.Min, "Min")] + [InlineData(UInt16Enum.One, "One")] + [InlineData(UInt16Enum.Two, "Two")] + [InlineData(UInt16Enum.Max, "Max")] + [InlineData(ushort.MinValue, "Min")] + [InlineData((ushort)1, "One")] + [InlineData((ushort)2, "Two")] + [InlineData(ushort.MaxValue, "Max")] + [InlineData((ushort)3, null)] + public void GetName_InvokeUInt16Enum_ReturnsExpected(object value, string expected) + { + TestGetName(typeof(UInt16Enum), value, expected); + if (!(value is UInt16Enum enumValue)) + { + enumValue = (UInt16Enum)(ushort)value; + } + Assert.Equal(expected, Enum.GetName(enumValue)); + } - // UInt64 - yield return new object[] { typeof(UInt64Enum), UInt64Enum.Min, "Min" }; - yield return new object[] { typeof(UInt64Enum), UInt64Enum.One, "One" }; - yield return new object[] { typeof(UInt64Enum), UInt64Enum.Two, "Two" }; - yield return new object[] { typeof(UInt64Enum), UInt64Enum.Max, "Max" }; - yield return new object[] { typeof(UInt64Enum), ulong.MinValue, "Min" }; - yield return new object[] { typeof(UInt64Enum), 1UL, "One" }; - yield return new object[] { typeof(UInt64Enum), 2UL, "Two" }; - yield return new object[] { typeof(UInt64Enum), ulong.MaxValue, "Max" }; - yield return new object[] { typeof(UInt64Enum), 3UL, null }; + [Theory] + [InlineData(Int32Enum.Min, "Min")] + [InlineData(Int32Enum.One, "One")] + [InlineData(Int32Enum.Two, "Two")] + [InlineData(Int32Enum.Max, "Max")] + [InlineData(int.MinValue, "Min")] + [InlineData(1, "One")] + [InlineData(2, "Two")] + [InlineData(int.MaxValue, "Max")] + [InlineData(3, null)] + public void GetName_InvokeInt32Enum_ReturnsExpected(object value, string expected) + { + TestGetName(typeof(Int32Enum), value, expected); + if (!(value is Int32Enum enumValue)) + { + enumValue = (Int32Enum)(int)value; + } + Assert.Equal(expected, Enum.GetName(enumValue)); + } - if (PlatformDetection.IsReflectionEmitSupported) + [Theory] + [InlineData(UInt32Enum.Min, "Min")] + [InlineData(UInt32Enum.One, "One")] + [InlineData(UInt32Enum.Two, "Two")] + [InlineData(UInt32Enum.Max, "Max")] + [InlineData(uint.MinValue, "Min")] + [InlineData((uint)1, "One")] + [InlineData((uint)2, "Two")] + [InlineData(uint.MaxValue, "Max")] + [InlineData((uint)3, null)] + public void GetName_InvokeUInt32Enum_ReturnsExpected(object value, string expected) + { + TestGetName(typeof(UInt32Enum), value, expected); + if (!(value is UInt32Enum enumValue)) { - // Char - yield return new object[] { s_charEnumType, Enum.Parse(s_charEnumType, "Value1"), "Value1" }; - yield return new object[] { s_charEnumType, Enum.Parse(s_charEnumType, "Value2"), "Value2" }; - yield return new object[] { s_charEnumType, (char)1, "Value1" }; - yield return new object[] { s_charEnumType, (char)2, "Value2" }; - yield return new object[] { s_charEnumType, (char)4, null }; + enumValue = (UInt32Enum)(uint)value; + } + Assert.Equal(expected, Enum.GetName(enumValue)); + } - // Bool - yield return new object[] { s_boolEnumType, Enum.Parse(s_boolEnumType, "Value1"), "Value1" }; - yield return new object[] { s_boolEnumType, Enum.Parse(s_boolEnumType, "Value2"), "Value2" }; - yield return new object[] { s_boolEnumType, true, "Value1" }; - yield return new object[] { s_boolEnumType, false, "Value2" }; + [Theory] + [InlineData(Int64Enum.Min, "Min")] + [InlineData(Int64Enum.One, "One")] + [InlineData(Int64Enum.Two, "Two")] + [InlineData(Int64Enum.Max, "Max")] + [InlineData(long.MinValue, "Min")] + [InlineData((long)1, "One")] + [InlineData((long)2, "Two")] + [InlineData(long.MaxValue, "Max")] + [InlineData((long)3, null)] + public void GetName_InvokeInt64Enum_ReturnsExpected(object value, string expected) + { + TestGetName(typeof(Int64Enum), value, expected); + if (!(value is Int64Enum enumValue)) + { + enumValue = (Int64Enum)(long)value; } + Assert.Equal(expected, Enum.GetName(enumValue)); } [Theory] - [MemberData(nameof(GetName_TestData))] - public static void GetName(Type enumType, object value, string expected) + [InlineData(UInt64Enum.Min, "Min")] + [InlineData(UInt64Enum.One, "One")] + [InlineData(UInt64Enum.Two, "Two")] + [InlineData(UInt64Enum.Max, "Max")] + [InlineData(ulong.MinValue, "Min")] + [InlineData(1UL, "One")] + [InlineData(2UL, "Two")] + [InlineData(ulong.MaxValue, "Max")] + [InlineData(3UL, null)] + public void GetName_InvokeUInt64Enum_ReturnsExpected(object value, string expected) + { + TestGetName(typeof(UInt64Enum), value, expected); + if (!(value is UInt64Enum enumValue)) + { + enumValue = (UInt64Enum)(ulong)value; + } + Assert.Equal(expected, Enum.GetName(enumValue)); + } + + public static IEnumerable GetName_CharEnum_TestData() + { + yield return new object[] { Enum.Parse(s_charEnumType, "Value1"), "Value1" }; + yield return new object[] { Enum.Parse(s_charEnumType, "Value2"), "Value2" }; + yield return new object[] { (char)1, "Value1" }; + yield return new object[] { (char)2, "Value2" }; + yield return new object[] { (char)4, null }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [MemberData(nameof(GetName_CharEnum_TestData))] + public void GetName_InvokeCharEnum_ReturnsExpected(object value, string expected) + { + TestGetName(s_charEnumType, value, expected); + } + + public static IEnumerable GetName_BoolEnum_TestData() + { + yield return new object[] { Enum.Parse(s_boolEnumType, "Value1"), "Value1" }; + yield return new object[] { Enum.Parse(s_boolEnumType, "Value2"), "Value2" }; + yield return new object[] { true, "Value1" }; + yield return new object[] { false, "Value2" }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [MemberData(nameof(GetName_BoolEnum_TestData))] + public void GetName_InvokeBoolEnum_ReturnsExpected(object value, string expected) + { + TestGetName(s_boolEnumType, value, expected); + } + + private void TestGetName(Type enumType, object value, string expected) { Assert.Equal(expected, Enum.GetName(enumType, value)); @@ -398,15 +476,38 @@ public static void GetName_MultipleMatches() } [Fact] - public static void GetName_Invalid() + public void GetName_NullEnumType_ThrowsArgumentNullException() { - Type t = typeof(SimpleEnum); - AssertExtensions.Throws("enumType", () => Enum.GetName(null, 1)); // Enum type is null - AssertExtensions.Throws("value", () => Enum.GetName(t, null)); // Value is null + AssertExtensions.Throws("enumType", () => Enum.GetName(null, 1)); + } + + [Theory] + [InlineData(typeof(object))] + [InlineData(typeof(int))] + [InlineData(typeof(ValueType))] + [InlineData(typeof(Enum))] + public void GetName_EnumTypeNotEnum_ThrowsArgumentException(Type enumType) + { + AssertExtensions.Throws(null, () => Enum.GetName(enumType, 1)); + } - AssertExtensions.Throws(null, () => Enum.GetName(typeof(object), 1)); // Enum type is not an enum - AssertExtensions.Throws("value", () => Enum.GetName(t, "Red")); // Value is not the type of the enum's raw data - AssertExtensions.Throws("value", () => Enum.GetName(t, (IntPtr)0)); // Value is out of range + [Fact] + public void GetName_NullValue_ThrowsArgumentNullException() + { + AssertExtensions.Throws("value", () => Enum.GetName(typeof(SimpleEnum), null)); + } + + public static IEnumerable GetName_InvalidValue_TestData() + { + yield return new object[] { "Red" }; + yield return new object[] { IntPtr.Zero }; + } + + [Theory] + [MemberData(nameof(GetName_InvalidValue_TestData))] + public void GetName_InvalidValue_ThrowsArgumentException(object value) + { + AssertExtensions.Throws("value", () => Enum.GetName(typeof(SimpleEnum), value)); } [Theory] @@ -416,7 +517,7 @@ public static void GetName_Invalid() [InlineData(typeof(SByteEnum), true, "One")] [InlineData(typeof(SByteEnum), (char)1, "One")] [InlineData(typeof(SByteEnum), SimpleEnum.Red, "One")] // API doesn't care if you pass in a completely different enum - public static void GetName_NonIntegralTypes(Type enumType, object value, string expected) + public static void GetName_NonIntegralTypes_ReturnsExpected(Type enumType, object value, string expected) { // Despite what MSDN says, GetName() does not require passing in the exact integral type. // For the purposes of comparison: @@ -445,120 +546,203 @@ public static void GetTypeCode_Enum_ReturnsExpected(Enum e, TypeCode expected) Assert.Equal(expected, e.GetTypeCode()); } - public static IEnumerable IsDefined_TestData() + [Theory] + [InlineData("One", true)] + [InlineData("None", false)] + [InlineData(SByteEnum.One, true)] + [InlineData((SByteEnum)99, false)] + [InlineData((sbyte)1, true)] + [InlineData((sbyte)99, false)] + public static void IsDefined_InvokeSByteEnum_ReturnsExpected(object value, bool expected) { - // SByte - yield return new object[] { typeof(SByteEnum), "One", true }; - yield return new object[] { typeof(SByteEnum), "None", false }; - yield return new object[] { typeof(SByteEnum), SByteEnum.One, true }; - yield return new object[] { typeof(SByteEnum), (SByteEnum)99, false }; - yield return new object[] { typeof(SByteEnum), (sbyte)1, true }; - yield return new object[] { typeof(SByteEnum), (sbyte)99, false }; - - // Byte - yield return new object[] { typeof(ByteEnum), "One", true }; - yield return new object[] { typeof(ByteEnum), "None", false }; - yield return new object[] { typeof(ByteEnum), ByteEnum.One, true }; - yield return new object[] { typeof(ByteEnum), (ByteEnum)99, false }; - yield return new object[] { typeof(ByteEnum), (byte)1, true }; - yield return new object[] { typeof(ByteEnum), (byte)99, false }; - - // Int16 - yield return new object[] { typeof(Int16Enum), "One", true }; - yield return new object[] { typeof(Int16Enum), "None", false }; - yield return new object[] { typeof(Int16Enum), Int16Enum.One, true }; - yield return new object[] { typeof(Int16Enum), (Int16Enum)99, false }; - yield return new object[] { typeof(Int16Enum), (short)1, true }; - yield return new object[] { typeof(Int16Enum), (short)99, false }; + Assert.Equal(expected, Enum.IsDefined(typeof(SByteEnum), value)); + if (value is SByteEnum enumValue) + { + Assert.Equal(expected, Enum.IsDefined(enumValue)); + } + } - // UInt16 - yield return new object[] { typeof(UInt16Enum), "One", true }; - yield return new object[] { typeof(UInt16Enum), "None", false }; - yield return new object[] { typeof(UInt16Enum), UInt16Enum.One, true }; - yield return new object[] { typeof(UInt16Enum), (UInt16Enum)99, false }; - yield return new object[] { typeof(UInt16Enum), (ushort)1, true }; - yield return new object[] { typeof(UInt16Enum), (ushort)99, false }; + [Theory] + [InlineData("One", true)] + [InlineData("None", false)] + [InlineData(ByteEnum.One, true)] + [InlineData((ByteEnum)99, false)] + [InlineData((byte)1, true)] + [InlineData((byte)99, false)] + public static void IsDefined_InvokeByteEnum_ReturnsExpected(object value, bool expected) + { + Assert.Equal(expected, Enum.IsDefined(typeof(ByteEnum), value)); + if (value is ByteEnum enumValue) + { + Assert.Equal(expected, Enum.IsDefined(enumValue)); + } + } - // Int32 - yield return new object[] { typeof(SimpleEnum), "Red", true }; - yield return new object[] { typeof(SimpleEnum), "Green", true }; - yield return new object[] { typeof(SimpleEnum), "Blue", true }; - yield return new object[] { typeof(SimpleEnum), " Blue ", false }; - yield return new object[] { typeof(SimpleEnum), " blue ", false }; - yield return new object[] { typeof(SimpleEnum), SimpleEnum.Red, true }; - yield return new object[] { typeof(SimpleEnum), (SimpleEnum)99, false }; - yield return new object[] { typeof(SimpleEnum), 1, true }; - yield return new object[] { typeof(SimpleEnum), 99, false }; - yield return new object[] { typeof(Int32Enum), 0x1 | 0x02, false }; + [Theory] + [InlineData("One", true)] + [InlineData("None", false)] + [InlineData(Int16Enum.One, true)] + [InlineData((Int16Enum)99, false)] + [InlineData((short)1, true)] + [InlineData((short)99, false)] + public static void IsDefined_InvokeInt16Enum_ReturnsExpected(object value, bool expected) + { + Assert.Equal(expected, Enum.IsDefined(typeof(Int16Enum), value)); + if (value is Int16Enum enumValue) + { + Assert.Equal(expected, Enum.IsDefined(enumValue)); + } + } - // UInt32 - yield return new object[] { typeof(UInt32Enum), "One", true }; - yield return new object[] { typeof(UInt32Enum), "None", false }; - yield return new object[] { typeof(UInt32Enum), UInt32Enum.One, true }; - yield return new object[] { typeof(UInt32Enum), (UInt32Enum)99, false }; - yield return new object[] { typeof(UInt32Enum), (uint)1, true }; - yield return new object[] { typeof(UInt32Enum), (uint)99, false }; + [Theory] + [InlineData("One", true)] + [InlineData("None", false)] + [InlineData(UInt16Enum.One, true)] + [InlineData((UInt16Enum)99, false)] + [InlineData((ushort)1, true)] + [InlineData((ushort)99, false)] + public static void IsDefined_InvokeUInt16Enum_ReturnsExpected(object value, bool expected) + { + Assert.Equal(expected, Enum.IsDefined(typeof(UInt16Enum), value)); + if (value is UInt16Enum enumValue) + { + Assert.Equal(expected, Enum.IsDefined(enumValue)); + } + } - // Int64 - yield return new object[] { typeof(Int64Enum), "One", true }; - yield return new object[] { typeof(Int64Enum), "None", false }; - yield return new object[] { typeof(Int64Enum), Int64Enum.One, true }; - yield return new object[] { typeof(Int64Enum), (Int64Enum)99, false }; - yield return new object[] { typeof(Int64Enum), (long)1, true }; - yield return new object[] { typeof(Int64Enum), (long)99, false }; + [Theory] + [InlineData("Red", true)] + [InlineData("Green", true)] + [InlineData("Blue", true)] + [InlineData(" Blue ", false)] + [InlineData(" blue ", false)] + [InlineData(SimpleEnum.Red, true)] + [InlineData((SimpleEnum)99, false)] + [InlineData(1, true)] + [InlineData(99, false)] + public static void IsDefined_InvokeInt32Enum_ReturnsExpected(object value, bool expected) + { + Assert.Equal(expected, Enum.IsDefined(typeof(SimpleEnum), value)); + if (value is SimpleEnum enumValue) + { + Assert.Equal(expected, Enum.IsDefined(enumValue)); + } + } - // UInt64 - yield return new object[] { typeof(UInt64Enum), "One", true }; - yield return new object[] { typeof(UInt64Enum), "None", false }; - yield return new object[] { typeof(UInt64Enum), UInt64Enum.One, true }; - yield return new object[] { typeof(UInt64Enum), (UInt64Enum)99, false }; - yield return new object[] { typeof(UInt64Enum), (ulong)1, true }; - yield return new object[] { typeof(UInt64Enum), (ulong)99, false }; + [Theory] + [InlineData("One", true)] + [InlineData("None", false)] + [InlineData(UInt32Enum.One, true)] + [InlineData((UInt32Enum)99, false)] + [InlineData((uint)1, true)] + [InlineData((uint)99, false)] + public static void IsDefined_InvokeUInt32Enum_ReturnsExpected(object value, bool expected) + { + Assert.Equal(expected, Enum.IsDefined(typeof(UInt32Enum), value)); + if (value is UInt32Enum enumValue) + { + Assert.Equal(expected, Enum.IsDefined(enumValue)); + } + } - if (PlatformDetection.IsReflectionEmitSupported) + [Theory] + [InlineData("One", true)] + [InlineData("None", false)] + [InlineData(Int64Enum.One, true)] + [InlineData((Int64Enum)99, false)] + [InlineData((long)1, true)] + [InlineData((long)99, false)] + public static void IsDefined_InvokeInt64Enum_ReturnsExpected(object value, bool expected) + { + Assert.Equal(expected, Enum.IsDefined(typeof(Int64Enum), value)); + if (value is Int64Enum enumValue) { - // Char - yield return new object[] { s_charEnumType, "Value1", true }; - yield return new object[] { s_charEnumType, "None", false }; - yield return new object[] { s_charEnumType, Enum.Parse(s_charEnumType, "Value1"), true }; - yield return new object[] { s_charEnumType, (char)1, true }; - yield return new object[] { s_charEnumType, (char)99, false }; - - // Boolean - yield return new object[] { s_boolEnumType, "Value1", true }; - yield return new object[] { s_boolEnumType, "None", false }; - yield return new object[] { s_boolEnumType, Enum.Parse(s_boolEnumType, "Value1"), true }; - yield return new object[] { s_boolEnumType, "Value1", true }; - yield return new object[] { s_boolEnumType, true, true }; - yield return new object[] { s_boolEnumType, false, true }; + Assert.Equal(expected, Enum.IsDefined(enumValue)); } } [Theory] - [MemberData(nameof(IsDefined_TestData))] - public static void IsDefined(Type enumType, object value, bool expected) + [InlineData("One", true)] + [InlineData("None", false)] + [InlineData(UInt64Enum.One, true)] + [InlineData((UInt64Enum)99, false)] + [InlineData((ulong)1, true)] + [InlineData((ulong)99, false)] + public static void IsDefined_InvokeUInt64Enum_ReturnsExpected(object value, bool expected) { - Assert.Equal(expected, Enum.IsDefined(enumType, value)); + Assert.Equal(expected, Enum.IsDefined(typeof(UInt64Enum), value)); + if (value is UInt64Enum enumValue) + { + Assert.Equal(expected, Enum.IsDefined(enumValue)); + } + } + + public static IEnumerable IsDefined_CharEnum_TestData() + { + yield return new object[] { "Value1", true }; + yield return new object[] { "None", false }; + yield return new object[] { Enum.Parse(s_charEnumType, "Value1"), true }; + yield return new object[] { (char)1, true }; + yield return new object[] { (char)99, false }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [MemberData(nameof(IsDefined_CharEnum_TestData))] + public void IsDefined_InvokeCharEnum_ReturnsExpected(object value, bool expected) + { + Assert.Equal(expected, Enum.IsDefined(s_charEnumType, value)); + } + + public static IEnumerable IsDefined_BoolEnum_TestData() + { + yield return new object[] { "Value1", true }; + yield return new object[] { "None", false }; + yield return new object[] { Enum.Parse(s_boolEnumType, "Value1"), true }; + yield return new object[] { "Value1", true }; + yield return new object[] { true, true }; + yield return new object[] { false, true }; + } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [MemberData(nameof(IsDefined_BoolEnum_TestData))] + public void IsDefined_InvokeBoolEnum_ReturnsExpected(object value, bool expected) + { + Assert.Equal(expected, Enum.IsDefined(s_boolEnumType, value)); } [Fact] - public static void IsDefined_Invalid() + public void IsDefined_NullEnumType_ThrowsArgumentNullException() { - Type t = typeof(SimpleEnum); + AssertExtensions.Throws("enumType", () => Enum.IsDefined(null, 1)); + } - AssertExtensions.Throws("enumType", () => Enum.IsDefined(null, 1)); // Enum type is null - AssertExtensions.Throws("value", () => Enum.IsDefined(t, null)); // Value is null + [Fact] + public void IsDefined_NullValue_ThrowsArgumentNullException() + { + AssertExtensions.Throws("value", () => Enum.IsDefined(typeof(SimpleEnum), null)); + } - AssertExtensions.Throws(null, () => Enum.IsDefined(t, Int32Enum.One)); // Value is different enum type + [Theory] + [InlineData(Int32Enum.One)] + [InlineData(true)] + [InlineData('a')] + public void IsDefined_InvalidValue_ThrowsArgumentException(object value) + { + AssertExtensions.Throws(null, () => Enum.IsDefined(typeof(SimpleEnum), value)); + } - // Value is not a valid type (MSDN claims this should throw InvalidOperationException) - AssertExtensions.Throws(null, () => Enum.IsDefined(t, true)); - AssertExtensions.Throws(null, () => Enum.IsDefined(t, 'a')); + public static IEnumerable IsDefined_NonIntegerValue_TestData() + { + yield return new object[] { IntPtr.Zero }; + yield return new object[] { 5.5 }; + yield return new object[] { 5.5f }; + } - // Non-integers throw InvalidOperationException prior to Win8P. - Assert.Throws(() => Enum.IsDefined(t, (IntPtr)0)); - Assert.Throws(() => Enum.IsDefined(t, 5.5)); - Assert.Throws(() => Enum.IsDefined(t, 5.5f)); + [Theory] + [MemberData(nameof(IsDefined_NonIntegerValue_TestData))] + public void IsDefined_NonIntegerValue_ThrowsThrowsInvalidOperationException(object value) + { + Assert.Throws(() => Enum.IsDefined(typeof(SimpleEnum), value)); } public static IEnumerable HasFlag_TestData() @@ -1090,152 +1274,294 @@ public static void GetUnderlyingType_Invalid() AssertExtensions.Throws("enumType", () => Enum.GetUnderlyingType(typeof(Enum))); // Enum type is simply an enum } - public static IEnumerable GetNames_GetValues_TestData() + [Fact] + public void GetNames_InvokeSimpleEnum_ReturnsExpected() { - // SimpleEnum - yield return new object[] - { - typeof(SimpleEnum), - new string[] { "Red", "Blue", "Green", "Green_a", "Green_b", "B" }, - new object[] { SimpleEnum.Red, SimpleEnum.Blue, SimpleEnum.Green, SimpleEnum.Green_a, SimpleEnum.Green_b, SimpleEnum.B } - }; + var expected = new string[] { "Red", "Blue", "Green", "Green_a", "Green_b", "B" }; + Assert.Equal(expected, Enum.GetNames(typeof(SimpleEnum))); + Assert.NotSame(Enum.GetNames(typeof(SimpleEnum)), Enum.GetNames(typeof(SimpleEnum))); + Assert.Equal(expected, Enum.GetNames()); + } - // SByte - yield return new object[] - { - typeof(SByteEnum), - new string[] { "One", "Two", "Max", "Min" }, - new object[] { SByteEnum.One, SByteEnum.Two, SByteEnum.Max, SByteEnum.Min } - }; + [Fact] + public void GetNames_InvokeSByteEnum_ReturnsExpected() + { + var expected = new string[] { "One", "Two", "Max", "Min" }; + Assert.Equal(expected, Enum.GetNames(typeof(SByteEnum))); + Assert.NotSame(Enum.GetNames(typeof(SByteEnum)), Enum.GetNames(typeof(SByteEnum))); + Assert.Equal(expected, Enum.GetNames()); + } - // Byte - yield return new object[] - { - typeof(ByteEnum), - new string[] { "Min", "One", "Two", "Max" }, - new object[] { ByteEnum.Min, ByteEnum.One, ByteEnum.Two, ByteEnum.Max } - }; + [Fact] + public void GetNames_InvokeByteEnum_ReturnsExpected() + { + var expected = new string[] { "Min", "One", "Two", "Max" }; + Assert.Equal(expected, Enum.GetNames(typeof(ByteEnum))); + Assert.NotSame(Enum.GetNames(typeof(ByteEnum)), Enum.GetNames(typeof(ByteEnum))); + Assert.Equal(expected, Enum.GetNames()); + } - // Int16 - yield return new object[] - { - typeof(Int16Enum), - new string[] { "One", "Two", "Max", "Min" }, - new object[] { Int16Enum.One, Int16Enum.Two, Int16Enum.Max, Int16Enum.Min } - }; + [Fact] + public void GetNames_InvokeInt16Enum_ReturnsExpected() + { + var expected = new string[] { "One", "Two", "Max", "Min" }; + Assert.Equal(expected, Enum.GetNames(typeof(Int16Enum))); + Assert.NotSame(Enum.GetNames(typeof(Int16Enum)), Enum.GetNames(typeof(Int16Enum))); + Assert.Equal(expected, Enum.GetNames()); + } - // UInt16 - yield return new object[] - { - typeof(UInt16Enum), - new string[] { "Min", "One", "Two", "Max" }, - new object[] { UInt16Enum.Min, UInt16Enum.One, UInt16Enum.Two, UInt16Enum.Max } - }; + [Fact] + public void GetNames_InvokeUInt16Enum_ReturnsExpected() + { + var expected = new string[] { "Min", "One", "Two", "Max" }; + Assert.Equal(expected, Enum.GetNames(typeof(UInt16Enum))); + Assert.NotSame(Enum.GetNames(typeof(UInt16Enum)), Enum.GetNames(typeof(UInt16Enum))); + Assert.Equal(expected, Enum.GetNames()); + } - // Int32 - yield return new object[] - { - typeof(Int32Enum), - new string[] { "One", "Two", "Max", "Min" }, - new object[] { Int32Enum.One, Int32Enum.Two, Int32Enum.Max, Int32Enum.Min } - }; + [Fact] + public void GetNames_InvokeInt32Enum_ReturnsExpected() + { + var expected = new string[] { "One", "Two", "Max", "Min" }; + Assert.Equal(expected, Enum.GetNames(typeof(Int32Enum))); + Assert.NotSame(Enum.GetNames(typeof(Int32Enum)), Enum.GetNames(typeof(Int32Enum))); + Assert.Equal(expected, Enum.GetNames()); + } - // UInt32 - yield return new object[] - { - typeof(UInt32Enum), - new string[] { "Min", "One", "Two", "Max" }, - new object[] { UInt32Enum.Min, UInt32Enum.One, UInt32Enum.Two, UInt32Enum.Max } - }; + [Fact] + public void GetNames_InvokeUInt32Enum_ReturnsExpected() + { + var expected = new string[] { "Min", "One", "Two", "Max" }; + Assert.Equal(expected, Enum.GetNames(typeof(UInt32Enum))); + Assert.NotSame(Enum.GetNames(typeof(UInt32Enum)), Enum.GetNames(typeof(UInt32Enum))); + Assert.Equal(expected, Enum.GetNames()); + } - // Int64 - yield return new object[] - { - typeof(Int64Enum), - new string[] { "One", "Two", "Max", "Min" }, - new object[] { Int64Enum.One, Int64Enum.Two, Int64Enum.Max, Int64Enum.Min } - }; + [Fact] + public void GetNames_InvokeInt64Enum_ReturnsExpected() + { + var expected = new string[] { "One", "Two", "Max", "Min" }; + Assert.Equal(expected, Enum.GetNames(typeof(Int64Enum))); + Assert.NotSame(Enum.GetNames(typeof(Int64Enum)), Enum.GetNames(typeof(Int64Enum))); + Assert.Equal(expected, Enum.GetNames()); + } - // UInt64 - yield return new object[] - { - typeof(UInt64Enum), - new string[] { "Min", "One", "Two", "Max" }, - new object[] { UInt64Enum.Min, UInt64Enum.One, UInt64Enum.Two, UInt64Enum.Max } - }; + [Fact] + public void GetNames_InvokeUInt64Enum_ReturnsExpected() + { + var expected = new string[] { "Min", "One", "Two", "Max" }; + Assert.Equal(expected, Enum.GetNames(typeof(UInt64Enum))); + Assert.NotSame(Enum.GetNames(typeof(UInt64Enum)), Enum.GetNames(typeof(UInt64Enum))); + Assert.Equal(expected, Enum.GetNames()); + } - if (PlatformDetection.IsReflectionEmitSupported) - { - // Char - yield return new object[] - { - s_charEnumType, - new string[] { "Value0x0000", "Value1", "Value2", "Value0x0010", "Value0x0f06", "Value0x1000", "Value0x3000", "Value0x3f06", "Value0x3f16" }, - new object[] { Enum.Parse(s_charEnumType, "Value0x0000"), Enum.Parse(s_charEnumType, "Value1"), Enum.Parse(s_charEnumType, "Value2"), Enum.Parse(s_charEnumType, "Value0x0010"), Enum.Parse(s_charEnumType, "Value0x0f06"), Enum.Parse(s_charEnumType, "Value0x1000"), Enum.Parse(s_charEnumType, "Value0x3000"), Enum.Parse(s_charEnumType, "Value0x3f06"), Enum.Parse(s_charEnumType, "Value0x3f16") } - }; + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + public void GetNames_InvokeCharEnum_ReturnsExpected() + { + var expected = new string[] { "Value0x0000", "Value1", "Value2", "Value0x0010", "Value0x0f06", "Value0x1000", "Value0x3000", "Value0x3f06", "Value0x3f16" }; + Assert.Equal(expected, Enum.GetNames(s_charEnumType)); + Assert.NotSame(Enum.GetNames(s_charEnumType), Enum.GetNames(s_charEnumType)); + } - // Bool - yield return new object[] - { - s_boolEnumType, - new string[] { "Value2", "Value1" }, - new object[] { Enum.Parse(s_boolEnumType, "Value2"), Enum.Parse(s_boolEnumType, "Value1") } - }; + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + public void GetNames_InvokeBoolEnum_ReturnsExpected() + { + var expected = new string[] { "Value2", "Value1" }; + Assert.Equal(expected, Enum.GetNames(s_boolEnumType)); + Assert.NotSame(Enum.GetNames(s_boolEnumType), Enum.GetNames(s_boolEnumType)); + } - // Single - yield return new object[] - { - s_floatEnumType, - new string[] { "Value1", "Value2", "Value0x3f06", "Value0x3000", "Value0x0f06", "Value0x1000", "Value0x0000", "Value0x0010", "Value0x3f16" }, - new object[] { Enum.Parse(s_floatEnumType, "Value1"), Enum.Parse(s_floatEnumType, "Value2"), Enum.Parse(s_floatEnumType, "Value0x3f06"), Enum.Parse(s_floatEnumType, "Value0x3000"), Enum.Parse(s_floatEnumType, "Value0x0f06"), Enum.Parse(s_floatEnumType, "Value0x1000"), Enum.Parse(s_floatEnumType, "Value0x0000"), Enum.Parse(s_floatEnumType, "Value0x0010"), Enum.Parse(s_floatEnumType, "Value0x3f16") } - }; + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + public void GetNames_InvokeSingleEnum_ReturnsExpected() + { + var expected = new string[] { "Value1", "Value2", "Value0x3f06", "Value0x3000", "Value0x0f06", "Value0x1000", "Value0x0000", "Value0x0010", "Value0x3f16" }; + Assert.Equal(expected, Enum.GetNames(s_floatEnumType)); + Assert.NotSame(Enum.GetNames(s_floatEnumType), Enum.GetNames(s_floatEnumType)); + } - // Double - yield return new object[] - { - s_doubleEnumType, - new string[] { "Value1", "Value2", "Value0x3f06", "Value0x3000", "Value0x0f06", "Value0x1000", "Value0x0000", "Value0x0010", "Value0x3f16" }, - new object[] { Enum.Parse(s_doubleEnumType, "Value1"), Enum.Parse(s_doubleEnumType, "Value2"), Enum.Parse(s_doubleEnumType, "Value0x3f06"), Enum.Parse(s_doubleEnumType, "Value0x3000"), Enum.Parse(s_doubleEnumType, "Value0x0f06"), Enum.Parse(s_doubleEnumType, "Value0x1000"), Enum.Parse(s_doubleEnumType, "Value0x0000"), Enum.Parse(s_doubleEnumType, "Value0x0010"), Enum.Parse(s_doubleEnumType, "Value0x3f16") } - }; + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + public void GetNames_InvokeDoubleEnum_ReturnsExpected() + { + var expected = new string[] { "Value1", "Value2", "Value0x3f06", "Value0x3000", "Value0x0f06", "Value0x1000", "Value0x0000", "Value0x0010", "Value0x3f16" }; + Assert.Equal(expected, Enum.GetNames(s_doubleEnumType)); + Assert.NotSame(Enum.GetNames(s_doubleEnumType), Enum.GetNames(s_doubleEnumType)); + } - // IntPtr - yield return new object[] - { - s_intPtrEnumType, - new string[0], - new object[0] - }; + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + public void GetNames_InvokeIntPtrEnum_ReturnsExpected() + { + var expected = new string[0]; + Assert.Equal(expected, Enum.GetNames(s_intPtrEnumType)); + Assert.Same(Enum.GetNames(s_intPtrEnumType), Enum.GetNames(s_intPtrEnumType)); + } - // UIntPtr - yield return new object[] - { - s_uintPtrEnumType, - new string[0], - new object[0] - }; - } + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + public void GetNames_InvokeUIntPtrEnum_ReturnsExpected() + { + var expected = new string[0]; + Assert.Equal(expected, Enum.GetNames(s_uintPtrEnumType)); + Assert.Same(Enum.GetNames(s_uintPtrEnumType), Enum.GetNames(s_uintPtrEnumType)); } + [Fact] + public static void GetNames_NullEnumType_ThrowsArgumentNullException() + { + AssertExtensions.Throws("enumType", () => Enum.GetNames(null)); + } + [Theory] - [MemberData(nameof(GetNames_GetValues_TestData))] - public static void GetNames_GetValues(Type enumType, string[] expectedNames, object[] expectedValues) + [InlineData(typeof(object))] + [InlineData(typeof(int))] + [InlineData(typeof(ValueType))] + [InlineData(typeof(Enum))] + public void GetNames_EnumTypeNotEnum_ThrowsArgumentException(Type enumType) + { + AssertExtensions.Throws("enumType", () => Enum.GetNames(enumType)); + } + + [Fact] + public void GetValues_InvokeSimpleEnumEnum_ReturnsExpected() { - Assert.Equal(expectedNames, Enum.GetNames(enumType)); - Assert.Equal(expectedValues, Enum.GetValues(enumType).Cast().ToArray()); + var expected = new SimpleEnum[] { SimpleEnum.Red, SimpleEnum.Blue, SimpleEnum.Green, SimpleEnum.Green_a, SimpleEnum.Green_b, SimpleEnum.B }; + Assert.Equal(expected, Enum.GetValues(typeof(SimpleEnum))); + Assert.NotSame(Enum.GetValues(typeof(SimpleEnum)), Enum.GetValues(typeof(SimpleEnum))); + Assert.Equal(expected, Enum.GetValues()); } [Fact] - public static void GetNames_Invalid() + public void GetValues_InvokeSByteEnum_ReturnsExpected() { - AssertExtensions.Throws("enumType", () => Enum.GetNames(null)); // Enum type is null - AssertExtensions.Throws("enumType", () => Enum.GetNames(typeof(object))); // Enum type is not an enum + var expected = new SByteEnum[] { SByteEnum.One, SByteEnum.Two, SByteEnum.Max, SByteEnum.Min }; + Assert.Equal(expected, Enum.GetValues(typeof(SByteEnum))); + Assert.NotSame(Enum.GetValues(typeof(SByteEnum)), Enum.GetValues(typeof(SByteEnum))); + Assert.Equal(expected, Enum.GetValues()); } [Fact] - public static void GetValues_Invalid() + public void GetValues_InvokeByteEnum_ReturnsExpected() + { + var expected = new ByteEnum[] { ByteEnum.Min, ByteEnum.One, ByteEnum.Two, ByteEnum.Max }; + Assert.Equal(expected, Enum.GetValues(typeof(ByteEnum))); + Assert.NotSame(Enum.GetValues(typeof(ByteEnum)), Enum.GetValues(typeof(ByteEnum))); + Assert.Equal(expected, Enum.GetValues()); + } + + [Fact] + public void GetValues_InvokeInt16Enum_ReturnsExpected() + { + var expected = new Int16Enum[] { Int16Enum.One, Int16Enum.Two, Int16Enum.Max, Int16Enum.Min }; + Assert.Equal(expected, Enum.GetValues(typeof(Int16Enum))); + Assert.NotSame(Enum.GetValues(typeof(Int16Enum)), Enum.GetValues(typeof(Int16Enum))); + Assert.Equal(expected, Enum.GetValues()); + } + + [Fact] + public void GetValues_InvokeUInt16Enum_ReturnsExpected() + { + var expected = new UInt16Enum[] { UInt16Enum.Min, UInt16Enum.One, UInt16Enum.Two, UInt16Enum.Max }; + Assert.Equal(expected, Enum.GetValues(typeof(UInt16Enum))); + Assert.NotSame(Enum.GetValues(typeof(UInt16Enum)), Enum.GetValues(typeof(UInt16Enum))); + Assert.Equal(expected, Enum.GetValues()); + } + + [Fact] + public void GetValues_InvokeInt32Enum_ReturnsExpected() + { + var expected = new Int32Enum[] { Int32Enum.One, Int32Enum.Two, Int32Enum.Max, Int32Enum.Min }; + Assert.Equal(expected, Enum.GetValues(typeof(Int32Enum))); + Assert.NotSame(Enum.GetValues(typeof(Int32Enum)), Enum.GetValues(typeof(Int32Enum))); + Assert.Equal(expected, Enum.GetValues()); + } + + [Fact] + public void GetValues_InvokeUInt32Enum_ReturnsExpected() + { + var expected = new UInt32Enum[] { UInt32Enum.Min, UInt32Enum.One, UInt32Enum.Two, UInt32Enum.Max }; + Assert.Equal(expected, Enum.GetValues(typeof(UInt32Enum))); + Assert.NotSame(Enum.GetValues(typeof(UInt32Enum)), Enum.GetValues(typeof(UInt32Enum))); + Assert.Equal(expected, Enum.GetValues()); + } + + [Fact] + public void GetValues_InvokeInt64Enum_ReturnsExpected() + { + var expected = new Int64Enum[] { Int64Enum.One, Int64Enum.Two, Int64Enum.Max, Int64Enum.Min }; + Assert.Equal(expected, Enum.GetValues(typeof(Int64Enum))); + Assert.NotSame(Enum.GetValues(typeof(Int64Enum)), Enum.GetValues(typeof(Int64Enum))); + Assert.Equal(expected, Enum.GetValues()); + } + + [Fact] + public void GetValues_InvokeUInt64Enum_ReturnsExpected() + { + var expected = new UInt64Enum[] { UInt64Enum.Min, UInt64Enum.One, UInt64Enum.Two, UInt64Enum.Max }; + Assert.Equal(expected, Enum.GetValues(typeof(UInt64Enum))); + Assert.NotSame(Enum.GetValues(typeof(UInt64Enum)), Enum.GetValues(typeof(UInt64Enum))); + Assert.Equal(expected, Enum.GetValues()); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + public void GetValues_InvokeCharEnum_ReturnsExpected() + { + var expected = new object[] { Enum.Parse(s_charEnumType, "Value0x0000"), Enum.Parse(s_charEnumType, "Value1"), Enum.Parse(s_charEnumType, "Value2"), Enum.Parse(s_charEnumType, "Value0x0010"), Enum.Parse(s_charEnumType, "Value0x0f06"), Enum.Parse(s_charEnumType, "Value0x1000"), Enum.Parse(s_charEnumType, "Value0x3000"), Enum.Parse(s_charEnumType, "Value0x3f06"), Enum.Parse(s_charEnumType, "Value0x3f16") }; + Assert.Equal(expected, Enum.GetValues(s_charEnumType)); + Assert.NotSame(Enum.GetValues(s_charEnumType), Enum.GetValues(s_charEnumType)); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + public void GetValues_InvokeBoolEnum_ReturnsExpected() + { + var expected = new object[] { Enum.Parse(s_boolEnumType, "Value2"), Enum.Parse(s_boolEnumType, "Value1") }; + Assert.Equal(expected, Enum.GetValues(s_boolEnumType)); + Assert.NotSame(Enum.GetValues(s_boolEnumType), Enum.GetValues(s_boolEnumType)); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + public void GetValues_InvokeSingleEnum_ReturnsExpected() + { + var expected = new object[] { Enum.Parse(s_floatEnumType, "Value1"), Enum.Parse(s_floatEnumType, "Value2"), Enum.Parse(s_floatEnumType, "Value0x3f06"), Enum.Parse(s_floatEnumType, "Value0x3000"), Enum.Parse(s_floatEnumType, "Value0x0f06"), Enum.Parse(s_floatEnumType, "Value0x1000"), Enum.Parse(s_floatEnumType, "Value0x0000"), Enum.Parse(s_floatEnumType, "Value0x0010"), Enum.Parse(s_floatEnumType, "Value0x3f16") }; + Assert.Equal(expected, Enum.GetValues(s_floatEnumType)); + Assert.NotSame(Enum.GetValues(s_floatEnumType), Enum.GetValues(s_floatEnumType)); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + public void GetValues_InvokeDoubleEnum_ReturnsExpected() + { + var expected = new object[] { Enum.Parse(s_doubleEnumType, "Value1"), Enum.Parse(s_doubleEnumType, "Value2"), Enum.Parse(s_doubleEnumType, "Value0x3f06"), Enum.Parse(s_doubleEnumType, "Value0x3000"), Enum.Parse(s_doubleEnumType, "Value0x0f06"), Enum.Parse(s_doubleEnumType, "Value0x1000"), Enum.Parse(s_doubleEnumType, "Value0x0000"), Enum.Parse(s_doubleEnumType, "Value0x0010"), Enum.Parse(s_doubleEnumType, "Value0x3f16") }; + Assert.Equal(expected, Enum.GetValues(s_doubleEnumType)); + Assert.NotSame(Enum.GetValues(s_doubleEnumType), Enum.GetValues(s_doubleEnumType)); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + public void GetValues_InvokeIntPtrEnum_ReturnsExpected() + { + var expected = new object[0]; + Assert.Equal(expected, Enum.GetValues(s_intPtrEnumType)); + Assert.NotSame(Enum.GetValues(s_intPtrEnumType), Enum.GetValues(s_intPtrEnumType)); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + public void GetValues_InvokeUIntPtrEnum_ReturnsExpected() + { + var expected = new object[0]; + Assert.Equal(expected, Enum.GetValues(s_uintPtrEnumType)); + Assert.NotSame(Enum.GetValues(s_uintPtrEnumType), Enum.GetValues(s_uintPtrEnumType)); + } + + [Fact] + public static void GetValues_NullEnumType_ThrowsArgumentNullException() + { + AssertExtensions.Throws("enumType", () => Enum.GetValues(null)); + } + + [Theory] + [InlineData(typeof(object))] + [InlineData(typeof(int))] + [InlineData(typeof(ValueType))] + [InlineData(typeof(Enum))] + public void GetValues_EnumTypeNotEnum_ThrowsArgumentException(Type enumType) { - AssertExtensions.Throws("enumType", () => Enum.GetValues(null)); // Enum type is null - AssertExtensions.Throws("enumType", () => Enum.GetValues(typeof(object))); // Enum type is not an enum + AssertExtensions.Throws("enumType", () => Enum.GetValues(enumType)); } public static IEnumerable ToString_Format_TestData() diff --git a/src/libraries/System.Runtime/tests/System/NullableMetadataTests.cs b/src/libraries/System.Runtime/tests/System/NullableMetadataTests.cs index 355d54f5972c..d2f7856dfc43 100644 --- a/src/libraries/System.Runtime/tests/System/NullableMetadataTests.cs +++ b/src/libraries/System.Runtime/tests/System/NullableMetadataTests.cs @@ -128,12 +128,15 @@ public static void NullableAttributesOnPublicApiOnly(Type type) Assert.True(foundAtLeastOneNullableAttribute); } - [Fact] - public static void ShimsHaveOnlyTypeForwards() + [Theory] + [InlineData("mscorlib")] + [InlineData("System.Threading.Overlapped")] + public static void ShimsHaveOnlyTypeForwards(string assemblyName) { - Assembly assembly = Assembly.Load("mscorlib"); + Assembly assembly = Assembly.Load(assemblyName); Assert.Empty(assembly.GetTypes()); + Assert.Empty(assembly.GetManifestResourceNames()); Assert.NotEmpty(assembly.GetForwardedTypes()); } diff --git a/src/libraries/System.Runtime/tests/System/Reflection/InvokeRefReturn.cs b/src/libraries/System.Runtime/tests/System/Reflection/InvokeRefReturn.cs index 885e17992c17..ee28dd51c2e3 100644 --- a/src/libraries/System.Runtime/tests/System/Reflection/InvokeRefReturn.cs +++ b/src/libraries/System.Runtime/tests/System/Reflection/InvokeRefReturn.cs @@ -59,6 +59,7 @@ public static unsafe void TestRefReturnOfPointer() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39380", TestPlatforms.Browser)] public static unsafe void TestNullRefReturnOfPointer() { TestClassIntPointer tc = new TestClassIntPointer(null); diff --git a/src/libraries/System.Runtime/tests/System/Runtime/ExceptionServices/ExceptionDispatchInfoTests.cs b/src/libraries/System.Runtime/tests/System/Runtime/ExceptionServices/ExceptionDispatchInfoTests.cs index c2bb2bdc48cd..c3242a0197cf 100644 --- a/src/libraries/System.Runtime/tests/System/Runtime/ExceptionServices/ExceptionDispatchInfoTests.cs +++ b/src/libraries/System.Runtime/tests/System/Runtime/ExceptionServices/ExceptionDispatchInfoTests.cs @@ -49,6 +49,7 @@ public static void SetCurrentStackTrace_Invalid_Throws() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39341", TestPlatforms.Browser)] public static void SetCurrentStackTrace_IncludedInExceptionStackTrace() { Exception e; diff --git a/src/libraries/System.Runtime/tests/System/Runtime/Serialization/SerializationExceptionTests.cs b/src/libraries/System.Runtime/tests/System/Runtime/Serialization/SerializationExceptionTests.cs index 6f92853b17d4..9f140c686eb9 100644 --- a/src/libraries/System.Runtime/tests/System/Runtime/Serialization/SerializationExceptionTests.cs +++ b/src/libraries/System.Runtime/tests/System/Runtime/Serialization/SerializationExceptionTests.cs @@ -42,7 +42,7 @@ public void Ctor_String_Exception(string message) Assert.Equal(COR_E_SERIALIZATION, exception.HResult); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] public void Ctor_SerializationInfo_StreamingContext() { using (var memoryStream = new MemoryStream()) diff --git a/src/libraries/System.Runtime/tests/System/StringTests.cs b/src/libraries/System.Runtime/tests/System/StringTests.cs index c9e8789008e5..dabb22f2027c 100644 --- a/src/libraries/System.Runtime/tests/System/StringTests.cs +++ b/src/libraries/System.Runtime/tests/System/StringTests.cs @@ -204,80 +204,101 @@ public static void Contains_Char_StringComparison(string s, char value, StringCo Assert.Equal(expected, s.Contains(value, comparisionType)); } + public static IEnumerable Contains_String_StringComparison_TestData() + { + yield return new object[] { "Hello", "ello", StringComparison.CurrentCulture, true }; + yield return new object[] { "Hello", "ELL", StringComparison.CurrentCulture, false }; + yield return new object[] { "Hello", "ElLo", StringComparison.CurrentCulture, false }; + yield return new object[] { "Hello", "Larger Hello", StringComparison.CurrentCulture, false }; + yield return new object[] { "Hello", "Goodbye", StringComparison.CurrentCulture, false }; + yield return new object[] { "", "", StringComparison.CurrentCulture, true }; + yield return new object[] { "", "hello", StringComparison.CurrentCulture, false }; + yield return new object[] { "Hello", "", StringComparison.CurrentCulture, true }; + yield return new object[] { "Hello", "Ell" + SoftHyphen, StringComparison.CurrentCulture, false }; + + if (PlatformDetection.IsNotInvariantGlobalization) + yield return new object[] { "Hello", "ell" + SoftHyphen, StringComparison.CurrentCulture, true }; + + // CurrentCultureIgnoreCase + yield return new object[] { "Hello", "ello", StringComparison.CurrentCultureIgnoreCase, true }; + yield return new object[] { "Hello", "ELL", StringComparison.CurrentCultureIgnoreCase, true }; + yield return new object[] { "Hello", "ElLo", StringComparison.CurrentCultureIgnoreCase, true }; + yield return new object[] { "Hello", "Larger Hello", StringComparison.CurrentCultureIgnoreCase, false }; + yield return new object[] { "Hello", "Goodbye", StringComparison.CurrentCultureIgnoreCase, false }; + yield return new object[] { "", "", StringComparison.CurrentCultureIgnoreCase, true }; + yield return new object[] { "", "hello", StringComparison.CurrentCultureIgnoreCase, false }; + yield return new object[] { "Hello", "", StringComparison.CurrentCultureIgnoreCase, true }; + + if (PlatformDetection.IsNotInvariantGlobalization) + { + yield return new object[] { "Hello", "ell" + SoftHyphen, StringComparison.CurrentCultureIgnoreCase, true }; + yield return new object[] { "Hello", "Ell" + SoftHyphen, StringComparison.CurrentCultureIgnoreCase, true }; + } + + // InvariantCulture + yield return new object[] { "Hello", "ello", StringComparison.InvariantCulture, true }; + yield return new object[] { "Hello", "ELL", StringComparison.InvariantCulture, false }; + yield return new object[] { "Hello", "ElLo", StringComparison.InvariantCulture, false }; + yield return new object[] { "Hello", "Larger Hello", StringComparison.InvariantCulture, false }; + yield return new object[] { "Hello", "Goodbye", StringComparison.InvariantCulture, false }; + yield return new object[] { "", "", StringComparison.InvariantCulture, true }; + yield return new object[] { "", "hello", StringComparison.InvariantCulture, false }; + yield return new object[] { "Hello", "", StringComparison.InvariantCulture, true }; + yield return new object[] { "Hello", "Ell" + SoftHyphen, StringComparison.InvariantCulture, false }; + + if (PlatformDetection.IsNotInvariantGlobalization) + yield return new object[] { "Hello", "ell" + SoftHyphen, StringComparison.InvariantCulture, true }; + + // InvariantCultureIgnoreCase + yield return new object[] { "Hello", "ello", StringComparison.InvariantCultureIgnoreCase, true }; + yield return new object[] { "Hello", "ELL", StringComparison.InvariantCultureIgnoreCase, true }; + yield return new object[] { "Hello", "ElLo", StringComparison.InvariantCultureIgnoreCase, true }; + yield return new object[] { "Hello", "Larger Hello", StringComparison.InvariantCultureIgnoreCase, false }; + yield return new object[] { "Hello", "Goodbye", StringComparison.InvariantCultureIgnoreCase, false }; + yield return new object[] { "", "", StringComparison.InvariantCultureIgnoreCase, true }; + yield return new object[] { "", "hello", StringComparison.InvariantCultureIgnoreCase, false }; + yield return new object[] { "Hello", "", StringComparison.InvariantCultureIgnoreCase, true }; + + if (PlatformDetection.IsNotInvariantGlobalization) + { + yield return new object[] { "Hello", "ell" + SoftHyphen, StringComparison.InvariantCultureIgnoreCase, true }; + yield return new object[] { "Hello", "Ell" + SoftHyphen, StringComparison.InvariantCultureIgnoreCase, true }; + } + + // Ordinal + yield return new object[] { "Hello", "ello", StringComparison.Ordinal, true }; + yield return new object[] { "Hello", "ELL", StringComparison.Ordinal, false }; + yield return new object[] { "Hello", "ElLo", StringComparison.Ordinal, false }; + yield return new object[] { "Hello", "Larger Hello", StringComparison.Ordinal, false }; + yield return new object[] { "Hello", "Goodbye", StringComparison.Ordinal, false }; + yield return new object[] { "", "", StringComparison.Ordinal, true }; + yield return new object[] { "", "hello", StringComparison.Ordinal, false }; + yield return new object[] { "Hello", "", StringComparison.Ordinal, true }; + yield return new object[] { "Hello", "ell" + SoftHyphen, StringComparison.Ordinal, false }; + yield return new object[] { "Hello", "Ell" + SoftHyphen, StringComparison.Ordinal, false }; + + // OrdinalIgnoreCase + yield return new object[] { "Hello", "ello", StringComparison.OrdinalIgnoreCase, true }; + yield return new object[] { "Hello", "ELL", StringComparison.OrdinalIgnoreCase, true }; + yield return new object[] { "Hello", "ElLo", StringComparison.OrdinalIgnoreCase, true }; + yield return new object[] { "Hello", "Larger Hello", StringComparison.OrdinalIgnoreCase, false }; + yield return new object[] { "Hello", "Goodbye", StringComparison.OrdinalIgnoreCase, false }; + yield return new object[] { "", "", StringComparison.OrdinalIgnoreCase, true }; + yield return new object[] { "", "hello", StringComparison.OrdinalIgnoreCase, false }; + yield return new object[] { "Hello", "", StringComparison.OrdinalIgnoreCase, true }; + yield return new object[] { "Hello", "ell" + SoftHyphen, StringComparison.OrdinalIgnoreCase, false }; + yield return new object[] { "Hello", "Ell" + SoftHyphen, StringComparison.OrdinalIgnoreCase, false }; + } + [Theory] - // CurrentCulture - [InlineData("Hello", "ello", StringComparison.CurrentCulture, true)] - [InlineData("Hello", "ELL", StringComparison.CurrentCulture, false)] - [InlineData("Hello", "ElLo", StringComparison.CurrentCulture, false)] - [InlineData("Hello", "Larger Hello", StringComparison.CurrentCulture, false)] - [InlineData("Hello", "Goodbye", StringComparison.CurrentCulture, false)] - [InlineData("", "", StringComparison.CurrentCulture, true)] - [InlineData("", "hello", StringComparison.CurrentCulture, false)] - [InlineData("Hello", "", StringComparison.CurrentCulture, true)] - [InlineData("Hello", "ell" + SoftHyphen, StringComparison.CurrentCulture, true)] - [InlineData("Hello", "Ell" + SoftHyphen, StringComparison.CurrentCulture, false)] - // CurrentCultureIgnoreCase - [InlineData("Hello", "ello", StringComparison.CurrentCultureIgnoreCase, true)] - [InlineData("Hello", "ELL", StringComparison.CurrentCultureIgnoreCase, true)] - [InlineData("Hello", "ElLo", StringComparison.CurrentCultureIgnoreCase, true)] - [InlineData("Hello", "Larger Hello", StringComparison.CurrentCultureIgnoreCase, false)] - [InlineData("Hello", "Goodbye", StringComparison.CurrentCultureIgnoreCase, false)] - [InlineData("", "", StringComparison.CurrentCultureIgnoreCase, true)] - [InlineData("", "hello", StringComparison.CurrentCultureIgnoreCase, false)] - [InlineData("Hello", "", StringComparison.CurrentCultureIgnoreCase, true)] - [InlineData("Hello", "ell" + SoftHyphen, StringComparison.CurrentCultureIgnoreCase, true)] - [InlineData("Hello", "Ell" + SoftHyphen, StringComparison.CurrentCultureIgnoreCase, true)] - // InvariantCulture - [InlineData("Hello", "ello", StringComparison.InvariantCulture, true)] - [InlineData("Hello", "ELL", StringComparison.InvariantCulture, false)] - [InlineData("Hello", "ElLo", StringComparison.InvariantCulture, false)] - [InlineData("Hello", "Larger Hello", StringComparison.InvariantCulture, false)] - [InlineData("Hello", "Goodbye", StringComparison.InvariantCulture, false)] - [InlineData("", "", StringComparison.InvariantCulture, true)] - [InlineData("", "hello", StringComparison.InvariantCulture, false)] - [InlineData("Hello", "", StringComparison.InvariantCulture, true)] - [InlineData("Hello", "ell" + SoftHyphen, StringComparison.InvariantCulture, true)] - [InlineData("Hello", "Ell" + SoftHyphen, StringComparison.InvariantCulture, false)] - // InvariantCultureIgnoreCase - [InlineData("Hello", "ello", StringComparison.InvariantCultureIgnoreCase, true)] - [InlineData("Hello", "ELL", StringComparison.InvariantCultureIgnoreCase, true)] - [InlineData("Hello", "ElLo", StringComparison.InvariantCultureIgnoreCase, true)] - [InlineData("Hello", "Larger Hello", StringComparison.InvariantCultureIgnoreCase, false)] - [InlineData("Hello", "Goodbye", StringComparison.InvariantCultureIgnoreCase, false)] - [InlineData("", "", StringComparison.InvariantCultureIgnoreCase, true)] - [InlineData("", "hello", StringComparison.InvariantCultureIgnoreCase, false)] - [InlineData("Hello", "", StringComparison.InvariantCultureIgnoreCase, true)] - [InlineData("Hello", "ell" + SoftHyphen, StringComparison.InvariantCultureIgnoreCase, true)] - [InlineData("Hello", "Ell" + SoftHyphen, StringComparison.InvariantCultureIgnoreCase, true)] - // Ordinal - [InlineData("Hello", "ello", StringComparison.Ordinal, true)] - [InlineData("Hello", "ELL", StringComparison.Ordinal, false)] - [InlineData("Hello", "ElLo", StringComparison.Ordinal, false)] - [InlineData("Hello", "Larger Hello", StringComparison.Ordinal, false)] - [InlineData("Hello", "Goodbye", StringComparison.Ordinal, false)] - [InlineData("", "", StringComparison.Ordinal, true)] - [InlineData("", "hello", StringComparison.Ordinal, false)] - [InlineData("Hello", "", StringComparison.Ordinal, true)] - [InlineData("Hello", "ell" + SoftHyphen, StringComparison.Ordinal, false)] - [InlineData("Hello", "Ell" + SoftHyphen, StringComparison.Ordinal, false)] - // OrdinalIgnoreCase - [InlineData("Hello", "ello", StringComparison.OrdinalIgnoreCase, true)] - [InlineData("Hello", "ELL", StringComparison.OrdinalIgnoreCase, true)] - [InlineData("Hello", "ElLo", StringComparison.OrdinalIgnoreCase, true)] - [InlineData("Hello", "Larger Hello", StringComparison.OrdinalIgnoreCase, false)] - [InlineData("Hello", "Goodbye", StringComparison.OrdinalIgnoreCase, false)] - [InlineData("", "", StringComparison.OrdinalIgnoreCase, true)] - [InlineData("", "hello", StringComparison.OrdinalIgnoreCase, false)] - [InlineData("Hello", "", StringComparison.OrdinalIgnoreCase, true)] - [InlineData("Hello", "ell" + SoftHyphen, StringComparison.OrdinalIgnoreCase, false)] - [InlineData("Hello", "Ell" + SoftHyphen, StringComparison.OrdinalIgnoreCase, false)] + [MemberData(nameof(Contains_String_StringComparison_TestData))] public static void Contains_String_StringComparison(string s, string value, StringComparison comparisonType, bool expected) { Assert.Equal(expected, s.Contains(value, comparisonType)); Assert.Equal(expected, s.AsSpan().Contains(value, comparisonType)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public static void Contains_StringComparison_TurkishI() { const string Source = "\u0069\u0130"; @@ -593,7 +614,9 @@ public static IEnumerable Replace_StringComparison_TestData() yield return new object[] { "abc", "b", "LONG", StringComparison.CurrentCulture, "aLONGc" }; yield return new object[] { "abc", "b", "d", StringComparison.CurrentCulture, "adc" }; yield return new object[] { "abc", "b", null, StringComparison.CurrentCulture, "ac" }; - yield return new object[] { "abc", "abc" + SoftHyphen, "def", StringComparison.CurrentCulture, "def" }; + + if (PlatformDetection.IsNotInvariantGlobalization) + yield return new object[] { "abc", "abc" + SoftHyphen, "def", StringComparison.CurrentCulture, "def" }; yield return new object[] { "abc", "abc", "def", StringComparison.CurrentCultureIgnoreCase, "def" }; yield return new object[] { "abc", "ABC", "def", StringComparison.CurrentCultureIgnoreCase, "def" }; @@ -601,7 +624,9 @@ public static IEnumerable Replace_StringComparison_TestData() yield return new object[] { "abc", "b", "LONG", StringComparison.CurrentCultureIgnoreCase, "aLONGc" }; yield return new object[] { "abc", "b", "d", StringComparison.CurrentCultureIgnoreCase, "adc" }; yield return new object[] { "abc", "b", null, StringComparison.CurrentCultureIgnoreCase, "ac" }; - yield return new object[] { "abc", "abc" + SoftHyphen, "def", StringComparison.CurrentCultureIgnoreCase, "def" }; + + if (PlatformDetection.IsNotInvariantGlobalization) + yield return new object[] { "abc", "abc" + SoftHyphen, "def", StringComparison.CurrentCultureIgnoreCase, "def" }; yield return new object[] { "abc", "abc", "def", StringComparison.Ordinal, "def" }; yield return new object[] { "abc", "ABC", "def", StringComparison.Ordinal, "abc" }; @@ -609,7 +634,9 @@ public static IEnumerable Replace_StringComparison_TestData() yield return new object[] { "abc", "b", "LONG", StringComparison.Ordinal, "aLONGc" }; yield return new object[] { "abc", "b", "d", StringComparison.Ordinal, "adc" }; yield return new object[] { "abc", "b", null, StringComparison.Ordinal, "ac" }; - yield return new object[] { "abc", "abc" + SoftHyphen, "def", StringComparison.Ordinal, "abc" }; + + if (PlatformDetection.IsNotInvariantGlobalization) + yield return new object[] { "abc", "abc" + SoftHyphen, "def", StringComparison.Ordinal, "abc" }; yield return new object[] { "abc", "abc", "def", StringComparison.OrdinalIgnoreCase, "def" }; yield return new object[] { "abc", "ABC", "def", StringComparison.OrdinalIgnoreCase, "def" }; @@ -617,7 +644,10 @@ public static IEnumerable Replace_StringComparison_TestData() yield return new object[] { "abc", "b", "LONG", StringComparison.OrdinalIgnoreCase, "aLONGc" }; yield return new object[] { "abc", "b", "d", StringComparison.OrdinalIgnoreCase, "adc" }; yield return new object[] { "abc", "b", null, StringComparison.OrdinalIgnoreCase, "ac" }; - yield return new object[] { "abc", "abc" + SoftHyphen, "def", StringComparison.OrdinalIgnoreCase, "abc" }; + + + if (PlatformDetection.IsNotInvariantGlobalization) + yield return new object[] { "abc", "abc" + SoftHyphen, "def", StringComparison.OrdinalIgnoreCase, "abc" }; yield return new object[] { "abc", "abc", "def", StringComparison.InvariantCulture, "def" }; yield return new object[] { "abc", "ABC", "def", StringComparison.InvariantCulture, "abc" }; @@ -625,7 +655,10 @@ public static IEnumerable Replace_StringComparison_TestData() yield return new object[] { "abc", "b", "LONG", StringComparison.InvariantCulture, "aLONGc" }; yield return new object[] { "abc", "b", "d", StringComparison.InvariantCulture, "adc" }; yield return new object[] { "abc", "b", null, StringComparison.InvariantCulture, "ac" }; - yield return new object[] { "abc", "abc" + SoftHyphen, "def", StringComparison.InvariantCulture, "def" }; + + + if (PlatformDetection.IsNotInvariantGlobalization) + yield return new object[] { "abc", "abc" + SoftHyphen, "def", StringComparison.InvariantCulture, "def" }; yield return new object[] { "abc", "abc", "def", StringComparison.InvariantCultureIgnoreCase, "def" }; yield return new object[] { "abc", "ABC", "def", StringComparison.InvariantCultureIgnoreCase, "def" }; @@ -633,19 +666,24 @@ public static IEnumerable Replace_StringComparison_TestData() yield return new object[] { "abc", "b", "LONG", StringComparison.InvariantCultureIgnoreCase, "aLONGc" }; yield return new object[] { "abc", "b", "d", StringComparison.InvariantCultureIgnoreCase, "adc" }; yield return new object[] { "abc", "b", null, StringComparison.InvariantCultureIgnoreCase, "ac" }; - yield return new object[] { "abc", "abc" + SoftHyphen, "def", StringComparison.InvariantCultureIgnoreCase, "def" }; - string turkishSource = "\u0069\u0130"; + + if (PlatformDetection.IsNotInvariantGlobalization) + { + yield return new object[] { "abc", "abc" + SoftHyphen, "def", StringComparison.InvariantCultureIgnoreCase, "def" }; + + string turkishSource = "\u0069\u0130"; - yield return new object[] { turkishSource, "\u0069", "a", StringComparison.Ordinal, "a\u0130" }; - yield return new object[] { turkishSource, "\u0069", "a", StringComparison.OrdinalIgnoreCase, "a\u0130" }; - yield return new object[] { turkishSource, "\u0130", "a", StringComparison.Ordinal, "\u0069a" }; - yield return new object[] { turkishSource, "\u0130", "a", StringComparison.OrdinalIgnoreCase, "\u0069a" }; + yield return new object[] { turkishSource, "\u0069", "a", StringComparison.Ordinal, "a\u0130" }; + yield return new object[] { turkishSource, "\u0069", "a", StringComparison.OrdinalIgnoreCase, "a\u0130" }; + yield return new object[] { turkishSource, "\u0130", "a", StringComparison.Ordinal, "\u0069a" }; + yield return new object[] { turkishSource, "\u0130", "a", StringComparison.OrdinalIgnoreCase, "\u0069a" }; - yield return new object[] { turkishSource, "\u0069", "a", StringComparison.InvariantCulture, "a\u0130" }; - yield return new object[] { turkishSource, "\u0069", "a", StringComparison.InvariantCultureIgnoreCase, "a\u0130" }; - yield return new object[] { turkishSource, "\u0130", "a", StringComparison.InvariantCulture, "\u0069a" }; - yield return new object[] { turkishSource, "\u0130", "a", StringComparison.InvariantCultureIgnoreCase, "\u0069a" }; + yield return new object[] { turkishSource, "\u0069", "a", StringComparison.InvariantCulture, "a\u0130" }; + yield return new object[] { turkishSource, "\u0069", "a", StringComparison.InvariantCultureIgnoreCase, "a\u0130" }; + yield return new object[] { turkishSource, "\u0130", "a", StringComparison.InvariantCulture, "\u0069a" }; + yield return new object[] { turkishSource, "\u0130", "a", StringComparison.InvariantCultureIgnoreCase, "\u0069a" }; + } } [Theory] @@ -655,7 +693,7 @@ public void Replace_StringComparison_ReturnsExpected(string original, string old Assert.Equal(expected, original.Replace(oldValue, newValue, comparisonType)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void Replace_StringComparison_TurkishI() { const string Source = "\u0069\u0130"; @@ -693,15 +731,18 @@ public static IEnumerable Replace_StringComparisonCulture_TestData() yield return new object[] { "abc", "abc", "def", true, CultureInfo.InvariantCulture, "def" }; yield return new object[] { "abc", "ABC", "def", true, CultureInfo.InvariantCulture, "def" }; - yield return new object[] { "abc", "abc" + SoftHyphen, "def", false, null, "def" }; - yield return new object[] { "abc", "abc" + SoftHyphen, "def", true, null, "def" }; - yield return new object[] { "abc", "abc" + SoftHyphen, "def", false, CultureInfo.InvariantCulture, "def" }; - yield return new object[] { "abc", "abc" + SoftHyphen, "def", true, CultureInfo.InvariantCulture, "def" }; - - yield return new object[] { "\u0069\u0130", "\u0069", "a", false, new CultureInfo("tr-TR"), "a\u0130" }; - yield return new object[] { "\u0069\u0130", "\u0069", "a", true, new CultureInfo("tr-TR"), "aa" }; - yield return new object[] { "\u0069\u0130", "\u0069", "a", false, CultureInfo.InvariantCulture, "a\u0130" }; - yield return new object[] { "\u0069\u0130", "\u0069", "a", true, CultureInfo.InvariantCulture, "a\u0130" }; + if (PlatformDetection.IsNotInvariantGlobalization) + { + yield return new object[] { "abc", "abc" + SoftHyphen, "def", false, null, "def" }; + yield return new object[] { "abc", "abc" + SoftHyphen, "def", true, null, "def" }; + yield return new object[] { "abc", "abc" + SoftHyphen, "def", false, CultureInfo.InvariantCulture, "def" }; + yield return new object[] { "abc", "abc" + SoftHyphen, "def", true, CultureInfo.InvariantCulture, "def" }; + + yield return new object[] { "\u0069\u0130", "\u0069", "a", false, new CultureInfo("tr-TR"), "a\u0130" }; + yield return new object[] { "\u0069\u0130", "\u0069", "a", true, new CultureInfo("tr-TR"), "aa" }; + yield return new object[] { "\u0069\u0130", "\u0069", "a", false, CultureInfo.InvariantCulture, "a\u0130" }; + yield return new object[] { "\u0069\u0130", "\u0069", "a", true, CultureInfo.InvariantCulture, "a\u0130" }; + } } [Theory] @@ -729,7 +770,7 @@ public void Replace_StringComparison_EmptyOldValue_ThrowsArgumentException() AssertExtensions.Throws("oldValue", () => "abc".Replace("", "def", true, CultureInfo.CurrentCulture)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void Replace_StringComparison_WeightlessOldValue_WithOrdinalComparison_Succeeds() { Assert.Equal("abcdef", ("abc" + ZeroWidthJoiner).Replace(ZeroWidthJoiner, "def")); @@ -737,7 +778,7 @@ public void Replace_StringComparison_WeightlessOldValue_WithOrdinalComparison_Su Assert.Equal("abcdef", ("abc" + ZeroWidthJoiner).Replace(ZeroWidthJoiner, "def", StringComparison.OrdinalIgnoreCase)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public void Replace_StringComparison_WeightlessOldValue_WithLinguisticComparison_TerminatesReplacement() { Assert.Equal("abc" + ZeroWidthJoiner + "def", ("abc" + ZeroWidthJoiner + "def").Replace(ZeroWidthJoiner, "xyz", StringComparison.CurrentCulture)); @@ -971,7 +1012,7 @@ public static void IndexOf_SingleLetter_StringComparison(string s, char target, Assert.Equal(expected, s.AsSpan().IndexOf(charArray, stringComparison)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public static void IndexOf_TurkishI_TurkishCulture_Char() { using (new ThreadCultureChange("tr-TR")) @@ -1003,7 +1044,7 @@ public static void IndexOf_TurkishI_TurkishCulture_Char() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public static void IndexOf_TurkishI_InvariantCulture_Char() { using (new ThreadCultureChange(CultureInfo.InvariantCulture)) @@ -1021,7 +1062,7 @@ public static void IndexOf_TurkishI_InvariantCulture_Char() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public static void IndexOf_TurkishI_EnglishUSCulture_Char() { using (new ThreadCultureChange("en-US")) @@ -1039,7 +1080,7 @@ public static void IndexOf_TurkishI_EnglishUSCulture_Char() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] public static void IndexOf_EquivalentDiacritics_EnglishUSCulture_Char() { string s = "Exhibit a\u0300\u00C0"; @@ -1065,7 +1106,7 @@ public static void IndexOf_EquivalentDiacritics_InvariantCulture_Char() { Assert.Equal(10, s.IndexOf(value)); Assert.Equal(10, s.IndexOf(value, StringComparison.CurrentCulture)); - Assert.Equal(8, s.IndexOf(value, StringComparison.CurrentCultureIgnoreCase)); + Assert.Equal(PlatformDetection.IsInvariantGlobalization ? 10 : 8, s.IndexOf(value, StringComparison.CurrentCultureIgnoreCase)); } } diff --git a/src/libraries/System.Runtime/tests/System/TimeSpanTests.cs b/src/libraries/System.Runtime/tests/System/TimeSpanTests.cs index 296cc923173f..f538d8cccd32 100644 --- a/src/libraries/System.Runtime/tests/System/TimeSpanTests.cs +++ b/src/libraries/System.Runtime/tests/System/TimeSpanTests.cs @@ -608,9 +608,12 @@ public static IEnumerable Parse_Valid_TestData() yield return new object[] { "23:00:00", null, new TimeSpan(23, 0, 0) }; yield return new object[] { "24:00:00", null, new TimeSpan(24, 0, 0, 0) }; - // Croatia uses ',' in place of '.' - CultureInfo croatianCulture = new CultureInfo("hr-HR"); - yield return new object[] { "6:12:14:45,348", croatianCulture, new TimeSpan(6, 12, 14, 45, 348) }; + if (PlatformDetection.IsNotInvariantGlobalization) + { + // Croatia uses ',' in place of '.' + CultureInfo croatianCulture = new CultureInfo("hr-HR"); + yield return new object[] { "6:12:14:45,348", croatianCulture, new TimeSpan(6, 12, 14, 45, 348) }; + } } [Theory] @@ -655,7 +658,9 @@ public static IEnumerable Parse_Invalid_TestData() yield return new object[] { "00:00::00", null, typeof(FormatException) }; // duplicated separator yield return new object[] { "00:00:00:", null, typeof(FormatException) }; // extra separator at end yield return new object[] { "00:00:00:00:00:00:00:00", null, typeof(FormatException) }; // too many components - yield return new object[] { "6:12:14:45.3448", new CultureInfo("hr-HR"), typeof(FormatException) }; // culture that uses ',' rather than '.' + + if (PlatformDetection.IsNotInvariantGlobalization) + yield return new object[] { "6:12:14:45.3448", new CultureInfo("hr-HR"), typeof(FormatException) }; // culture that uses ',' rather than '.' // OverflowExceptions yield return new object[] { "1:1:1.99999999", null, typeof(OverflowException) }; // overflowing fraction @@ -956,7 +961,8 @@ public static IEnumerable ToString_TestData() yield return new object[] { input, "dddddd\\.ss", invariantInfo, "000142.18" }; // constant/invariant format - foreach (CultureInfo info in new[] { null, invariantInfo, commaSeparatorInfo }) // validate that culture is ignored + CultureInfo[] cultureInfos = PlatformDetection.IsInvariantGlobalization ? new[] { (CultureInfo)null } : new[] { null, invariantInfo, commaSeparatorInfo }; + foreach (CultureInfo info in cultureInfos) // validate that culture is ignored { foreach (string constFormat in new[] { null, "c", "t", "T" }) { @@ -989,19 +995,22 @@ public static IEnumerable ToString_TestData() yield return new object[] { new TimeSpan(12, 34, 56, 23, 45), "g", invariantInfo, "13:10:56:23.045" }; yield return new object[] { new TimeSpan(0, 23, 59, 59, 999), "g", invariantInfo, "23:59:59.999" }; - // general short format, NumberDecimalSeparator used - yield return new object[] { input, "g", commaSeparatorInfo, "142:21:21:18,9101112" }; - yield return new object[] { TimeSpan.Zero, "g", commaSeparatorInfo, "0:00:00" }; - yield return new object[] { new TimeSpan(1), "g", commaSeparatorInfo, "0:00:00,0000001" }; - yield return new object[] { new TimeSpan(-1), "g", commaSeparatorInfo, "-0:00:00,0000001" }; - yield return new object[] { TimeSpan.MaxValue, "g", commaSeparatorInfo, "10675199:2:48:05,4775807" }; - yield return new object[] { TimeSpan.MinValue, "g", commaSeparatorInfo, "-10675199:2:48:05,4775808" }; - yield return new object[] { new TimeSpan(1, 2, 3), "g", commaSeparatorInfo, "1:02:03" }; - yield return new object[] { -new TimeSpan(1, 2, 3), "g", commaSeparatorInfo, "-1:02:03" }; - yield return new object[] { new TimeSpan(12, 34, 56), "g", commaSeparatorInfo, "12:34:56" }; - yield return new object[] { new TimeSpan(12, 34, 56, 23), "g", commaSeparatorInfo, "13:10:56:23" }; - yield return new object[] { new TimeSpan(12, 34, 56, 23, 45), "g", commaSeparatorInfo, "13:10:56:23,045" }; - yield return new object[] { new TimeSpan(0, 23, 59, 59, 999), "g", commaSeparatorInfo, "23:59:59,999" }; + if (PlatformDetection.IsNotInvariantGlobalization) + { + // general short format, NumberDecimalSeparator used + yield return new object[] { input, "g", commaSeparatorInfo, "142:21:21:18,9101112" }; + yield return new object[] { TimeSpan.Zero, "g", commaSeparatorInfo, "0:00:00" }; + yield return new object[] { new TimeSpan(1), "g", commaSeparatorInfo, "0:00:00,0000001" }; + yield return new object[] { new TimeSpan(-1), "g", commaSeparatorInfo, "-0:00:00,0000001" }; + yield return new object[] { TimeSpan.MaxValue, "g", commaSeparatorInfo, "10675199:2:48:05,4775807" }; + yield return new object[] { TimeSpan.MinValue, "g", commaSeparatorInfo, "-10675199:2:48:05,4775808" }; + yield return new object[] { new TimeSpan(1, 2, 3), "g", commaSeparatorInfo, "1:02:03" }; + yield return new object[] { -new TimeSpan(1, 2, 3), "g", commaSeparatorInfo, "-1:02:03" }; + yield return new object[] { new TimeSpan(12, 34, 56), "g", commaSeparatorInfo, "12:34:56" }; + yield return new object[] { new TimeSpan(12, 34, 56, 23), "g", commaSeparatorInfo, "13:10:56:23" }; + yield return new object[] { new TimeSpan(12, 34, 56, 23, 45), "g", commaSeparatorInfo, "13:10:56:23,045" }; + yield return new object[] { new TimeSpan(0, 23, 59, 59, 999), "g", commaSeparatorInfo, "23:59:59,999" }; + } // general long format, invariant culture yield return new object[] { input, "G", invariantInfo, "142:21:21:18.9101112" }; @@ -1017,19 +1026,22 @@ public static IEnumerable ToString_TestData() yield return new object[] { new TimeSpan(12, 34, 56, 23, 45), "G", invariantInfo, "13:10:56:23.0450000" }; yield return new object[] { new TimeSpan(0, 23, 59, 59, 999), "G", invariantInfo, "0:23:59:59.9990000" }; - // general long format, NumberDecimalSeparator used - yield return new object[] { input, "G", commaSeparatorInfo, "142:21:21:18,9101112" }; - yield return new object[] { TimeSpan.Zero, "G", commaSeparatorInfo, "0:00:00:00,0000000" }; - yield return new object[] { new TimeSpan(1), "G", commaSeparatorInfo, "0:00:00:00,0000001" }; - yield return new object[] { new TimeSpan(-1), "G", commaSeparatorInfo, "-0:00:00:00,0000001" }; - yield return new object[] { TimeSpan.MaxValue, "G", commaSeparatorInfo, "10675199:02:48:05,4775807" }; - yield return new object[] { TimeSpan.MinValue, "G", commaSeparatorInfo, "-10675199:02:48:05,4775808" }; - yield return new object[] { new TimeSpan(1, 2, 3), "G", commaSeparatorInfo, "0:01:02:03,0000000" }; - yield return new object[] { -new TimeSpan(1, 2, 3), "G", commaSeparatorInfo, "-0:01:02:03,0000000" }; - yield return new object[] { new TimeSpan(12, 34, 56), "G", commaSeparatorInfo, "0:12:34:56,0000000" }; - yield return new object[] { new TimeSpan(12, 34, 56, 23), "G", commaSeparatorInfo, "13:10:56:23,0000000" }; - yield return new object[] { new TimeSpan(12, 34, 56, 23, 45), "G", commaSeparatorInfo, "13:10:56:23,0450000" }; - yield return new object[] { new TimeSpan(0, 23, 59, 59, 999), "G", commaSeparatorInfo, "0:23:59:59,9990000" }; + if (PlatformDetection.IsNotInvariantGlobalization) + { + // general long format, NumberDecimalSeparator used + yield return new object[] { input, "G", commaSeparatorInfo, "142:21:21:18,9101112" }; + yield return new object[] { TimeSpan.Zero, "G", commaSeparatorInfo, "0:00:00:00,0000000" }; + yield return new object[] { new TimeSpan(1), "G", commaSeparatorInfo, "0:00:00:00,0000001" }; + yield return new object[] { new TimeSpan(-1), "G", commaSeparatorInfo, "-0:00:00:00,0000001" }; + yield return new object[] { TimeSpan.MaxValue, "G", commaSeparatorInfo, "10675199:02:48:05,4775807" }; + yield return new object[] { TimeSpan.MinValue, "G", commaSeparatorInfo, "-10675199:02:48:05,4775808" }; + yield return new object[] { new TimeSpan(1, 2, 3), "G", commaSeparatorInfo, "0:01:02:03,0000000" }; + yield return new object[] { -new TimeSpan(1, 2, 3), "G", commaSeparatorInfo, "-0:01:02:03,0000000" }; + yield return new object[] { new TimeSpan(12, 34, 56), "G", commaSeparatorInfo, "0:12:34:56,0000000" }; + yield return new object[] { new TimeSpan(12, 34, 56, 23), "G", commaSeparatorInfo, "13:10:56:23,0000000" }; + yield return new object[] { new TimeSpan(12, 34, 56, 23, 45), "G", commaSeparatorInfo, "13:10:56:23,0450000" }; + yield return new object[] { new TimeSpan(0, 23, 59, 59, 999), "G", commaSeparatorInfo, "0:23:59:59,9990000" }; + } } [Theory] diff --git a/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs b/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs index 547bb8045897..f7de15916263 100644 --- a/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs +++ b/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs @@ -1805,6 +1805,7 @@ public static void NewfoundlandTimeZone(string dateTimeString, bool expectedDST, } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39342", TestPlatforms.Browser)] public static void GetSystemTimeZones() { ReadOnlyCollection timeZones = TimeZoneInfo.GetSystemTimeZones(); @@ -2164,7 +2165,7 @@ public static void ToSerializedString_FromSerializedString_RoundTrips(TimeZoneIn Assert.Equal(serialized, deserializedTimeZone.ToSerializedString()); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] [MemberData(nameof(SystemTimeZonesTestData))] public static void BinaryFormatter_RoundTrips(TimeZoneInfo timeZone) { diff --git a/src/libraries/System.Runtime/tests/System/TupleTests.cs b/src/libraries/System.Runtime/tests/System/TupleTests.cs index 62f7c2cedcb6..f27a39ff4937 100644 --- a/src/libraries/System.Runtime/tests/System/TupleTests.cs +++ b/src/libraries/System.Runtime/tests/System/TupleTests.cs @@ -428,7 +428,7 @@ public static void CompareTo() tupleDriverB = new TupleTestDriver, TimeSpan>((short)1, (int)1, long.MinValue, "This"); tupleDriverC = new TupleTestDriver, TimeSpan>((short)1, (int)1, long.MinValue, "this"); tupleDriverA.CompareTo(tupleDriverB, 0, 5); - tupleDriverA.CompareTo(tupleDriverC, 1, 5); + tupleDriverA.CompareTo(tupleDriverC, PlatformDetection.IsInvariantGlobalization ? /* 'T'-'t' */ -32 : 1, 5); //Tuple-5 tupleDriverA = new TupleTestDriver, TimeSpan>((short)(-1), (int)(-1), (long)0, "is", 'A'); tupleDriverB = new TupleTestDriver, TimeSpan>((short)(-1), (int)(-1), (long)0, "is", 'A'); diff --git a/src/libraries/System.Runtime/tests/System/Type/TypeTests.cs b/src/libraries/System.Runtime/tests/System/Type/TypeTests.cs index b1a8e82c9f35..05236cc36cb7 100644 --- a/src/libraries/System.Runtime/tests/System/Type/TypeTests.cs +++ b/src/libraries/System.Runtime/tests/System/Type/TypeTests.cs @@ -191,8 +191,55 @@ public void GetArrayRank_NonArrayType_ThrowsArgumentException(Type t) AssertExtensions.Throws(null, () => t.GetArrayRank()); } + public static IEnumerable MakeArrayType_TestData() + { + return new object[][] + { + // Primitives + new object[] { typeof(string), typeof(string[]) }, + new object[] { typeof(sbyte), typeof(sbyte[]) }, + new object[] { typeof(byte), typeof(byte[]) }, + new object[] { typeof(short), typeof(short[]) }, + new object[] { typeof(ushort), typeof(ushort[]) }, + new object[] { typeof(int), typeof(int[]) }, + new object[] { typeof(uint), typeof(uint[]) }, + new object[] { typeof(long), typeof(long[]) }, + new object[] { typeof(ulong), typeof(ulong[]) }, + new object[] { typeof(char), typeof(char[]) }, + new object[] { typeof(bool), typeof(bool[]) }, + new object[] { typeof(float), typeof(float[]) }, + new object[] { typeof(double), typeof(double[]) }, + new object[] { typeof(IntPtr), typeof(IntPtr[]) }, + new object[] { typeof(UIntPtr), typeof(UIntPtr[]) }, + + // Primitives enums + new object[] { typeof(SByteEnum), typeof(SByteEnum[]) }, + new object[] { typeof(ByteEnum), typeof(ByteEnum[]) }, + new object[] { typeof(Int16Enum), typeof(Int16Enum[]) }, + new object[] { typeof(UInt16Enum), typeof(UInt16Enum[]) }, + new object[] { typeof(Int32Enum), typeof(Int32Enum[]) }, + new object[] { typeof(UInt32Enum), typeof(UInt32Enum[]) }, + new object[] { typeof(Int64Enum), typeof(Int64Enum[]) }, + new object[] { typeof(UInt64Enum), typeof(UInt64Enum[]) }, + + // Array, pointers + new object[] { typeof(string[]), typeof(string[][]) }, + new object[] { typeof(int[]), typeof(int[][]) }, + new object[] { typeof(int*), typeof(int*[]) }, + + // Classes, structs, interfaces, enums + new object[] { typeof(NonGenericClass), typeof(NonGenericClass[]) }, + new object[] { typeof(GenericClass), typeof(GenericClass[]) }, + new object[] { typeof(NonGenericStruct), typeof(NonGenericStruct[]) }, + new object[] { typeof(GenericStruct), typeof(GenericStruct[]) }, + new object[] { typeof(NonGenericInterface), typeof(NonGenericInterface[]) }, + new object[] { typeof(GenericInterface), typeof(GenericInterface[]) }, + new object[] { typeof(AbstractClass), typeof(AbstractClass[]) } + }; + } + [Theory] - [InlineData(typeof(int), typeof(int[]))] + [MemberData(nameof(MakeArrayType_TestData))] public void MakeArrayType_Invoke_ReturnsExpected(Type t, Type tArrayExpected) { Type tArray = t.MakeArrayType(); @@ -202,10 +249,101 @@ public void MakeArrayType_Invoke_ReturnsExpected(Type t, Type tArrayExpected) Assert.True(tArray.IsArray); Assert.True(tArray.HasElementType); + Assert.Equal(1, tArray.GetArrayRank()); - string s1 = t.ToString(); - string s2 = tArray.ToString(); - Assert.Equal(s2, s1 + "[]"); + Assert.Equal(t.ToString() + "[]", tArray.ToString()); + } + + public static IEnumerable MakeArray_UnusualTypes_TestData() + { + yield return new object[] { typeof(StaticClass) }; + yield return new object[] { typeof(void) }; + yield return new object[] { typeof(GenericClass<>) }; + yield return new object[] { typeof(GenericClass<>).MakeGenericType(typeof(GenericClass<>)) }; + yield return new object[] { typeof(GenericClass<>).GetTypeInfo().GetGenericArguments()[0] }; + } + + [Theory] + [MemberData(nameof(MakeArray_UnusualTypes_TestData))] + public void MakeArrayType_UnusualTypes_ReturnsExpected(Type t) + { + Type tArray = t.MakeArrayType(); + + Assert.Equal(t, tArray.GetElementType()); + + Assert.True(tArray.IsArray); + Assert.True(tArray.HasElementType); + Assert.Equal(1, tArray.GetArrayRank()); + + Assert.Equal(t.ToString() + "[]", tArray.ToString()); + } + + [Theory] + [MemberData(nameof(MakeArrayType_TestData))] + public void MakeArrayType_InvokeRankOne_ReturnsExpected(Type t, Type tArrayExpected) + { + Type tArray = t.MakeArrayType(1); + + Assert.NotEqual(tArrayExpected, tArray); + Assert.Equal(t, tArray.GetElementType()); + + Assert.True(tArray.IsArray); + Assert.True(tArray.HasElementType); + Assert.Equal(1, tArray.GetArrayRank()); + + Assert.Equal(t.ToString() + "[*]", tArray.ToString()); + } + + [Theory] + [MemberData(nameof(MakeArrayType_TestData))] + public void MakeArrayType_InvokeRankTwo_ReturnsExpected(Type t, Type tArrayExpected) + { + Type tArray = t.MakeArrayType(2); + + Assert.NotEqual(tArrayExpected, tArray); + Assert.Equal(t, tArray.GetElementType()); + + Assert.True(tArray.IsArray); + Assert.True(tArray.HasElementType); + Assert.Equal(2, tArray.GetArrayRank()); + + Assert.Equal(t.ToString() + "[,]", tArray.ToString()); + } + + public static IEnumerable MakeArrayType_ByRef_TestData() + { + yield return new object[] { typeof(int).MakeByRefType() }; + yield return new object[] { typeof(TypedReference) }; + yield return new object[] { typeof(ArgIterator) }; + yield return new object[] { typeof(RuntimeArgumentHandle) }; + yield return new object[] { typeof(Span) }; + } + + [Theory] + [MemberData(nameof(MakeArrayType_ByRef_TestData))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/39001", TestRuntimes.Mono)] + public void MakeArrayType_ByRef_ThrowsTypeLoadException(Type t) + { + Assert.Throws(() => t.MakeArrayType()); + } + + [Theory] + [InlineData(-1)] + [InlineData(0)] + public void MakeArrayType_NegativeOrZeroArrayRank_ThrowsIndexOutOfRangeException(int rank) + { + Type t = typeof(int); + Assert.Throws(() => t.MakeArrayType(rank)); + } + + [Theory] + [InlineData(33)] + [InlineData(256)] + [InlineData(257)] + public void MakeArrayType_InvalidArrayRank_ThrowsTypeLoadException(int rank) + { + Type t = typeof(int); + Assert.Throws(() => t.MakeArrayType(rank)); } [Theory] @@ -747,6 +885,7 @@ public class NonGenericSubClassOfGeneric : GenericClass { } public class GenericClass { } public abstract class AbstractClass { } + public static class StaticClass { } public struct NonGenericStruct { } diff --git a/src/libraries/System.Runtime/tests/System/UnitySerializationHolderTests.cs b/src/libraries/System.Runtime/tests/System/UnitySerializationHolderTests.cs index 67b6b11f3935..ca8cab3a1174 100644 --- a/src/libraries/System.Runtime/tests/System/UnitySerializationHolderTests.cs +++ b/src/libraries/System.Runtime/tests/System/UnitySerializationHolderTests.cs @@ -9,7 +9,7 @@ namespace System.Tests { public class UnitySerializationHolderTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))] public void UnitySerializationHolderWithAssemblySingleton() { const string UnitySerializationHolderAssemblyBase64String = "AAEAAAD/////AQAAAAAAAAAEAQAAAB9TeXN0ZW0uVW5pdHlTZXJpYWxpemF0aW9uSG9sZGVyAwAAAAREYXRhCVVuaXR5VHlwZQxBc3NlbWJseU5hbWUBAAEIBgIAAABLbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BgAAAAkCAAAACw=="; diff --git a/src/libraries/System.Runtime/tests/System/Uri.CreateStringTests.cs b/src/libraries/System.Runtime/tests/System/Uri.CreateStringTests.cs index 719039788612..9255f0b42e86 100644 --- a/src/libraries/System.Runtime/tests/System/Uri.CreateStringTests.cs +++ b/src/libraries/System.Runtime/tests/System/Uri.CreateStringTests.cs @@ -1234,9 +1234,12 @@ public static IEnumerable Create_String_Invalid_TestData() yield return new object[] { "uri://a:2147483648", UriKind.Absolute }; yield return new object[] { "uri://a:80:80", UriKind.Absolute }; - // Invalid unicode - yield return new object[] { "http://\uD800", UriKind.Absolute }; - yield return new object[] { "http://\uDC00", UriKind.Absolute }; + if (PlatformDetection.IsNotInvariantGlobalization) + { + // Invalid unicode + yield return new object[] { "http://\uD800", UriKind.Absolute }; + yield return new object[] { "http://\uDC00", UriKind.Absolute }; + } } [Theory] diff --git a/src/libraries/System.Runtime/tests/TrimmingTests/DebuggerTypeProxyAttributeTests.cs b/src/libraries/System.Runtime/tests/TrimmingTests/DebuggerTypeProxyAttributeTests.cs new file mode 100644 index 000000000000..b80f4a1d61b0 --- /dev/null +++ b/src/libraries/System.Runtime/tests/TrimmingTests/DebuggerTypeProxyAttributeTests.cs @@ -0,0 +1,73 @@ +using System; +using System.Diagnostics; + +/// +/// Tests that types used by DebuggerTypeProxyAttribute are not trimmed out +/// when Debugger.IsSupported is true (the default). +/// +class Program +{ + static int Main(string[] args) + { + MyClass myClass = new MyClass() { Name = "trimmed" }; + MyClassWithProxyString myClassWithString = new MyClassWithProxyString() { Name = "trimmed" }; + + Type[] allTypes = typeof(MyClass).Assembly.GetTypes(); + bool foundDebuggerProxy = false; + bool foundStringDebuggerProxy = false; + for (int i = 0; i < allTypes.Length; i++) + { + Type currentType = allTypes[i]; + if (currentType.FullName == "Program+MyClass+DebuggerProxy" && + currentType.GetProperties().Length == 1 && + currentType.GetConstructors().Length == 1) + { + foundDebuggerProxy = true; + } + else if (currentType.FullName == "Program+MyClassWithProxyStringProxy" && + currentType.GetProperties().Length == 1 && + currentType.GetConstructors().Length == 1) + { + foundStringDebuggerProxy = true; + } + } + + return foundDebuggerProxy && foundStringDebuggerProxy ? 100 : -1; + } + + [DebuggerTypeProxy(typeof(DebuggerProxy))] + public class MyClass + { + public string Name { get; set; } + + private class DebuggerProxy + { + private MyClass _instance; + + public DebuggerProxy(MyClass instance) + { + _instance = instance; + } + + public string DebuggerName => _instance.Name + " Proxy"; + } + } + + [DebuggerTypeProxy("Program+MyClassWithProxyStringProxy")] + public class MyClassWithProxyString + { + public string Name { get; set; } + } + + internal class MyClassWithProxyStringProxy + { + private MyClassWithProxyString _instance; + + public MyClassWithProxyStringProxy(MyClassWithProxyString instance) + { + _instance = instance; + } + + public string DebuggerName => _instance.Name + " StringProxy"; + } +} diff --git a/src/libraries/System.Runtime/tests/TrimmingTests/DefaultValueAttributeCtorTest.cs b/src/libraries/System.Runtime/tests/TrimmingTests/DefaultValueAttributeCtorTest.cs index 1d9a6ec40126..0aa104fb79f9 100644 --- a/src/libraries/System.Runtime/tests/TrimmingTests/DefaultValueAttributeCtorTest.cs +++ b/src/libraries/System.Runtime/tests/TrimmingTests/DefaultValueAttributeCtorTest.cs @@ -13,6 +13,10 @@ class Program { static int Main(string[] args) { + // workaround TypeConverterAttribute not being annotated correctly + // https://github.com/dotnet/runtime/issues/39125 + var _ = new MyStringConverter(); + TypeDescriptor.AddAttributes(typeof(string), new TypeConverterAttribute(typeof(MyStringConverter))); var attribute = new DefaultValueAttribute(typeof(string), "Hello, world!"); diff --git a/src/libraries/System.Runtime/tests/TrimmingTests/System.Runtime.TrimmingTests.proj b/src/libraries/System.Runtime/tests/TrimmingTests/System.Runtime.TrimmingTests.proj index cfd1a4d2a7b8..ce96e07448a3 100644 --- a/src/libraries/System.Runtime/tests/TrimmingTests/System.Runtime.TrimmingTests.proj +++ b/src/libraries/System.Runtime/tests/TrimmingTests/System.Runtime.TrimmingTests.proj @@ -6,6 +6,8 @@ osx-x64;linux-x64 + + + net461 + + + @@ -19,4 +28,8 @@ + + + + diff --git a/src/libraries/System.Security.Cryptography.OpenSsl/ref/System.Security.Cryptography.OpenSsl.netcoreapp.cs b/src/libraries/System.Security.Cryptography.OpenSsl/ref/System.Security.Cryptography.OpenSsl.netcoreapp.cs new file mode 100644 index 000000000000..e8a0b899af64 --- /dev/null +++ b/src/libraries/System.Security.Cryptography.OpenSsl/ref/System.Security.Cryptography.OpenSsl.netcoreapp.cs @@ -0,0 +1,36 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// ------------------------------------------------------------------------------ +// Changes to this file must follow the https://aka.ms/api-review process. +// ------------------------------------------------------------------------------ + +namespace System.Security.Cryptography +{ + public sealed partial class DSAOpenSsl : System.Security.Cryptography.DSA + { + protected override byte[] HashData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + protected override byte[] HashData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + } + public sealed partial class ECDiffieHellmanOpenSsl : System.Security.Cryptography.ECDiffieHellman + { + public ECDiffieHellmanOpenSsl() { } + public ECDiffieHellmanOpenSsl(int keySize) { } + public ECDiffieHellmanOpenSsl(System.IntPtr handle) { } + public ECDiffieHellmanOpenSsl(System.Security.Cryptography.ECCurve curve) { } + public ECDiffieHellmanOpenSsl(System.Security.Cryptography.SafeEvpPKeyHandle pkeyHandle) { } + public override System.Security.Cryptography.ECDiffieHellmanPublicKey PublicKey { get { throw null; } } + public override byte[] DeriveKeyFromHash(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[]? secretPrepend, byte[]? secretAppend) { throw null; } + public override byte[] DeriveKeyFromHmac(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[]? hmacKey, byte[]? secretPrepend, byte[]? secretAppend) { throw null; } + public override byte[] DeriveKeyMaterial(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey) { throw null; } + public override byte[] DeriveKeyTls(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, byte[] prfLabel, byte[] prfSeed) { throw null; } + public System.Security.Cryptography.SafeEvpPKeyHandle DuplicateKeyHandle() { throw null; } + public override System.Security.Cryptography.ECParameters ExportExplicitParameters(bool includePrivateParameters) { throw null; } + public override System.Security.Cryptography.ECParameters ExportParameters(bool includePrivateParameters) { throw null; } + public override void GenerateKey(System.Security.Cryptography.ECCurve curve) { } + public override void ImportParameters(System.Security.Cryptography.ECParameters parameters) { } + } + public sealed partial class SafeEvpPKeyHandle : System.Runtime.InteropServices.SafeHandle + { + public static long OpenSslVersion { get { throw null; } } + } +} diff --git a/src/libraries/System.Security.Cryptography.OpenSsl/src/System.Security.Cryptography.OpenSsl.csproj b/src/libraries/System.Security.Cryptography.OpenSsl/src/System.Security.Cryptography.OpenSsl.csproj index a616892525e4..1edf80722b5e 100644 --- a/src/libraries/System.Security.Cryptography.OpenSsl/src/System.Security.Cryptography.OpenSsl.csproj +++ b/src/libraries/System.Security.Cryptography.OpenSsl/src/System.Security.Cryptography.OpenSsl.csproj @@ -1,13 +1,17 @@ true - $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent);netcoreapp3.0-Unix;netcoreapp3.0;netstandard2.0 + $(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent);netcoreapp3.0-Unix;netcoreapp3.0;netstandard2.0;net47;$(NetFrameworkCurrent) + true true enable - 4.1.0.0 + 4.1.0.0 + + net461 SR.PlatformNotSupported_CryptographyOpenSSL @@ -104,7 +108,7 @@ - + @@ -123,4 +127,9 @@ + + + + + diff --git a/src/libraries/System.Security.Cryptography.ProtectedData/Directory.Build.props b/src/libraries/System.Security.Cryptography.ProtectedData/Directory.Build.props index 63f02a0f817e..33e65b7cb465 100644 --- a/src/libraries/System.Security.Cryptography.ProtectedData/Directory.Build.props +++ b/src/libraries/System.Security.Cryptography.ProtectedData/Directory.Build.props @@ -2,5 +2,6 @@ Microsoft + true \ No newline at end of file diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/Directory.Build.props b/src/libraries/System.Security.Cryptography.X509Certificates/Directory.Build.props index 465e1110d6b0..42c6eafce67e 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/Directory.Build.props +++ b/src/libraries/System.Security.Cryptography.X509Certificates/Directory.Build.props @@ -3,5 +3,6 @@ Microsoft true + true \ No newline at end of file diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/ref/System.Security.Cryptography.X509Certificates.cs b/src/libraries/System.Security.Cryptography.X509Certificates/ref/System.Security.Cryptography.X509Certificates.cs index f133b0ef09ce..07b51c0d456c 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/ref/System.Security.Cryptography.X509Certificates.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/ref/System.Security.Cryptography.X509Certificates.cs @@ -332,6 +332,7 @@ public partial class X509Chain : System.IDisposable { public X509Chain() { } public X509Chain(bool useMachineContext) { } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public X509Chain(System.IntPtr chainContext) { } public System.IntPtr ChainContext { get { throw null; } } public System.Security.Cryptography.X509Certificates.X509ChainElementCollection ChainElements { get { throw null; } } diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.OSX/AppleCertificatePal.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.OSX/AppleCertificatePal.cs index be5d106bb6f9..fd70ac8e621c 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.OSX/AppleCertificatePal.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.OSX/AppleCertificatePal.cs @@ -363,11 +363,7 @@ public byte[] Thumbprint get { EnsureCertData(); - - using (SHA1 hash = SHA1.Create()) - { - return hash.ComputeHash(_certData.RawData); - } + return SHA1.HashData(_certData.RawData); } } diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/ManagedCertificateFinder.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/ManagedCertificateFinder.cs index 409e2a118407..ee401a4a0569 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/ManagedCertificateFinder.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/ManagedCertificateFinder.cs @@ -266,13 +266,8 @@ public void FindBySubjectKeyIdentifier(byte[] keyIdentifier) // SubjectPublicKeyInfo block, and returns that. // // https://msdn.microsoft.com/en-us/library/windows/desktop/aa376079%28v=vs.85%29.aspx - - using (HashAlgorithm hash = SHA1.Create()) - { - byte[] publicKeyInfoBytes = GetSubjectPublicKeyInfo(cert); - - certKeyId = hash.ComputeHash(publicKeyInfoBytes); - } + byte[] publicKeyInfoBytes = GetSubjectPublicKeyInfo(cert); + certKeyId = SHA1.HashData(publicKeyInfoBytes); } return keyIdentifier.ContentsEqual(certKeyId); diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/ManagedX509ExtensionProcessor.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/ManagedX509ExtensionProcessor.cs index 62c21976af0e..976021ff7a74 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/ManagedX509ExtensionProcessor.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Unix/ManagedX509ExtensionProcessor.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Diagnostics; using System.Formats.Asn1; using System.Security.Cryptography; using System.Security.Cryptography.Asn1; @@ -225,9 +226,21 @@ public virtual byte[] ComputeCapiSha1OfPublicKey(PublicKey key) AsnWriter writer = new AsnWriter(AsnEncodingRules.DER); spki.Encode(writer); - using (SHA1 hash = SHA1.Create()) + byte[] rented = CryptoPool.Rent(writer.GetEncodedLength()); + + try + { + if (!writer.TryEncode(rented, out int bytesWritten)) + { + Debug.Fail("TryEncode failed with a pre-allocated buffer"); + throw new CryptographicException(); + } + + return SHA1.HashData(rented.AsSpan(0, bytesWritten)); + } + finally { - return hash.ComputeHash(writer.Encode()); + CryptoPool.Return(rented, clearSize: 0); // SubjectPublicKeyInfo is not sensitive. } } diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509Chain.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509Chain.cs index 52e7cce49ff1..51d4001e2d51 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509Chain.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509Chain.cs @@ -4,6 +4,7 @@ using SafeX509ChainHandle = Microsoft.Win32.SafeHandles.SafeX509ChainHandle; using Internal.Cryptography.Pal; using System.Diagnostics; +using System.Runtime.Versioning; namespace System.Security.Cryptography.X509Certificates { @@ -23,6 +24,7 @@ public X509Chain(bool useMachineContext) _useMachineContext = useMachineContext; } + [MinimumOSPlatform("windows7.0")] public X509Chain(IntPtr chainContext) { _pal = ChainPal.FromHandle(chainContext); diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509SubjectKeyIdentifierExtension.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509SubjectKeyIdentifierExtension.cs index b46b126fc8d2..aaeefd3eeee4 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509SubjectKeyIdentifierExtension.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509SubjectKeyIdentifierExtension.cs @@ -92,16 +92,17 @@ private static byte[] EncodeExtension(PublicKey key, X509SubjectKeyIdentifierHas return EncodeExtension(subjectKeyIdentifier); } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA5350", Justification = "SHA1 is required by RFC3280")] private static byte[] GenerateSubjectKeyIdentifierFromPublicKey(PublicKey key, X509SubjectKeyIdentifierHashAlgorithm algorithm) { switch (algorithm) { case X509SubjectKeyIdentifierHashAlgorithm.Sha1: - return ComputeSha1(key.EncodedKeyValue.RawData); + return SHA1.HashData(key.EncodedKeyValue.RawData); case X509SubjectKeyIdentifierHashAlgorithm.ShortSha1: { - byte[] sha1 = ComputeSha1(key.EncodedKeyValue.RawData); + byte[] sha1 = SHA1.HashData(key.EncodedKeyValue.RawData); // ShortSha1: The keyIdentifier is composed of a four bit type field with // the value 0100 followed by the least significant 60 bits of the @@ -122,15 +123,6 @@ private static byte[] GenerateSubjectKeyIdentifierFromPublicKey(PublicKey key, X } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA5350", Justification = "SHA1 is required by RFC3280")] - private static byte[] ComputeSha1(byte[] data) - { - using (SHA1 sha1 = SHA1.Create()) - { - return sha1.ComputeHash(data); - } - } - private string? _subjectKeyIdentifier; private bool _decoded; } diff --git a/src/libraries/System.Security.Principal.Windows/Directory.Build.props b/src/libraries/System.Security.Principal.Windows/Directory.Build.props index 8c72c62fd593..27a4a5522a27 100644 --- a/src/libraries/System.Security.Principal.Windows/Directory.Build.props +++ b/src/libraries/System.Security.Principal.Windows/Directory.Build.props @@ -4,5 +4,6 @@ Microsoft true false + true \ No newline at end of file diff --git a/src/libraries/System.ServiceProcess.ServiceController/Directory.Build.props b/src/libraries/System.ServiceProcess.ServiceController/Directory.Build.props index 63f02a0f817e..33e65b7cb465 100644 --- a/src/libraries/System.ServiceProcess.ServiceController/Directory.Build.props +++ b/src/libraries/System.ServiceProcess.ServiceController/Directory.Build.props @@ -2,5 +2,6 @@ Microsoft + true \ No newline at end of file diff --git a/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceBase.cs b/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceBase.cs index 7ba222918425..00a392a2bec0 100644 --- a/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceBase.cs +++ b/src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceBase.cs @@ -305,6 +305,8 @@ internal static bool ValidServiceName(string serviceName) /// /// Disposes of the resources (other than memory ) used by /// the . + /// This is called from when all + /// services in the process have entered the SERVICE_STOPPED state. /// protected override void Dispose(bool disposing) { diff --git a/src/libraries/System.ServiceProcess.ServiceController/tests/ServiceBaseTests.cs b/src/libraries/System.ServiceProcess.ServiceController/tests/ServiceBaseTests.cs index efe9733aa511..da535fafea8e 100644 --- a/src/libraries/System.ServiceProcess.ServiceController/tests/ServiceBaseTests.cs +++ b/src/libraries/System.ServiceProcess.ServiceController/tests/ServiceBaseTests.cs @@ -84,17 +84,21 @@ public void TestOnStartThenStop() public void TestOnStartWithArgsThenStop() { ServiceController controller = ConnectToServer(); - controller.Stop(); Assert.Equal((int)PipeMessageByteCode.Stop, _testService.GetByte()); controller.WaitForStatus(ServiceControllerStatus.Stopped); controller.Start(new string[] { "StartWithArguments", "a", "b", "c" }); + + // Start created a new TestService; dispose of our client stream and reconnect to it _testService.Client = null; _testService.Client.Connect(); - Assert.Equal((int)(PipeMessageByteCode.Connected), _testService.GetByte()); - Assert.Equal((int)(PipeMessageByteCode.Start), _testService.GetByte()); + // Test service does not mutually synchronize Connected and Start messages + var bytes = new byte[] { _testService.GetByte(), _testService.GetByte() }; + Assert.Contains((byte)PipeMessageByteCode.Connected, bytes); + Assert.Contains((byte)PipeMessageByteCode.Start, bytes); + controller.WaitForStatus(ServiceControllerStatus.Running); controller.Stop(); @@ -202,8 +206,10 @@ public void PropagateExceptionFromOnStart() private ServiceController ConnectToServer() { + TestServiceProvider.DebugTrace("ServiceBaseTests.ConnectToServer: connecting"); _testService.Client.Connect(connectionTimeout); Assert.Equal((int)PipeMessageByteCode.Connected, _testService.GetByte()); + TestServiceProvider.DebugTrace("ServiceBaseTests.ConnectToServer: received connect byte"); ServiceController controller = new ServiceController(_testService.TestServiceName); AssertExpectedProperties(controller); diff --git a/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/Program.cs b/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/Program.cs index 8773e4e3acfb..abff7d1c7c74 100644 --- a/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/Program.cs +++ b/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/Program.cs @@ -1,12 +1,15 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Threading; + namespace System.ServiceProcess.Tests { public class Program { static int Main(string[] args) { + Thread.CurrentThread.Name = "Test Service"; if (args.Length == 1 || args.Length == 2) { TestService testService; diff --git a/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/TestService.cs b/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/TestService.cs index a22f7b967594..5d3d9bc808f7 100644 --- a/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/TestService.cs +++ b/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/TestService.cs @@ -9,6 +9,11 @@ namespace System.ServiceProcess.Tests { public class TestService : ServiceBase { + // To view tracing, use DbgView from sysinternals.com; + // run it elevated, check "Capture>Global Win32" and "Capture>Win32", + // and filter to just messages beginning with "##" + internal const bool DebugTracing = false; + private bool _disposed; private Task _waitClientConnect; private NamedPipeServerStream _serverStream; @@ -16,6 +21,7 @@ public class TestService : ServiceBase public TestService(string serviceName, Exception throwException = null) { + DebugTrace("TestService " + ServiceName + ": Ctor"); this.ServiceName = serviceName; // Enable all the events @@ -27,10 +33,11 @@ public TestService(string serviceName, Exception throwException = null) this.CanHandleSessionChangeEvent = false; this.CanHandlePowerEvent = false; this._exception = throwException; - this._serverStream = new NamedPipeServerStream(serviceName); _waitClientConnect = this._serverStream.WaitForConnectionAsync(); - _waitClientConnect.ContinueWith((t) => WriteStreamAsync(PipeMessageByteCode.Connected)); + _waitClientConnect = _waitClientConnect.ContinueWith(_ => DebugTrace("TestService " + ServiceName + ": Connected")); + _waitClientConnect.ContinueWith(t => WriteStreamAsync(PipeMessageByteCode.Connected)); + DebugTrace("TestService " + ServiceName + ": Ctor completed"); } protected override void OnContinue() @@ -72,6 +79,7 @@ protected override void OnShutdown() protected override void OnStart(string[] args) { + DebugTrace("TestService " + ServiceName + ": OnStart"); base.OnStart(args); if (_exception != null) { @@ -89,41 +97,52 @@ protected override void OnStart(string[] args) protected override void OnStop() { + DebugTrace("TestService " + ServiceName + ": OnStop"); base.OnStop(); WriteStreamAsync(PipeMessageByteCode.Stop).Wait(); } public async Task WriteStreamAsync(PipeMessageByteCode code, int command = 0) { - if (_waitClientConnect.IsCompleted) - { - Task writeCompleted; - const int WriteTimeout = 60000; - if (code == PipeMessageByteCode.OnCustomCommand) - { - writeCompleted = _serverStream.WriteAsync(new byte[] { (byte)command }, 0, 1); - } - else - { - writeCompleted = _serverStream.WriteAsync(new byte[] { (byte)code }, 0, 1); - } - await writeCompleted.TimeoutAfter(WriteTimeout).ConfigureAwait(false); - } - else + DebugTrace("TestService " + ServiceName + ": WriteStreamAsync writing " + code.ToString()); + + const int WriteTimeout = 60000; + var toWrite = (code == PipeMessageByteCode.OnCustomCommand) ? new byte[] { (byte)command } : new byte[] { (byte)code }; + + // Wait for the client connection before writing to the pipe. + // Exception: if it's a Stop message, it may be because the test has completed and we're cleaning up the test service so there's no client at all. + // Tests that verify "Stop" itself should ensure the client connection has completed before calling stop, by waiting on some other message from the pipe first. + if (code != PipeMessageByteCode.Stop) { - // We get here if the service is getting torn down before a client ever connected. - // some tests do this. + await _waitClientConnect; } + await _serverStream.WriteAsync(toWrite, 0, 1).TimeoutAfter(WriteTimeout).ConfigureAwait(false); + DebugTrace("TestService " + ServiceName + ": WriteStreamAsync completed"); } + /// + /// This is called from when all services in the process + /// have entered the SERVICE_STOPPED state. It disposes the named pipe stream. + /// protected override void Dispose(bool disposing) { if (!_disposed) { + DebugTrace("TestService " + ServiceName + ": Disposing"); _serverStream.Dispose(); _disposed = true; base.Dispose(); } } + + internal static void DebugTrace(string message) + { + if (DebugTracing) + { +#pragma warning disable CS0162 // unreachable code + Debug.WriteLine("## " + message); +#pragma warning restore + } + } } } diff --git a/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/TestServiceInstaller.cs b/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/TestServiceInstaller.cs index 10d941807aec..daad7d2af0ac 100644 --- a/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/TestServiceInstaller.cs +++ b/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/TestServiceInstaller.cs @@ -102,6 +102,7 @@ public unsafe void Install() { if (svc.Status != ServiceControllerStatus.Running) { + TestService.DebugTrace("TestServiceInstaller: instructing ServiceController to Start service " + ServiceName); svc.Start(); if (!ServiceName.StartsWith("PropagateExceptionFromOnStart")) svc.WaitForStatus(ServiceControllerStatus.Running, TimeSpan.FromSeconds(120)); @@ -124,7 +125,6 @@ public void RemoveService() // Meantime we still want this service to get deleted, so we'll go ahead and call // DeleteService, which will schedule it to get deleted on reboot. // We won't catch the exception: we do want the test to fail. - DeleteService(); ServiceName = null; @@ -141,6 +141,7 @@ private void StopService() { try { + TestService.DebugTrace("TestServiceInstaller: instructing ServiceController to Stop service " + ServiceName); svc.Stop(); } catch (InvalidOperationException) @@ -172,6 +173,7 @@ private void DeleteService() if (serviceHandle.IsInvalid) throw new Win32Exception($"Could not find service '{ServiceName}'"); + TestService.DebugTrace("TestServiceInstaller: instructing ServiceController to Delete service " + ServiceName); if (!Interop.Advapi32.DeleteService(serviceHandle)) { throw new Win32Exception($"Could not delete service '{ServiceName}'"); diff --git a/src/libraries/System.ServiceProcess.ServiceController/tests/TestServiceProvider.cs b/src/libraries/System.ServiceProcess.ServiceController/tests/TestServiceProvider.cs index c875d7ea8950..1be86a61785d 100644 --- a/src/libraries/System.ServiceProcess.ServiceController/tests/TestServiceProvider.cs +++ b/src/libraries/System.ServiceProcess.ServiceController/tests/TestServiceProvider.cs @@ -10,6 +10,11 @@ namespace System.ServiceProcess.Tests { internal sealed class TestServiceProvider { + // To view tracing, use DbgView from sysinternals.com; + // run it elevated, check "Capture>Global Win32" and "Capture>Win32", + // and filter to just messages beginning with "##" + internal const bool DebugTracing = false; + private const int readTimeout = 60000; private static readonly Lazy s_runningWithElevatedPrivileges = new Lazy( @@ -28,6 +33,7 @@ public NamedPipeClientStream Client { if (_client == null) { + DebugTrace("TestServiceProvider: Creating client stream"); _client = new NamedPipeClientStream(".", TestServiceName, PipeDirection.In); } return _client; @@ -36,10 +42,12 @@ public NamedPipeClientStream Client { if (value == null) { + DebugTrace("TestServiceProvider: Disposing client stream"); _client.Dispose(); _client = null; } } + } public readonly string TestServiceAssembly = typeof(TestService).Assembly.Location; @@ -125,6 +133,7 @@ public void DeleteTestServices() { if (_client != null) { + DebugTrace("TestServiceProvider: Disposing client stream in Dispose()"); _client.Dispose(); _client = null; } @@ -143,5 +152,15 @@ public void DeleteTestServices() } } } + + internal static void DebugTrace(string message) + { + if (DebugTracing) + { +#pragma warning disable CS0162 // unreachable code + Debug.WriteLine("## " + message); +#pragma warning restore + } + } } } diff --git a/src/libraries/System.Text.Encoding.CodePages/ref/System.Text.Encoding.CodePages.csproj b/src/libraries/System.Text.Encoding.CodePages/ref/System.Text.Encoding.CodePages.csproj index c29c17eb0759..ff67cc8cca7d 100644 --- a/src/libraries/System.Text.Encoding.CodePages/ref/System.Text.Encoding.CodePages.csproj +++ b/src/libraries/System.Text.Encoding.CodePages/ref/System.Text.Encoding.CodePages.csproj @@ -1,7 +1,8 @@ enable - $(NetCoreAppCurrent);netstandard2.0 + $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent) + true @@ -10,4 +11,7 @@ + + + \ No newline at end of file diff --git a/src/libraries/System.Text.Encoding.CodePages/src/System.Text.Encoding.CodePages.csproj b/src/libraries/System.Text.Encoding.CodePages/src/System.Text.Encoding.CodePages.csproj index 88407f0f334d..3ca2e7453ec8 100644 --- a/src/libraries/System.Text.Encoding.CodePages/src/System.Text.Encoding.CodePages.csproj +++ b/src/libraries/System.Text.Encoding.CodePages/src/System.Text.Encoding.CodePages.csproj @@ -2,14 +2,10 @@ true enable - $(NetCoreAppCurrent);$(NetCoreAppCurrent)-Windows_NT;netstandard2.0;netcoreapp2.0-Windows_NT;netstandard2.0-Windows_NT + $(NetCoreAppCurrent);$(NetCoreAppCurrent)-Windows_NT;netstandard2.0;netcoreapp2.0-Windows_NT;netstandard2.0-Windows_NT;net461-Windows_NT;$(NetFrameworkCurrent)-Windows_NT + true true - - - - netstandard2.0;net461 - @@ -73,6 +69,11 @@ + + + + + @@ -15,7 +16,12 @@ - + + + + + + \ No newline at end of file diff --git a/src/libraries/System.Text.Encodings.Web/src/System.Text.Encodings.Web.csproj b/src/libraries/System.Text.Encodings.Web/src/System.Text.Encodings.Web.csproj index ba3ad6048c55..126ef92db5b5 100644 --- a/src/libraries/System.Text.Encodings.Web/src/System.Text.Encodings.Web.csproj +++ b/src/libraries/System.Text.Encodings.Web/src/System.Text.Encodings.Web.csproj @@ -1,10 +1,16 @@ true - $(NetCoreAppCurrent);netcoreapp3.0;netstandard2.1;netstandard2.0 + $(NetCoreAppCurrent);netcoreapp3.0;netstandard2.1;netstandard2.0;net461;$(NetFrameworkCurrent) + true true enable + + $(DefineConstants),USE_INTERNAL_ACCESSIBILITY + + $(NoWarn);CS3019 + @@ -23,22 +29,28 @@ - + + + + + + - - - + + + + + + + diff --git a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/AdvSimdHelper.cs b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/AdvSimdHelper.cs new file mode 100644 index 000000000000..bd1b91ab8d08 --- /dev/null +++ b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/AdvSimdHelper.cs @@ -0,0 +1,157 @@ +// 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.Diagnostics; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace System.Text.Encodings.Web +{ + internal static class AdvSimdHelper + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector128 CreateEscapingMask_UnsafeRelaxedJavaScriptEncoder(Vector128 sourceValue) + { + if (!AdvSimd.Arm64.IsSupported) + { + throw new PlatformNotSupportedException(); + } + + // Anything in the control characters range, and anything above short.MaxValue but less than or equal char.MaxValue + // That's because anything between 32768 and 65535 (inclusive) will overflow and become negative. + Vector128 mask = AdvSimd.CompareLessThan(sourceValue, s_spaceMaskInt16); + + mask = AdvSimd.Or(mask, AdvSimd.CompareEqual(sourceValue, s_quotationMarkMaskInt16)); + mask = AdvSimd.Or(mask, AdvSimd.CompareEqual(sourceValue, s_reverseSolidusMaskInt16)); + + // Anything above the ASCII range, and also including the leftover control character in the ASCII range - 0x7F + // When this method is called with only ASCII data, 0x7F is the only value that would meet this comparison. + // However, when called from "Default", the source could contain characters outside the ASCII range. + mask = AdvSimd.Or(mask, AdvSimd.CompareGreaterThan(sourceValue, s_tildeMaskInt16)); + + return mask; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector128 CreateEscapingMask_UnsafeRelaxedJavaScriptEncoder(Vector128 sourceValue) + { + if (!AdvSimd.Arm64.IsSupported) + { + throw new PlatformNotSupportedException(); + } + + // Anything in the control characters range (except 0x7F), and anything above sbyte.MaxValue but less than or equal byte.MaxValue + // That's because anything between 128 and 255 (inclusive) will overflow and become negative. + Vector128 mask = AdvSimd.CompareLessThan(sourceValue, s_spaceMaskSByte); + + mask = AdvSimd.Or(mask, AdvSimd.CompareEqual(sourceValue, s_quotationMarkMaskSByte)); + mask = AdvSimd.Or(mask, AdvSimd.CompareEqual(sourceValue, s_reverseSolidusMaskSByte)); + + // Leftover control character in the ASCII range - 0x7F + // Since we are dealing with sbytes, 0x7F is the only value that would meet this comparison. + mask = AdvSimd.Or(mask, AdvSimd.CompareGreaterThan(sourceValue, s_tildeMaskSByte)); + + return mask; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector128 CreateEscapingMask_DefaultJavaScriptEncoderBasicLatin(Vector128 sourceValue) + { + if (!AdvSimd.Arm64.IsSupported) + { + throw new PlatformNotSupportedException(); + } + + Vector128 mask = CreateEscapingMask_UnsafeRelaxedJavaScriptEncoder(sourceValue); + + mask = AdvSimd.Or(mask, AdvSimd.CompareEqual(sourceValue, s_ampersandMaskSByte)); + mask = AdvSimd.Or(mask, AdvSimd.CompareEqual(sourceValue, s_apostropheMaskSByte)); + mask = AdvSimd.Or(mask, AdvSimd.CompareEqual(sourceValue, s_plusSignMaskSByte)); + mask = AdvSimd.Or(mask, AdvSimd.CompareEqual(sourceValue, s_lessThanSignMaskSByte)); + mask = AdvSimd.Or(mask, AdvSimd.CompareEqual(sourceValue, s_greaterThanSignMaskSByte)); + mask = AdvSimd.Or(mask, AdvSimd.CompareEqual(sourceValue, s_graveAccentMaskSByte)); + + return mask; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector128 CreateAsciiMask(Vector128 sourceValue) + { + if (!AdvSimd.Arm64.IsSupported) + { + throw new PlatformNotSupportedException(); + } + + // Anything above short.MaxValue but less than or equal char.MaxValue + // That's because anything between 32768 and 65535 (inclusive) will overflow and become negative. + Vector128 mask = AdvSimd.CompareLessThan(sourceValue, s_nullMaskInt16); + + // Anything above the ASCII range + mask = AdvSimd.Or(mask, AdvSimd.CompareGreaterThan(sourceValue, s_maxAsciiCharacterMaskInt16)); + + return mask; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool ContainsNonAsciiByte(Vector128 value) + { + if (!AdvSimd.Arm64.IsSupported) + { + throw new PlatformNotSupportedException(); + } + + // most significant bit mask for a 64-bit byte vector + const ulong MostSignficantBitMask = 0x8080808080808080; + + value = AdvSimd.Arm64.MinPairwise(value, value); + return (value.AsUInt64().ToScalar() & MostSignficantBitMask) != 0; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int GetIndexOfFirstNonAsciiByte(Vector128 value) + { + if (!AdvSimd.Arm64.IsSupported || !BitConverter.IsLittleEndian) + { + throw new PlatformNotSupportedException(); + } + + // extractedBits[i] = (value[i] >> 7) & (1 << (12 * (i % 2))); + Vector128 mostSignificantBitIsSet = AdvSimd.ShiftRightArithmetic(value.AsSByte(), 7).AsByte(); + Vector128 extractedBits = AdvSimd.And(mostSignificantBitIsSet, s_bitmask); + + // collapse mask to lower bits + extractedBits = AdvSimd.Arm64.AddPairwise(extractedBits, extractedBits); + ulong mask = extractedBits.AsUInt64().ToScalar(); + + // calculate the index + int index = BitOperations.TrailingZeroCount(mask) >> 2; + Debug.Assert((mask != 0) ? index < 16 : index >= 16); + return index; + } + + private static readonly Vector128 s_nullMaskInt16 = Vector128.Zero; + private static readonly Vector128 s_spaceMaskInt16 = Vector128.Create((short)' '); + private static readonly Vector128 s_quotationMarkMaskInt16 = Vector128.Create((short)'"'); + private static readonly Vector128 s_reverseSolidusMaskInt16 = Vector128.Create((short)'\\'); + private static readonly Vector128 s_tildeMaskInt16 = Vector128.Create((short)'~'); + private static readonly Vector128 s_maxAsciiCharacterMaskInt16 = Vector128.Create((short)0x7F); // Delete control character + + private static readonly Vector128 s_spaceMaskSByte = Vector128.Create((sbyte)' '); + private static readonly Vector128 s_quotationMarkMaskSByte = Vector128.Create((sbyte)'"'); + private static readonly Vector128 s_ampersandMaskSByte = Vector128.Create((sbyte)'&'); + private static readonly Vector128 s_apostropheMaskSByte = Vector128.Create((sbyte)'\''); + private static readonly Vector128 s_plusSignMaskSByte = Vector128.Create((sbyte)'+'); + private static readonly Vector128 s_lessThanSignMaskSByte = Vector128.Create((sbyte)'<'); + private static readonly Vector128 s_greaterThanSignMaskSByte = Vector128.Create((sbyte)'>'); + private static readonly Vector128 s_reverseSolidusMaskSByte = Vector128.Create((sbyte)'\\'); + private static readonly Vector128 s_graveAccentMaskSByte = Vector128.Create((sbyte)'`'); + private static readonly Vector128 s_tildeMaskSByte = Vector128.Create((sbyte)'~'); + + private static readonly Vector128 s_bitmask = BitConverter.IsLittleEndian ? + Vector128.Create((ushort)0x1001).AsByte() : + Vector128.Create((ushort)0x0110).AsByte(); + } +} diff --git a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/BitHelper.cs b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/BitHelper.cs deleted file mode 100644 index df7a231e1146..000000000000 --- a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/BitHelper.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Diagnostics; -using System.Numerics; -using System.Runtime.CompilerServices; - -namespace System.Text.Encodings.Web -{ - internal static class BitHelper - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static int GetIndexOfFirstNeedToEscape(int index) - { - // Found at least one byte that needs to be escaped, figure out the index of - // the first one found that needed to be escaped within the 16 bytes. - Debug.Assert(index > 0 && index <= 65_535); - int tzc = BitOperations.TrailingZeroCount(index); - Debug.Assert(tzc >= 0 && tzc < 16); - - return tzc; - } - } -} diff --git a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/DefaultJavaScriptEncoder.cs b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/DefaultJavaScriptEncoder.cs index ac85a753d1e4..4706a8e7eb42 100644 --- a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/DefaultJavaScriptEncoder.cs +++ b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/DefaultJavaScriptEncoder.cs @@ -10,6 +10,7 @@ #if NETCOREAPP using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; +using System.Runtime.Intrinsics.Arm; #endif namespace System.Text.Encodings.Web @@ -87,21 +88,33 @@ public override unsafe int FindFirstCharacterToEncodeUtf8(ReadOnlySpan utf int idx = 0; #if NETCOREAPP - if (Sse2.IsSupported) + if (Sse2.IsSupported || AdvSimd.Arm64.IsSupported) { sbyte* startingAddress = (sbyte*)ptr; while (utf8Text.Length - 16 >= idx) { Debug.Assert(startingAddress >= ptr && startingAddress <= (ptr + utf8Text.Length - 16)); - // Load the next 16 bytes. - Vector128 sourceValue = Sse2.LoadVector128(startingAddress); + bool containsNonAsciiBytes; - // Check for ASCII text. Any byte that's not in the ASCII range will already be negative when - // casted to signed byte. - int index = Sse2.MoveMask(sourceValue); + // Load the next 16 bytes, and check for ASCII text. + // Any byte that's not in the ASCII range will already be negative when casted to signed byte. + if (Sse2.IsSupported) + { + Vector128 sourceValue = Sse2.LoadVector128(startingAddress); + containsNonAsciiBytes = Sse2Helper.ContainsNonAsciiByte(sourceValue); + } + else if (AdvSimd.Arm64.IsSupported) + { + Vector128 sourceValue = AdvSimd.LoadVector128(startingAddress); + containsNonAsciiBytes = AdvSimdHelper.ContainsNonAsciiByte(sourceValue); + } + else + { + throw new PlatformNotSupportedException(); + } - if (index != 0) + if (containsNonAsciiBytes) { // At least one of the following 16 bytes is non-ASCII. diff --git a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/DefaultJavaScriptEncoderBasicLatin.cs b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/DefaultJavaScriptEncoderBasicLatin.cs index 40eaada23a4e..9feec9aff57d 100644 --- a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/DefaultJavaScriptEncoderBasicLatin.cs +++ b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/DefaultJavaScriptEncoderBasicLatin.cs @@ -9,6 +9,7 @@ #if NETCOREAPP using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; +using System.Runtime.Intrinsics.Arm; #endif namespace System.Text.Encodings.Web @@ -90,9 +91,12 @@ public override unsafe int FindFirstCharacterToEncode(char* text, int textLength short* end = ptr + (uint)textLength; #if NETCOREAPP - if (Sse2.IsSupported && textLength >= Vector128.Count) + if (Sse2.IsSupported || (AdvSimd.Arm64.IsSupported && BitConverter.IsLittleEndian)) { - goto VectorizedEntry; + if (textLength >= Vector128.Count) + { + goto VectorizedStart; + } } Sequential: @@ -120,7 +124,7 @@ public override unsafe int FindFirstCharacterToEncode(char* text, int textLength return idx; #if NETCOREAPP - VectorizedEntry: + VectorizedStart: int index; short* vectorizedEnd; @@ -135,16 +139,29 @@ public override unsafe int FindFirstCharacterToEncode(char* text, int textLength // Load the next 16 characters, combine them to one byte vector. // Chars that don't cleanly convert to ASCII bytes will get converted (saturated) to // somewhere in the range [0x7F, 0xFF], which the NeedsEscaping method will detect. - Vector128 sourceValue = Sse2.PackSignedSaturate( - Sse2.LoadVector128(ptr), - Sse2.LoadVector128(ptr + Vector128.Count)); + Vector128 sourceValue; + + if (Sse2.IsSupported) + { + sourceValue = Sse2.PackSignedSaturate( + Sse2.LoadVector128(ptr), + Sse2.LoadVector128(ptr + Vector128.Count)); + } + else if (AdvSimd.Arm64.IsSupported) + { + Vector64 lower = AdvSimd.ExtractNarrowingSaturateLower(AdvSimd.LoadVector128(ptr)); + sourceValue = AdvSimd.ExtractNarrowingSaturateUpper(lower, AdvSimd.LoadVector128(ptr + Vector128.Count)); + } + else + { + throw new PlatformNotSupportedException(); + } // Check if any of the 16 characters need to be escaped. index = NeedsEscaping(sourceValue); - // If index == 0, that means none of the 16 characters needed to be escaped. - // TrailingZeroCount is relatively expensive, avoid it if possible. - if (index != 0) + // If index >= 16, that means none of the 16 characters needed to be escaped. + if (index < 16) { goto VectorizedFound; } @@ -166,15 +183,28 @@ public override unsafe int FindFirstCharacterToEncode(char* text, int textLength // Load the next 8 characters + a dummy known that it must not be escaped. // Put the dummy second, so it's easier for GetIndexOfFirstNeedToEscape. - Vector128 sourceValue = Sse2.PackSignedSaturate( - Sse2.LoadVector128(ptr), - Vector128.Create((short)'A')); // max. one "iteration", so no need to cache this vector + Vector128 sourceValue; + + if (Sse2.IsSupported) + { + sourceValue = Sse2.PackSignedSaturate( + Sse2.LoadVector128(ptr), + Vector128.Create((short)'A')); // max. one "iteration", so no need to cache this vector + } + else if (AdvSimd.Arm64.IsSupported) + { + Vector64 saturated = AdvSimd.ExtractNarrowingSaturateLower(AdvSimd.LoadVector128(ptr)); + sourceValue = Vector128.Create(saturated, Vector64.Create((sbyte)'A')); + } + else + { + throw new PlatformNotSupportedException(); + } index = NeedsEscaping(sourceValue); - // If index == 0, that means none of the 16 bytes needed to be escaped. - // TrailingZeroCount is relatively expensive, avoid it if possible. - if (index != 0) + // If index >= 16, that means none of the 16 bytes needed to be escaped. + if (index < 16) { goto VectorizedFound; } @@ -207,9 +237,8 @@ public override unsafe int FindFirstCharacterToEncode(char* text, int textLength goto AllAllowed; VectorizedFound: - idx = BitHelper.GetIndexOfFirstNeedToEscape(index); - idx += CalculateIndex(ptr, text); - return idx; + index += CalculateIndex(ptr, text); + return index; static int CalculateIndex(short* ptr, char* text) { @@ -235,10 +264,12 @@ public override unsafe int FindFirstCharacterToEncodeUtf8(ReadOnlySpan utf byte* end = ptr + textLength; #if NETCOREAPP - - if (Sse2.IsSupported && textLength >= Vector128.Count) + if (Sse2.IsSupported || (AdvSimd.Arm64.IsSupported && BitConverter.IsLittleEndian)) { - goto Vectorized; + if (textLength >= Vector128.Count) + { + goto Vectorized; + } } Sequential: @@ -273,14 +304,16 @@ public override unsafe int FindFirstCharacterToEncodeUtf8(ReadOnlySpan utf do { Debug.Assert(pValue <= ptr && ptr <= (pValue + utf8Text.Length - Vector128.Count)); + // Load the next 16 bytes - Vector128 sourceValue = Sse2.LoadVector128((sbyte*)ptr); + Vector128 sourceValue = Sse2.IsSupported ? + Sse2.LoadVector128((sbyte*)ptr) : + AdvSimd.LoadVector128((sbyte*)ptr); index = NeedsEscaping(sourceValue); - // If index == 0, that means none of the 16 bytes needed to be escaped. - // TrailingZeroCount is relatively expensive, avoid it if possible. - if (index != 0) + // If index >= 16, that means none of the 16 bytes needed to be escaped. + if (index < 16) { goto VectorizedFound; } @@ -304,17 +337,19 @@ public override unsafe int FindFirstCharacterToEncodeUtf8(ReadOnlySpan utf Debug.Assert(pValue <= vectorizedEnd && vectorizedEnd <= (pValue + utf8Text.Length - Vector128.Count)); // Load the last 16 bytes - Vector128 sourceValue = Sse2.LoadVector128((sbyte*)vectorizedEnd); + Vector128 sourceValue = Sse2.IsSupported ? + Sse2.LoadVector128((sbyte*)vectorizedEnd) : + AdvSimd.LoadVector128((sbyte*)vectorizedEnd); + // If index >= 16, that means none of the 16 bytes needed to be escaped. index = NeedsEscaping(sourceValue); - if (index != 0) + if (index < 16) { ptr = vectorizedEnd; goto VectorizedFound; } - idx = -1; - goto Return; + goto AllAllowed; } idx = CalculateIndex(ptr, pValue); @@ -327,9 +362,8 @@ public override unsafe int FindFirstCharacterToEncodeUtf8(ReadOnlySpan utf goto AllAllowed; VectorizedFound: - idx = BitHelper.GetIndexOfFirstNeedToEscape(index); - idx += CalculateIndex(ptr, pValue); - return idx; + index += CalculateIndex(ptr, pValue); + return index; static int CalculateIndex(byte* ptr, byte* pValue) => (int)(ptr - pValue); #endif @@ -434,15 +468,24 @@ public override unsafe bool TryEncodeUnicodeScalar(int unicodeScalar, char* buff [MethodImpl(MethodImplOptions.AggressiveInlining)] private static int NeedsEscaping(Vector128 sourceValue) { - Debug.Assert(Sse2.IsSupported); + Debug.Assert(Sse2.IsSupported || AdvSimd.Arm64.IsSupported); - // Check if any of the 16 bytes need to be escaped. - Vector128 mask = Ssse3.IsSupported - ? Ssse3Helper.CreateEscapingMask_DefaultJavaScriptEncoderBasicLatin(sourceValue) - : Sse2Helper.CreateEscapingMask_DefaultJavaScriptEncoderBasicLatin(sourceValue); + if (Sse2.IsSupported) + { + // Check if any of the 16 bytes need to be escaped. + Vector128 mask = Ssse3.IsSupported + ? Ssse3Helper.CreateEscapingMask_DefaultJavaScriptEncoderBasicLatin(sourceValue) + : Sse2Helper.CreateEscapingMask_DefaultJavaScriptEncoderBasicLatin(sourceValue); - int index = Sse2.MoveMask(mask.AsByte()); - return index; + int index = Sse2Helper.GetIndexOfFirstNonAsciiByte(mask.AsByte()); + return index; + } + else + { + Vector128 mask = AdvSimdHelper.CreateEscapingMask_DefaultJavaScriptEncoderBasicLatin(sourceValue); + int index = AdvSimdHelper.GetIndexOfFirstNonAsciiByte(mask.AsByte()); + return index; + } } #endif } diff --git a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/Sse2Helper.cs b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/Sse2Helper.cs index c6e1b8942481..7d0239540ddc 100644 --- a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/Sse2Helper.cs +++ b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/Sse2Helper.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; @@ -81,6 +82,24 @@ public static Vector128 CreateAsciiMask(Vector128 sourceValue) return mask; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool ContainsNonAsciiByte(Vector128 value) + { + Debug.Assert(Sse2.IsSupported); + int mask = Sse2.MoveMask(value); + return mask != 0; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int GetIndexOfFirstNonAsciiByte(Vector128 value) + { + Debug.Assert(Sse2.IsSupported); + int mask = Sse2.MoveMask(value); + int index = BitOperations.TrailingZeroCount(mask); + Debug.Assert((mask != 0) ? index < 16 : index >= 16); + return index; + } + private static readonly Vector128 s_nullMaskInt16 = Vector128.Zero; private static readonly Vector128 s_spaceMaskInt16 = Vector128.Create((short)' '); private static readonly Vector128 s_quotationMarkMaskInt16 = Vector128.Create((short)'"'); diff --git a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/Ssse3Helper.cs b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/Ssse3Helper.cs index c88eba1366c6..08d4b90d2b79 100644 --- a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/Ssse3Helper.cs +++ b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/Ssse3Helper.cs @@ -45,7 +45,7 @@ public static Vector128 CreateEscapingMask( // E 1 1 0 1 0 0 0 0 1 1 1 1 1 1 1 1 // F 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 // - // where 1 denotes the neeed for escaping, while 0 means no escaping needed. + // where 1 denotes the need for escaping, while 0 means no escaping needed. // For high-nibbles in the range 8..F every input needs to be escaped, so we // can omit them in the bit-mask, thus only high-nibbles in the range 0..7 need // to be considered, hence the entries in the bit-mask can be of type byte. diff --git a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/TextEncoder.cs b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/TextEncoder.cs index a6c8ff531fe7..d8c228e79202 100644 --- a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/TextEncoder.cs +++ b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/TextEncoder.cs @@ -12,6 +12,7 @@ #if NETCOREAPP using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; +using System.Runtime.Intrinsics.Arm; #endif namespace System.Text.Encodings.Web @@ -713,7 +714,7 @@ public virtual unsafe int FindFirstCharacterToEncodeUtf8(ReadOnlySpan utf8 int idx = 0; #if NETCOREAPP - if (Sse2.IsSupported && utf8Text.Length - 16 >= idx) + if ((Sse2.IsSupported || AdvSimd.Arm64.IsSupported) && utf8Text.Length - 16 >= idx) { // Hoist these outside the loop, as the JIT won't do it. Vector128 bitMaskLookupAsciiNeedsEscaping = _bitMaskLookupAsciiNeedsEscaping; @@ -727,24 +728,39 @@ public virtual unsafe int FindFirstCharacterToEncodeUtf8(ReadOnlySpan utf8 Debug.Assert(startingAddress >= ptr && startingAddress <= (ptr + utf8Text.Length - 16)); // Load the next 16 bytes. - Vector128 sourceValue = Sse2.LoadVector128(startingAddress); + Vector128 sourceValue; + bool containsNonAsciiBytes; // Check for ASCII text. Any byte that's not in the ASCII range will already be negative when // casted to signed byte. - int index = Sse2.MoveMask(sourceValue); + if (Sse2.IsSupported) + { + sourceValue = Sse2.LoadVector128(startingAddress); + containsNonAsciiBytes = Sse2Helper.ContainsNonAsciiByte(sourceValue); + } + else if (AdvSimd.Arm64.IsSupported) + { + sourceValue = AdvSimd.LoadVector128(startingAddress); + containsNonAsciiBytes = AdvSimdHelper.ContainsNonAsciiByte(sourceValue); + } + else + { + throw new PlatformNotSupportedException(); + } - if (index == 0) + if (!containsNonAsciiBytes) { // All of the following 16 bytes is ASCII. + // TODO AdvSimd: optimization maybe achievable using VectorTableLookup and/or VectorTableLookupExtension if (Ssse3.IsSupported) { Vector128 mask = Ssse3Helper.CreateEscapingMask(sourceValue, bitMaskLookupAsciiNeedsEscaping, bitPosLookup, nibbleMaskSByte, nullMaskSByte); - index = Sse2.MoveMask(mask); + int index = Sse2Helper.GetIndexOfFirstNonAsciiByte(mask.AsByte()); - if (index != 0) + if (index < 16) { - idx += BitHelper.GetIndexOfFirstNeedToEscape(index); + idx += index; goto Return; } } diff --git a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/UnsafeRelaxedJavaScriptEncoder.cs b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/UnsafeRelaxedJavaScriptEncoder.cs index 895fcdc88ecf..89cae75a541c 100644 --- a/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/UnsafeRelaxedJavaScriptEncoder.cs +++ b/src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/UnsafeRelaxedJavaScriptEncoder.cs @@ -11,6 +11,7 @@ using System.Numerics; using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; +using System.Runtime.Intrinsics.Arm; #endif namespace System.Text.Encodings.Web @@ -62,7 +63,7 @@ public override unsafe int FindFirstCharacterToEncode(char* text, int textLength int idx = 0; #if NETCOREAPP - if (Sse2.IsSupported) + if (Sse2.IsSupported || AdvSimd.Arm64.IsSupported) { short* startingAddress = (short*)text; while (textLength - 8 >= idx) @@ -70,12 +71,28 @@ public override unsafe int FindFirstCharacterToEncode(char* text, int textLength Debug.Assert(startingAddress >= text && startingAddress <= (text + textLength - 8)); // Load the next 8 characters. - Vector128 sourceValue = Sse2.LoadVector128(startingAddress); + Vector128 sourceValue; + Vector128 mask; + bool containsNonAsciiChars; - Vector128 mask = Sse2Helper.CreateAsciiMask(sourceValue); - int index = Sse2.MoveMask(mask.AsByte()); + if (Sse2.IsSupported) + { + sourceValue = Sse2.LoadVector128(startingAddress); + mask = Sse2Helper.CreateAsciiMask(sourceValue); + containsNonAsciiChars = Sse2Helper.ContainsNonAsciiByte(mask.AsSByte()); + } + else if (AdvSimd.Arm64.IsSupported) + { + sourceValue = AdvSimd.LoadVector128(startingAddress); + mask = AdvSimdHelper.CreateAsciiMask(sourceValue); + containsNonAsciiChars = AdvSimdHelper.ContainsNonAsciiByte(mask.AsSByte()); + } + else + { + throw new PlatformNotSupportedException(); + } - if (index != 0) + if (containsNonAsciiChars) { // At least one of the following 8 characters is non-ASCII. int processNextEight = idx + 8; @@ -92,20 +109,31 @@ public override unsafe int FindFirstCharacterToEncode(char* text, int textLength } else { + int index; + // Check if any of the 8 characters need to be escaped. - mask = Sse2Helper.CreateEscapingMask_UnsafeRelaxedJavaScriptEncoder(sourceValue); + if (Sse2.IsSupported) + { + mask = Sse2Helper.CreateEscapingMask_UnsafeRelaxedJavaScriptEncoder(sourceValue); + index = Sse2Helper.GetIndexOfFirstNonAsciiByte(mask.AsByte()); + } + else if (AdvSimd.Arm64.IsSupported) + { + mask = AdvSimdHelper.CreateEscapingMask_UnsafeRelaxedJavaScriptEncoder(sourceValue); + index = AdvSimdHelper.GetIndexOfFirstNonAsciiByte(mask.AsByte()); + } + else + { + throw new PlatformNotSupportedException(); + } - index = Sse2.MoveMask(mask.AsByte()); - // If index == 0, that means none of the 8 characters needed to be escaped. - // TrailingZeroCount is relatively expensive, avoid it if possible. - if (index != 0) + // If index >= 16, that means none of the 8 characters needed to be escaped. + if (index < 16) { // Found at least one character that needs to be escaped, figure out the index of // the first one found that needed to be escaped within the 8 characters. - Debug.Assert(index > 0 && index <= 65_535); - int tzc = BitOperations.TrailingZeroCount(index); - Debug.Assert(tzc % 2 == 0 && tzc >= 0 && tzc <= 16); - idx += tzc >> 1; + Debug.Assert(index % 2 == 0); + idx += index >> 1; goto Return; } idx += 8; @@ -140,7 +168,7 @@ public override unsafe int FindFirstCharacterToEncodeUtf8(ReadOnlySpan utf int idx = 0; #if NETCOREAPP - if (Sse2.IsSupported) + if (Sse2.IsSupported || AdvSimd.Arm64.IsSupported) { sbyte* startingAddress = (sbyte*)ptr; while (utf8Text.Length - 16 >= idx) @@ -148,13 +176,23 @@ public override unsafe int FindFirstCharacterToEncodeUtf8(ReadOnlySpan utf Debug.Assert(startingAddress >= ptr && startingAddress <= (ptr + utf8Text.Length - 16)); // Load the next 16 bytes. - Vector128 sourceValue = Sse2.LoadVector128(startingAddress); + Vector128 sourceValue; + bool containsNonAsciiBytes; // Check for ASCII text. Any byte that's not in the ASCII range will already be negative when // casted to signed byte. - int index = Sse2.MoveMask(sourceValue); + if (Sse2.IsSupported) + { + sourceValue = Sse2.LoadVector128(startingAddress); + containsNonAsciiBytes = Sse2Helper.ContainsNonAsciiByte(sourceValue); + } + else + { + sourceValue = AdvSimd.LoadVector128(startingAddress); + containsNonAsciiBytes = AdvSimdHelper.ContainsNonAsciiByte(sourceValue); + } - if (index != 0) + if (containsNonAsciiBytes) { // At least one of the following 16 bytes is non-ASCII. @@ -192,19 +230,25 @@ public override unsafe int FindFirstCharacterToEncodeUtf8(ReadOnlySpan utf else { // Check if any of the 16 bytes need to be escaped. - Vector128 mask = Sse2Helper.CreateEscapingMask_UnsafeRelaxedJavaScriptEncoder(sourceValue); + int index; + + if (Sse2.IsSupported) + { + Vector128 mask = Sse2Helper.CreateEscapingMask_UnsafeRelaxedJavaScriptEncoder(sourceValue); + index = Sse2Helper.GetIndexOfFirstNonAsciiByte(mask.AsByte()); + } + else + { + Vector128 mask = AdvSimdHelper.CreateEscapingMask_UnsafeRelaxedJavaScriptEncoder(sourceValue); + index = AdvSimdHelper.GetIndexOfFirstNonAsciiByte(mask.AsByte()); + } - index = Sse2.MoveMask(mask); - // If index == 0, that means none of the 16 bytes needed to be escaped. - // TrailingZeroCount is relatively expensive, avoid it if possible. - if (index != 0) + // If index >= 16, that means none of the 16 bytes needed to be escaped. + if (index < 16) { // Found at least one byte that needs to be escaped, figure out the index of // the first one found that needed to be escaped within the 16 bytes. - Debug.Assert(index > 0 && index <= 65_535); - int tzc = BitOperations.TrailingZeroCount(index); - Debug.Assert(tzc >= 0 && tzc <= 16); - idx += tzc; + idx += index; goto Return; } idx += 16; diff --git a/src/libraries/System.Text.Json/ref/System.Text.Json.cs b/src/libraries/System.Text.Json/ref/System.Text.Json.cs index c165ebdfc052..0ab83e8b5265 100644 --- a/src/libraries/System.Text.Json/ref/System.Text.Json.cs +++ b/src/libraries/System.Text.Json/ref/System.Text.Json.cs @@ -192,11 +192,11 @@ public static partial class JsonSerializer public static object? Deserialize(ref System.Text.Json.Utf8JsonReader reader, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(MembersAccessedOnRead)] System.Type returnType, System.Text.Json.JsonSerializerOptions? options = null) { throw null; } public static System.Threading.Tasks.ValueTask DeserializeAsync(System.IO.Stream utf8Json, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(MembersAccessedOnRead)] System.Type returnType, System.Text.Json.JsonSerializerOptions? options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.ValueTask DeserializeAsync<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(MembersAccessedOnRead)] TValue>(System.IO.Stream utf8Json, System.Text.Json.JsonSerializerOptions? options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] public static TValue Deserialize<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(MembersAccessedOnRead)] TValue>(System.ReadOnlySpan utf8Json, System.Text.Json.JsonSerializerOptions? options = null) { throw null; } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] public static TValue Deserialize<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(MembersAccessedOnRead)] TValue>(string json, System.Text.Json.JsonSerializerOptions? options = null) { throw null; } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] public static TValue Deserialize<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(MembersAccessedOnRead)] TValue>(ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions? options = null) { throw null; } public static string Serialize(object? value, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(MembersAccessedOnWrite)] System.Type inputType, System.Text.Json.JsonSerializerOptions? options = null) { throw null; } public static void Serialize(System.Text.Json.Utf8JsonWriter writer, object? value, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(MembersAccessedOnWrite)] System.Type inputType, System.Text.Json.JsonSerializerOptions? options = null) { } @@ -212,11 +212,11 @@ public static void Serialize(System.Text.Json.Utf8JsonWriter writer, object? val public static object? Deserialize(ref System.Text.Json.Utf8JsonReader reader, System.Type returnType, System.Text.Json.JsonSerializerOptions? options = null) { throw null; } public static System.Threading.Tasks.ValueTask DeserializeAsync(System.IO.Stream utf8Json, System.Type returnType, System.Text.Json.JsonSerializerOptions? options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.ValueTask DeserializeAsync(System.IO.Stream utf8Json, System.Text.Json.JsonSerializerOptions? options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] public static TValue Deserialize(System.ReadOnlySpan utf8Json, System.Text.Json.JsonSerializerOptions? options = null) { throw null; } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] public static TValue Deserialize(string json, System.Text.Json.JsonSerializerOptions? options = null) { throw null; } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] public static TValue Deserialize(ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions? options = null) { throw null; } public static string Serialize(object? value, System.Type inputType, System.Text.Json.JsonSerializerOptions? options = null) { throw null; } public static void Serialize(System.Text.Json.Utf8JsonWriter writer, object? value, System.Type inputType, System.Text.Json.JsonSerializerOptions? options = null) { } @@ -241,6 +241,8 @@ public JsonSerializerOptions(System.Text.Json.JsonSerializerDefaults defaults) { public System.Text.Encodings.Web.JavaScriptEncoder? Encoder { get { throw null; } set { } } public bool IgnoreNullValues { get { throw null; } set { } } public bool IgnoreReadOnlyProperties { get { throw null; } set { } } + public bool IgnoreReadOnlyFields { get { throw null; } set { } } + public bool IncludeFields { get { throw null; } set { } } public int MaxDepth { get { throw null; } set { } } public bool PropertyNameCaseInsensitive { get { throw null; } set { } } public System.Text.Json.JsonNamingPolicy? PropertyNamingPolicy { get { throw null; } set { } } @@ -492,6 +494,7 @@ public enum JsonIgnoreCondition Never = 0, Always = 1, WhenWritingDefault = 2, + WhenWritingNull = 3, } public abstract partial class JsonAttribute : System.Attribute { @@ -502,7 +505,7 @@ public abstract partial class JsonConverter internal JsonConverter() { } public abstract bool CanConvert(System.Type typeToConvert); } - [System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=false)] + [System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Enum | System.AttributeTargets.Property | System.AttributeTargets.Field, AllowMultiple=false)] public partial class JsonConverterAttribute : System.Text.Json.Serialization.JsonAttribute { protected JsonConverterAttribute() { } @@ -526,7 +529,7 @@ public abstract partial class JsonConverter : System.Text.Json.Serialization. protected internal JsonConverter() { } public override bool CanConvert(System.Type typeToConvert) { throw null; } public virtual bool HandleNull { get { throw null; } } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] public abstract T Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options); public abstract void Write(System.Text.Json.Utf8JsonWriter writer, T value, System.Text.Json.JsonSerializerOptions options); } @@ -535,23 +538,23 @@ public sealed partial class JsonConstructorAttribute : System.Text.Json.Serializ { public JsonConstructorAttribute() { } } - [System.AttributeUsageAttribute(System.AttributeTargets.Property, AllowMultiple=false)] + [System.AttributeUsageAttribute(System.AttributeTargets.Property | System.AttributeTargets.Field, AllowMultiple=false)] public sealed partial class JsonExtensionDataAttribute : System.Text.Json.Serialization.JsonAttribute { public JsonExtensionDataAttribute() { } } - [System.AttributeUsageAttribute(System.AttributeTargets.Property, AllowMultiple=false)] + [System.AttributeUsageAttribute(System.AttributeTargets.Property | System.AttributeTargets.Field, AllowMultiple=false)] public sealed partial class JsonIgnoreAttribute : System.Text.Json.Serialization.JsonAttribute { public JsonIgnoreAttribute() { } public System.Text.Json.Serialization.JsonIgnoreCondition Condition { get { throw null; } set { } } } - [System.AttributeUsageAttribute(System.AttributeTargets.Property, AllowMultiple = false)] + [System.AttributeUsageAttribute(System.AttributeTargets.Property | System.AttributeTargets.Field, AllowMultiple = false)] public sealed partial class JsonIncludeAttribute : System.Text.Json.Serialization.JsonAttribute { public JsonIncludeAttribute() { } } - [System.AttributeUsageAttribute(System.AttributeTargets.Property, AllowMultiple=false)] + [System.AttributeUsageAttribute(System.AttributeTargets.Property | System.AttributeTargets.Field, AllowMultiple=false)] public sealed partial class JsonPropertyNameAttribute : System.Text.Json.Serialization.JsonAttribute { public JsonPropertyNameAttribute(string name) { } diff --git a/src/libraries/System.Text.Json/src/Resources/Strings.resx b/src/libraries/System.Text.Json/src/Resources/Strings.resx index 7309f577181e..41cf9de418c4 100644 --- a/src/libraries/System.Text.Json/src/Resources/Strings.resx +++ b/src/libraries/System.Text.Json/src/Resources/Strings.resx @@ -533,4 +533,7 @@ The type '{0}' is not a supported Dictionary key type. - + + The ignore condition 'JsonIgnoreCondition.WhenWritingNull' is not valid on value-type member '{0}' on type '{1}'. Consider using 'JsonIgnoreCondition.WhenWritingDefault'. + + \ No newline at end of file diff --git a/src/libraries/System.Text.Json/src/System.Text.Json.csproj b/src/libraries/System.Text.Json/src/System.Text.Json.csproj index 2cd2e121005e..e381a1b381d4 100644 --- a/src/libraries/System.Text.Json/src/System.Text.Json.csproj +++ b/src/libraries/System.Text.Json/src/System.Text.Json.csproj @@ -19,6 +19,7 @@ + @@ -159,7 +160,6 @@ - diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocument.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocument.cs index 8aff03f8dd2e..633bfc766d9e 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocument.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocument.cs @@ -317,7 +317,7 @@ internal bool TextEquals(int index, ReadOnlySpan otherText, bool isPropert Debug.Assert(status == OperationStatus.Done); Debug.Assert(consumed == utf16Text.Length); - result = TextEquals(index, otherUtf8Text.Slice(0, written), isPropertyName); + result = TextEquals(index, otherUtf8Text.Slice(0, written), isPropertyName, shouldUnescape: true); } if (otherUtf8TextArray != null) @@ -329,7 +329,7 @@ internal bool TextEquals(int index, ReadOnlySpan otherText, bool isPropert return result; } - internal bool TextEquals(int index, ReadOnlySpan otherUtf8Text, bool isPropertyName) + internal bool TextEquals(int index, ReadOnlySpan otherUtf8Text, bool isPropertyName, bool shouldUnescape) { CheckNotDisposed(); @@ -344,12 +344,12 @@ internal bool TextEquals(int index, ReadOnlySpan otherUtf8Text, bool isPro ReadOnlySpan data = _utf8Json.Span; ReadOnlySpan segment = data.Slice(row.Location, row.SizeOrLength); - if (otherUtf8Text.Length > segment.Length) + if (otherUtf8Text.Length > segment.Length || (!shouldUnescape && otherUtf8Text.Length != segment.Length)) { return false; } - if (row.HasComplexChildren) + if (row.HasComplexChildren && shouldUnescape) { if (otherUtf8Text.Length < segment.Length / JsonConstants.MaxExpansionFactorWhileEscaping) { diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonElement.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonElement.cs index dedc9c175b7b..c339aa766c92 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonElement.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonElement.cs @@ -1229,7 +1229,7 @@ public bool ValueEquals(ReadOnlySpan utf8Text) return utf8Text == default; } - return TextEqualsHelper(utf8Text, isPropertyName: false); + return TextEqualsHelper(utf8Text, isPropertyName: false, shouldUnescape: true); } /// @@ -1260,11 +1260,11 @@ public bool ValueEquals(ReadOnlySpan text) return TextEqualsHelper(text, isPropertyName: false); } - internal bool TextEqualsHelper(ReadOnlySpan utf8Text, bool isPropertyName) + internal bool TextEqualsHelper(ReadOnlySpan utf8Text, bool isPropertyName, bool shouldUnescape) { CheckValidInstance(); - return _parent.TextEquals(_idx, utf8Text, isPropertyName); + return _parent.TextEquals(_idx, utf8Text, isPropertyName, shouldUnescape); } internal bool TextEqualsHelper(ReadOnlySpan text, bool isPropertyName) diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonProperty.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonProperty.cs index a939d51f9816..9a5d58086abb 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonProperty.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonProperty.cs @@ -66,7 +66,7 @@ public bool NameEquals(string? text) /// public bool NameEquals(ReadOnlySpan utf8Text) { - return Value.TextEqualsHelper(utf8Text, isPropertyName: true); + return Value.TextEqualsHelper(utf8Text, isPropertyName: true, shouldUnescape: true); } /// @@ -89,6 +89,11 @@ public bool NameEquals(ReadOnlySpan text) return Value.TextEqualsHelper(text, isPropertyName: true); } + internal bool EscapedNameEquals(ReadOnlySpan utf8Text) + { + return Value.TextEqualsHelper(utf8Text, isPropertyName: true, shouldUnescape: false); + } + /// /// Write the property into the provided writer as a named JSON object property. /// diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonConverterAttribute.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonConverterAttribute.cs index b3488d71492e..e4248e726d5d 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonConverterAttribute.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonConverterAttribute.cs @@ -6,16 +6,16 @@ namespace System.Text.Json.Serialization { /// - /// When placed on a property or type, specifies the converter type to use. + /// When placed on a property, field, or type, specifies the converter type to use. /// /// /// The specified converter type must derive from . - /// When placed on a property, the specified converter will always be used. + /// When placed on a property or field, the specified converter will always be used. /// When placed on a type, the specified converter will be used unless a compatible converter is added to - /// or there is another on a property + /// or there is another on a member /// of the same type. /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Struct, AllowMultiple = false)] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] public class JsonConverterAttribute : JsonAttribute { /// diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonExtensionDataAttribute.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonExtensionDataAttribute.cs index 71cd1f79c859..242d50d11e82 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonExtensionDataAttribute.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonExtensionDataAttribute.cs @@ -4,8 +4,8 @@ namespace System.Text.Json.Serialization { /// - /// When placed on a property of type , any - /// properties that do not have a matching member are added to that Dictionary during deserialization and written during serialization. + /// When placed on a property or field of type , any + /// properties that do not have a matching property or field are added to that Dictionary during deserialization and written during serialization. /// /// /// The TKey value must be and TValue must be or . @@ -13,13 +13,13 @@ namespace System.Text.Json.Serialization /// During deserializing, when using a "null" JSON value is treated as a null object reference, and when using /// a "null" is treated as a JsonElement with set to . /// - /// During serializing, the name of the extension data property is not included in the JSON; + /// During serializing, the name of the extension data member is not included in the JSON; /// the data contained within the extension data is serialized as properties of the JSON object. /// - /// If there is more than one extension property on a type, or it the property is not of the correct type, + /// If there is more than one extension member on a type, or it the member is not of the correct type, /// an is thrown during the first serialization or deserialization of that type. /// - [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] public sealed class JsonExtensionDataAttribute : JsonAttribute { } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonIgnoreAttribute.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonIgnoreAttribute.cs index b48c1c2758d3..c1d2e20ee83e 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonIgnoreAttribute.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonIgnoreAttribute.cs @@ -4,13 +4,13 @@ namespace System.Text.Json.Serialization { /// - /// Prevents a property from being serialized or deserialized. + /// Prevents a property or field from being serialized or deserialized. /// - [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] public sealed class JsonIgnoreAttribute : JsonAttribute { /// - /// Specifies the condition that must be met before a property will be ignored. + /// Specifies the condition that must be met before a property or field will be ignored. /// /// The default value is . public JsonIgnoreCondition Condition { get; set; } = JsonIgnoreCondition.Always; diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonIncludeAttribute.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonIncludeAttribute.cs index 034db28be639..cf5597a574be 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonIncludeAttribute.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonIncludeAttribute.cs @@ -9,7 +9,7 @@ namespace System.Text.Json.Serialization /// /// When applied to a property, indicates that non-public getters and setters can be used for serialization and deserialization. /// - [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] + [AttributeUsage(AttributeTargets.Property | System.AttributeTargets.Field, AllowMultiple = false)] public sealed class JsonIncludeAttribute : JsonAttribute { /// diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonPropertyNameAttribute.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonPropertyNameAttribute.cs index 36318bac2f01..e1adaafd0530 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonPropertyNameAttribute.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Attributes/JsonPropertyNameAttribute.cs @@ -7,7 +7,7 @@ namespace System.Text.Json.Serialization /// Specifies the property name that is present in the JSON when serializing and deserializing. /// This overrides any naming policy specified by . /// - [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] public sealed class JsonPropertyNameAttribute : JsonAttribute { /// diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableWithAddMethodConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableWithAddMethodConverter.cs index 66a701811263..3677b966b648 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableWithAddMethodConverter.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableWithAddMethodConverter.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections; +using System.Diagnostics; namespace System.Text.Json.Serialization.Converters { @@ -11,12 +12,15 @@ internal sealed class IEnumerableWithAddMethodConverter { protected override void Add(in object? value, ref ReadStack state) { - ((Action)state.Current.AddMethodDelegate!)((TCollection)state.Current.ReturnValue!, value); + var addMethodDelegate = ((Action?)state.Current.JsonClassInfo.AddMethodDelegate); + Debug.Assert(addMethodDelegate != null); + addMethodDelegate((TCollection)state.Current.ReturnValue!, value); } protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options) { - JsonClassInfo.ConstructorDelegate? constructorDelegate = state.Current.JsonClassInfo.CreateObject; + JsonClassInfo classInfo = state.Current.JsonClassInfo; + JsonClassInfo.ConstructorDelegate? constructorDelegate = classInfo.CreateObject; if (constructorDelegate == null) { @@ -24,7 +28,13 @@ protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStac } state.Current.ReturnValue = constructorDelegate(); - state.Current.AddMethodDelegate = GetAddMethodDelegate(options); + + // Initialize add method used to populate the collection. + if (classInfo.AddMethodDelegate == null) + { + // We verified this exists when we created the converter in the enumerable converter factory. + classInfo.AddMethodDelegate = options.MemberAccessorStrategy.CreateAddMethodDelegate(); + } } protected override bool OnWriteResume(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, ref WriteStack state) @@ -62,18 +72,5 @@ protected override bool OnWriteResume(Utf8JsonWriter writer, TCollection value, return true; } - - private Action? _addMethodDelegate; - - internal Action GetAddMethodDelegate(JsonSerializerOptions options) - { - if (_addMethodDelegate == null) - { - // We verified this exists when we created the converter in the enumerable converter factory. - _addMethodDelegate = options.MemberAccessorStrategy.CreateAddMethodDelegate(); - } - - return _addMethodDelegate; - } } } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Large.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Large.cs index 1fe65b926bd5..38b373577b84 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Large.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Large.cs @@ -19,7 +19,7 @@ protected override bool ReadAndCacheConstructorArgument(ref ReadStack state, ref bool success = jsonParameterInfo.ConverterBase.TryReadAsObject(ref reader, jsonParameterInfo.Options!, ref state, out object? arg); - if (success) + if (success && !(arg == null && jsonParameterInfo.IgnoreDefaultValuesOnRead)) { ((object[])state.Current.CtorArgumentState!.Arguments)[jsonParameterInfo.Position] = arg!; } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Small.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Small.cs index 12c3090a50e3..be414b6667fd 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Small.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Small.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; -using System.Runtime.CompilerServices; namespace System.Text.Json.Serialization.Converters { @@ -63,7 +62,14 @@ private bool TryRead( var info = (JsonParameterInfo)jsonParameterInfo; var converter = (JsonConverter)jsonParameterInfo.ConverterBase; - return converter.TryRead(ref reader, info.RuntimePropertyType, info.Options!, ref state, out arg!); + + bool success = converter.TryRead(ref reader, info.RuntimePropertyType, info.Options!, ref state, out TArg value); + + arg = value == null && jsonParameterInfo.IgnoreDefaultValuesOnRead + ? (TArg)info.DefaultValue! // Use default value specified on parameter, if any. + : value!; + + return success; } protected override void InitializeConstructorArgumentCaches(ref ReadStack state, JsonSerializerOptions options) diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/Int16Converter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/Int16Converter.cs index 83e8a4d3f841..c01ee00032cc 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/Int16Converter.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/Int16Converter.cs @@ -14,7 +14,8 @@ public override short Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSe public override void Write(Utf8JsonWriter writer, short value, JsonSerializerOptions options) { - writer.WriteNumberValue(value); + // For performance, lift up the writer implementation. + writer.WriteNumberValue((long)value); } internal override short ReadWithQuotes(ref Utf8JsonReader reader) diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/Int32Converter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/Int32Converter.cs index 7064eb4a1d75..5fc881a6b2e4 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/Int32Converter.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/Int32Converter.cs @@ -12,7 +12,8 @@ public override int Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSeri public override void Write(Utf8JsonWriter writer, int value, JsonSerializerOptions options) { - writer.WriteNumberValue(value); + // For performance, lift up the writer implementation. + writer.WriteNumberValue((long)value); } internal override int ReadWithQuotes(ref Utf8JsonReader reader) diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/StringConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/StringConverter.cs index 4e5677af54c8..f03d9ac1cba1 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/StringConverter.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/StringConverter.cs @@ -14,7 +14,15 @@ internal sealed class StringConverter : JsonConverter public override void Write(Utf8JsonWriter writer, string? value, JsonSerializerOptions options) { - writer.WriteStringValue(value); + // For performance, lift up the writer implementation. + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(value.AsSpan()); + } } internal override string ReadWithQuotes(ref Utf8JsonReader reader) diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/UInt16Converter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/UInt16Converter.cs index 3997d0794941..db2af0a5f2e3 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/UInt16Converter.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/UInt16Converter.cs @@ -12,7 +12,8 @@ public override ushort Read(ref Utf8JsonReader reader, Type typeToConvert, JsonS public override void Write(Utf8JsonWriter writer, ushort value, JsonSerializerOptions options) { - writer.WriteNumberValue(value); + // For performance, lift up the writer implementation. + writer.WriteNumberValue((long)value); } internal override ushort ReadWithQuotes(ref Utf8JsonReader reader) diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/UInt32Converter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/UInt32Converter.cs index 59284fdc86df..131e6feb1b05 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/UInt32Converter.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/UInt32Converter.cs @@ -12,7 +12,8 @@ public override uint Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSer public override void Write(Utf8JsonWriter writer, uint value, JsonSerializerOptions options) { - writer.WriteNumberValue(value); + // For performance, lift up the writer implementation. + writer.WriteNumberValue((ulong)value); } internal override uint ReadWithQuotes(ref Utf8JsonReader reader) diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonClassInfo.Cache.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonClassInfo.Cache.cs index f46cddbfdb33..785abae8a607 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonClassInfo.Cache.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonClassInfo.Cache.cs @@ -35,14 +35,14 @@ internal sealed partial class JsonClassInfo // All of the serializable parameters on a POCO constructor keyed on parameter name. // Only paramaters which bind to properties are cached. - public volatile Dictionary? ParameterCache; + public Dictionary? ParameterCache; // All of the serializable properties on a POCO (except the optional extension property) keyed on property name. - public volatile Dictionary? PropertyCache; + public Dictionary? PropertyCache; // All of the serializable properties on a POCO including the optional extension property. // Used for performance during serialization instead of 'PropertyCache' above. - public volatile JsonPropertyInfo[]? PropertyCacheArray; + public JsonPropertyInfo[]? PropertyCacheArray; // Fast cache of constructor parameters by first JSON ordering; may not contain all parameters. Accessed before ParameterCache. // Use an array (instead of List) for highest performance. @@ -52,28 +52,26 @@ internal sealed partial class JsonClassInfo // Use an array (instead of List) for highest performance. private volatile PropertyRef[]? _propertyRefsSorted; - public static JsonPropertyInfo AddProperty(PropertyInfo propertyInfo, Type parentClassType, JsonSerializerOptions options) + public static JsonPropertyInfo AddProperty(MemberInfo memberInfo, Type memberType, Type parentClassType, JsonSerializerOptions options) { - JsonIgnoreCondition? ignoreCondition = JsonPropertyInfo.GetAttribute(propertyInfo)?.Condition; + JsonIgnoreCondition? ignoreCondition = JsonPropertyInfo.GetAttribute(memberInfo)?.Condition; if (ignoreCondition == JsonIgnoreCondition.Always) { - return JsonPropertyInfo.CreateIgnoredPropertyPlaceholder(propertyInfo, options); + return JsonPropertyInfo.CreateIgnoredPropertyPlaceholder(memberInfo, options); } - Type propertyType = propertyInfo.PropertyType; - JsonConverter converter = GetConverter( - propertyType, + memberType, parentClassType, - propertyInfo, + memberInfo, out Type runtimeType, options); return CreateProperty( - declaredPropertyType: propertyType, + declaredPropertyType: memberType, runtimePropertyType: runtimeType, - propertyInfo, + memberInfo, parentClassType, converter, options, @@ -83,7 +81,7 @@ public static JsonPropertyInfo AddProperty(PropertyInfo propertyInfo, Type paren internal static JsonPropertyInfo CreateProperty( Type declaredPropertyType, Type? runtimePropertyType, - PropertyInfo? propertyInfo, + MemberInfo? memberInfo, Type parentClassType, JsonConverter converter, JsonSerializerOptions options, @@ -97,7 +95,7 @@ internal static JsonPropertyInfo CreateProperty( declaredPropertyType, runtimePropertyType, runtimeClassType: converter.ClassType, - propertyInfo, + memberInfo, converter, ignoreCondition, options); @@ -118,7 +116,7 @@ internal static JsonPropertyInfo CreatePropertyInfoForClassInfo( JsonPropertyInfo jsonPropertyInfo = CreateProperty( declaredPropertyType: declaredPropertyType, runtimePropertyType: runtimePropertyType, - propertyInfo: null, // Not a real property so this is null. + memberInfo: null, // Not a real property so this is null. parentClassType: JsonClassInfo.ObjectType, // a dummy value (not used) converter: converter, options); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonClassInfo.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonClassInfo.cs index b297f4e6dd3e..bdd5f7442671 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonClassInfo.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonClassInfo.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Reflection; +using System.Runtime.CompilerServices; using System.Text.Json.Serialization; namespace System.Text.Json @@ -21,6 +22,9 @@ internal sealed partial class JsonClassInfo public object? CreateObjectWithArgs { get; set; } + // Add method delegate for non-generic Stack and Queue; and types that derive from them. + public object? AddMethodDelegate { get; set; } + public ClassType ClassType { get; private set; } public JsonPropertyInfo? DataExtensionProperty { get; private set; } @@ -83,7 +87,7 @@ public JsonClassInfo(Type type, JsonSerializerOptions options) JsonConverter converter = GetConverter( Type, parentClassType: null, // A ClassInfo never has a "parent" class. - propertyInfo: null, // A ClassInfo never has a "parent" property. + memberInfo: null, // A ClassInfo never has a "parent" property. out Type runtimeType, Options); @@ -94,21 +98,27 @@ public JsonClassInfo(Type type, JsonSerializerOptions options) { case ClassType.Object: { - CreateObject = options.MemberAccessorStrategy.CreateConstructor(type); + CreateObject = Options.MemberAccessorStrategy.CreateConstructor(type); Dictionary cache = new Dictionary( Options.PropertyNameCaseInsensitive ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal); - Dictionary? ignoredProperties = null; + Dictionary? ignoredMembers = null; // We start from the most derived type. for (Type? currentType = type; currentType != null; currentType = currentType.BaseType) { - foreach (PropertyInfo propertyInfo in currentType.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly)) + const BindingFlags bindingFlags = + BindingFlags.Instance | + BindingFlags.Public | + BindingFlags.NonPublic | + BindingFlags.DeclaredOnly; + + foreach (PropertyInfo propertyInfo in currentType.GetProperties(bindingFlags)) { // Ignore indexers and virtual properties that have overrides that were [JsonIgnore]d. - if (propertyInfo.GetIndexParameters().Length > 0 || PropertyIsOverridenAndIgnored(propertyInfo, ignoredProperties)) + if (propertyInfo.GetIndexParameters().Length > 0 || PropertyIsOverridenAndIgnored(propertyInfo, ignoredMembers)) { continue; } @@ -117,52 +127,43 @@ public JsonClassInfo(Type type, JsonSerializerOptions options) if (propertyInfo.GetMethod?.IsPublic == true || propertyInfo.SetMethod?.IsPublic == true) { - JsonPropertyInfo jsonPropertyInfo = AddProperty(propertyInfo, currentType, options); - Debug.Assert(jsonPropertyInfo != null && jsonPropertyInfo.NameAsString != null); - - string propertyName = propertyInfo.Name; - - // The JsonPropertyNameAttribute or naming policy resulted in a collision. - if (!JsonHelpers.TryAdd(cache, jsonPropertyInfo.NameAsString, jsonPropertyInfo)) + CacheMember(currentType, propertyInfo.PropertyType, propertyInfo, cache, ref ignoredMembers); + } + else + { + if (JsonPropertyInfo.GetAttribute(propertyInfo) != null) { - JsonPropertyInfo other = cache[jsonPropertyInfo.NameAsString]; - - if (other.IsIgnored) - { - // Overwrite previously cached property since it has [JsonIgnore]. - cache[jsonPropertyInfo.NameAsString] = jsonPropertyInfo; - } - else if ( - // Does the current property have `JsonIgnoreAttribute`? - !jsonPropertyInfo.IsIgnored && - // Is the current property hidden by the previously cached property - // (with `new` keyword, or by overriding)? - other.PropertyInfo!.Name != propertyName && - // Was a property with the same CLR name ignored? That property hid the current property, - // thus, if it was ignored, the current property should be ignored too. - ignoredProperties?.ContainsKey(propertyName) != true - ) - { - // Throw if we have two public properties with the same JSON property name, - // neither overrides or hides the other, and neither have been ignored. - ThrowHelper.ThrowInvalidOperationException_SerializerPropertyNameConflict(Type, jsonPropertyInfo); - } - // Ignore the current property. + ThrowHelper.ThrowInvalidOperationException_JsonIncludeOnNonPublicInvalid(propertyInfo, currentType); } - if (jsonPropertyInfo.IsIgnored) + // Non-public properties should not be included for (de)serialization. + } + } + + foreach (FieldInfo fieldInfo in currentType.GetFields(bindingFlags)) + { + if (PropertyIsOverridenAndIgnored(fieldInfo, ignoredMembers)) + { + continue; + } + + bool hasJsonInclude = JsonPropertyInfo.GetAttribute(fieldInfo) != null; + + if (fieldInfo.IsPublic) + { + if (hasJsonInclude || Options.IncludeFields) { - (ignoredProperties ??= new Dictionary())[propertyName] = propertyInfo; + CacheMember(currentType, fieldInfo.FieldType, fieldInfo, cache, ref ignoredMembers); } } else { - if (JsonPropertyInfo.GetAttribute(propertyInfo) != null) + if (hasJsonInclude) { - ThrowHelper.ThrowInvalidOperationException_JsonIncludeOnNonPublicInvalid(propertyInfo, currentType); + ThrowHelper.ThrowInvalidOperationException_JsonIncludeOnNonPublicInvalid(fieldInfo, currentType); } - // Non-public properties should not be included for (de)serialization. + // Non-public fields should not be included for (de)serialization. } } } @@ -186,33 +187,30 @@ public JsonClassInfo(Type type, JsonSerializerOptions options) // Copy the dictionary cache to the array cache. cache.Values.CopyTo(cacheArray, 0); - // Set the array cache field at this point since it is completely initialized. - // It can now be safely accessed by other threads. + // These are not accessed by other threads until the current JsonClassInfo instance + // is finished initializing and added to the cache on JsonSerializerOptions. + PropertyCache = cache; PropertyCacheArray = cacheArray; // Allow constructor parameter logic to remove items from the dictionary since the JSON // property values will be passed to the constructor and do not call a property setter. if (converter.ConstructorIsParameterized) { - InitializeConstructorParameters(cache, converter.ConstructorInfo!); + InitializeConstructorParameters(converter.ConstructorInfo!); } - - // Set the dictionary cache field at this point since it is completely initialized. - // It can now be safely accessed by other threads. - PropertyCache = cache; } break; case ClassType.Enumerable: case ClassType.Dictionary: { ElementType = converter.ElementType; - CreateObject = options.MemberAccessorStrategy.CreateConstructor(runtimeType); + CreateObject = Options.MemberAccessorStrategy.CreateConstructor(runtimeType); } break; case ClassType.Value: case ClassType.NewValue: { - CreateObject = options.MemberAccessorStrategy.CreateConstructor(type); + CreateObject = Options.MemberAccessorStrategy.CreateConstructor(type); } break; case ClassType.None: @@ -226,54 +224,146 @@ public JsonClassInfo(Type type, JsonSerializerOptions options) } } - private void InitializeConstructorParameters(Dictionary propertyCache, ConstructorInfo constructorInfo) + private void CacheMember( + Type declaringType, + Type memberType, + MemberInfo memberInfo, + Dictionary cache, + ref Dictionary? ignoredMembers) { - ParameterInfo[] parameters = constructorInfo!.GetParameters(); - Dictionary parameterCache = new Dictionary( - parameters.Length, Options.PropertyNameCaseInsensitive ? StringComparer.OrdinalIgnoreCase : null); + JsonPropertyInfo jsonPropertyInfo = AddProperty(memberInfo, memberType, declaringType, Options); + Debug.Assert(jsonPropertyInfo.NameAsString != null); - foreach (ParameterInfo parameterInfo in parameters) + string memberName = memberInfo.Name; + + // The JsonPropertyNameAttribute or naming policy resulted in a collision. + if (!JsonHelpers.TryAdd(cache, jsonPropertyInfo.NameAsString, jsonPropertyInfo)) { - PropertyInfo? firstMatch = null; - bool isBound = false; + JsonPropertyInfo other = cache[jsonPropertyInfo.NameAsString]; - foreach (JsonPropertyInfo jsonPropertyInfo in PropertyCacheArray!) + if (other.IsIgnored) + { + // Overwrite previously cached property since it has [JsonIgnore]. + cache[jsonPropertyInfo.NameAsString] = jsonPropertyInfo; + } + else if ( + // Does the current property have `JsonIgnoreAttribute`? + !jsonPropertyInfo.IsIgnored && + // Is the current property hidden by the previously cached property + // (with `new` keyword, or by overriding)? + other.MemberInfo!.Name != memberName && + // Was a property with the same CLR name was ignored? That property hid the current property, + // thus, if it was ignored, the current property should be ignored too. + ignoredMembers?.ContainsKey(memberName) != true) { - // This is not null because it is an actual - // property on a type, not a "policy property". - PropertyInfo propertyInfo = jsonPropertyInfo.PropertyInfo!; + // We throw if we have two public properties that have the same JSON property name, and neither have been ignored. + ThrowHelper.ThrowInvalidOperationException_SerializerPropertyNameConflict(Type, jsonPropertyInfo); + } + // Ignore the current property. + } - string camelCasePropName = JsonNamingPolicy.CamelCase.ConvertName(propertyInfo.Name); + if (jsonPropertyInfo.IsIgnored) + { + (ignoredMembers ??= new Dictionary()).Add(memberName, memberInfo); + } + } - if (parameterInfo.Name == camelCasePropName && - parameterInfo.ParameterType == propertyInfo.PropertyType) - { - if (isBound) - { - Debug.Assert(firstMatch != null); - - // Multiple object properties cannot bind to the same - // constructor parameter. - ThrowHelper.ThrowInvalidOperationException_MultiplePropertiesBindToConstructorParameters( - Type, - parameterInfo, - firstMatch, - propertyInfo, - constructorInfo); - } + private sealed class ParameterLookupKey + { + public ParameterLookupKey(string name, Type type) + { + Name = name; + Type = type; + } + + public string Name { get; } + public Type Type { get; } + + public override int GetHashCode() + { + return StringComparer.OrdinalIgnoreCase.GetHashCode(Name); + } + + public override bool Equals(object? obj) + { + Debug.Assert(obj is ParameterLookupKey); + + ParameterLookupKey other = (ParameterLookupKey)obj; + return Type == other.Type && string.Equals(Name, other.Name, StringComparison.OrdinalIgnoreCase); + } + } + + private sealed class ParameterLookupValue + { + public ParameterLookupValue(JsonPropertyInfo jsonPropertyInfo) + { + JsonPropertyInfo = jsonPropertyInfo; + } - JsonParameterInfo jsonParameterInfo = AddConstructorParameter(parameterInfo, jsonPropertyInfo, Options); + public string? DuplicateName { get; set; } + public JsonPropertyInfo JsonPropertyInfo { get; } + } - // One object property cannot map to multiple constructor - // parameters (ConvertName above can't return multiple strings). - parameterCache.Add(jsonPropertyInfo.NameAsString, jsonParameterInfo); + private void InitializeConstructorParameters(ConstructorInfo constructorInfo) + { + ParameterInfo[] parameters = constructorInfo.GetParameters(); + var parameterCache = new Dictionary( + parameters.Length, Options.PropertyNameCaseInsensitive ? StringComparer.OrdinalIgnoreCase : null); - // Remove property from deserialization cache to reduce the number of JsonPropertyInfos considered during JSON matching. - propertyCache.Remove(jsonPropertyInfo.NameAsString); + static Type GetMemberType(MemberInfo memberInfo) + { + Debug.Assert(memberInfo is PropertyInfo || memberInfo is FieldInfo); - isBound = true; - firstMatch = propertyInfo; + return memberInfo is PropertyInfo propertyInfo + ? propertyInfo.PropertyType + : Unsafe.As(memberInfo).FieldType; + } + + // Cache the lookup from object property name to JsonPropertyInfo using a case-insensitive comparer. + // Case-insensitive is used to support both camel-cased parameter names and exact matches when C# + // record types or anonymous types are used. + // The property name key does not use [JsonPropertyName] or PropertyNamingPolicy since we only bind + // the parameter name to the object property name and do not use the JSON version of the name here. + var nameLookup = new Dictionary(PropertyCacheArray!.Length); + + foreach (JsonPropertyInfo jsonProperty in PropertyCacheArray!) + { + string propertyName = jsonProperty.MemberInfo!.Name; + var key = new ParameterLookupKey(propertyName, GetMemberType(jsonProperty.MemberInfo)); + var value= new ParameterLookupValue(jsonProperty); + if (!JsonHelpers.TryAdd(nameLookup, key, value)) + { + // More than one property has the same case-insensitive name and Type. + // Remember so we can throw a nice exception if this property is used as a parameter name. + ParameterLookupValue existing = nameLookup[key]; + existing!.DuplicateName = propertyName; + } + } + + foreach (ParameterInfo parameterInfo in parameters) + { + var paramToCheck = new ParameterLookupKey(parameterInfo.Name!, parameterInfo.ParameterType); + + if (nameLookup.TryGetValue(paramToCheck, out ParameterLookupValue? matchingEntry)) + { + if (matchingEntry.DuplicateName != null) + { + // Multiple object properties cannot bind to the same constructor parameter. + ThrowHelper.ThrowInvalidOperationException_MultiplePropertiesBindToConstructorParameters( + Type, + parameterInfo.Name!, + matchingEntry.JsonPropertyInfo.NameAsString, + matchingEntry.DuplicateName, + constructorInfo); } + + Debug.Assert(matchingEntry.JsonPropertyInfo != null); + JsonPropertyInfo jsonPropertyInfo = matchingEntry.JsonPropertyInfo; + JsonParameterInfo jsonParameterInfo = AddConstructorParameter(parameterInfo, jsonPropertyInfo, Options); + parameterCache.Add(jsonPropertyInfo.NameAsString, jsonParameterInfo); + + // Remove property from deserialization cache to reduce the number of JsonPropertyInfos considered during JSON matching. + PropertyCache!.Remove(jsonPropertyInfo.NameAsString); } } @@ -281,30 +371,39 @@ private void InitializeConstructorParameters(Dictionary? ignoredProperties) + private static bool PropertyIsOverridenAndIgnored(MemberInfo currentMember, Dictionary? ignoredMembers) { - if (ignoredProperties == null || !ignoredProperties.TryGetValue(currentProperty.Name, out PropertyInfo? ignoredProperty)) + if (ignoredMembers == null || !ignoredMembers.TryGetValue(currentMember.Name, out MemberInfo? ignoredProperty)) { return false; } - return currentProperty.PropertyType == ignoredProperty.PropertyType && - PropertyIsVirtual(currentProperty) && - PropertyIsVirtual(ignoredProperty); + Debug.Assert(currentMember is PropertyInfo || currentMember is FieldInfo); + PropertyInfo? currentPropertyInfo = currentMember as PropertyInfo; + Type currentMemberType = currentPropertyInfo == null + ? Unsafe.As(currentMember).FieldType + : currentPropertyInfo.PropertyType; + + Debug.Assert(ignoredProperty is PropertyInfo || ignoredProperty is FieldInfo); + PropertyInfo? ignoredPropertyInfo = ignoredProperty as PropertyInfo; + Type ignoredPropertyType = ignoredPropertyInfo == null + ? Unsafe.As(ignoredProperty).FieldType + : ignoredPropertyInfo.PropertyType; + + return currentMemberType == ignoredPropertyType && + PropertyIsVirtual(currentPropertyInfo) && + PropertyIsVirtual(ignoredPropertyInfo); } - private static bool PropertyIsVirtual(PropertyInfo propertyInfo) + private static bool PropertyIsVirtual(PropertyInfo? propertyInfo) { - return propertyInfo.GetMethod?.IsVirtual == true || propertyInfo.SetMethod?.IsVirtual == true; + return propertyInfo != null && (propertyInfo.GetMethod?.IsVirtual == true || propertyInfo.SetMethod?.IsVirtual == true); } public bool DetermineExtensionDataProperty(Dictionary cache) @@ -337,8 +436,8 @@ public bool DetermineExtensionDataProperty(Dictionary foreach (JsonPropertyInfo jsonPropertyInfo in cache.Values) { - Debug.Assert(jsonPropertyInfo.PropertyInfo != null); - Attribute? attribute = jsonPropertyInfo.PropertyInfo.GetCustomAttribute(attributeType); + Debug.Assert(jsonPropertyInfo.MemberInfo != null); + Attribute? attribute = jsonPropertyInfo.MemberInfo.GetCustomAttribute(attributeType); if (attribute != null) { if (property != null) @@ -360,12 +459,12 @@ private static JsonParameterInfo AddConstructorParameter( { if (jsonPropertyInfo.IsIgnored) { - return JsonParameterInfo.CreateIgnoredParameterPlaceholder(jsonPropertyInfo, options); + return JsonParameterInfo.CreateIgnoredParameterPlaceholder(jsonPropertyInfo); } JsonConverter converter = jsonPropertyInfo.ConverterBase; - JsonParameterInfo jsonParameterInfo = converter.CreateJsonParameterInfo(); + jsonParameterInfo.Initialize( jsonPropertyInfo.RuntimePropertyType!, parameterInfo, @@ -384,14 +483,14 @@ private static JsonParameterInfo AddConstructorParameter( public static JsonConverter GetConverter( Type type, Type? parentClassType, - PropertyInfo? propertyInfo, + MemberInfo? memberInfo, out Type runtimeType, JsonSerializerOptions options) { Debug.Assert(type != null); - ValidateType(type, parentClassType, propertyInfo, options); + ValidateType(type, parentClassType, memberInfo, options); - JsonConverter converter = options.DetermineConverter(parentClassType, type, propertyInfo)!; + JsonConverter converter = options.DetermineConverter(parentClassType, type, memberInfo); // The runtimeType is the actual value being assigned to the property. // There are three types to consider for the runtimeType: @@ -438,11 +537,11 @@ public static JsonConverter GetConverter( return converter; } - private static void ValidateType(Type type, Type? parentClassType, PropertyInfo? propertyInfo, JsonSerializerOptions options) + private static void ValidateType(Type type, Type? parentClassType, MemberInfo? memberInfo, JsonSerializerOptions options) { if (!options.TypeIsCached(type) && IsInvalidForSerialization(type)) { - ThrowHelper.ThrowInvalidOperationException_CannotSerializeInvalidType(type, parentClassType, propertyInfo); + ThrowHelper.ThrowInvalidOperationException_CannotSerializeInvalidType(type, parentClassType, memberInfo); } } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs index 6dff53f1a7c0..52dba1df4bb4 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs @@ -149,6 +149,19 @@ internal bool TryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSeriali ref reader); } + if (CanBePolymorphic && options.ReferenceHandler != null) + { + // Edge case where we want to lookup for a reference when parsing into typeof(object) + // instead of return `value` as a JsonElement. + Debug.Assert(TypeToConvert == typeof(object)); + Debug.Assert(value is JsonElement); + + if (JsonSerializer.TryGetReferenceFromJsonElement(ref state, (JsonElement)(object)value, out object? referenceValue)) + { + value = (T)referenceValue; + } + } + return true; } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonIgnoreCondition.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonIgnoreCondition.cs index 3b4d6da14ec5..f54b45f97cbf 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonIgnoreCondition.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonIgnoreCondition.cs @@ -5,9 +5,10 @@ namespace System.Text.Json.Serialization { /// /// When specified on , - /// specifies that properties with default values are ignored during serialization. + /// determines when properties and fields across the type graph are ignored. /// When specified on , controls whether - /// a property is ignored during serialization and deserialization. + /// a property is ignored during serialization and deserialization. This option + /// overrides the setting on . /// public enum JsonIgnoreCondition { @@ -21,7 +22,13 @@ public enum JsonIgnoreCondition Always = 1, /// /// If the value is the default, the property is ignored during serialization. + /// This is applied to both reference and value-type properties and fields. /// WhenWritingDefault = 2, + /// + /// If the value is , the property is ignored during serialization. + /// This is applied only to reference-type properties and fields. + /// + WhenWritingNull = 3, } } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonParameterInfo.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonParameterInfo.cs index c9b767f479e6..0ccdbeeafda1 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonParameterInfo.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonParameterInfo.cs @@ -19,6 +19,8 @@ internal abstract class JsonParameterInfo // The default value of the parameter. This is `DefaultValue` of the `ParameterInfo`, if specified, or the CLR `default` for the `ParameterType`. public object? DefaultValue { get; protected set; } + public bool IgnoreDefaultValuesOnRead { get; private set; } + // Options can be referenced here since all JsonPropertyInfos originate from a JsonClassInfo that is cached on JsonSerializerOptions. public JsonSerializerOptions? Options { get; set; } // initialized in Init method @@ -60,13 +62,12 @@ public virtual void Initialize( Options = options; ShouldDeserialize = true; ConverterBase = matchingProperty.ConverterBase; + IgnoreDefaultValuesOnRead = matchingProperty.IgnoreDefaultValuesOnRead; } // Create a parameter that is ignored at run-time. It uses the same type (typeof(sbyte)) to help // prevent issues with unsupported types and helps ensure we don't accidently (de)serialize it. - public static JsonParameterInfo CreateIgnoredParameterPlaceholder( - JsonPropertyInfo matchingProperty, - JsonSerializerOptions options) + public static JsonParameterInfo CreateIgnoredParameterPlaceholder(JsonPropertyInfo matchingProperty) { return new JsonParameterInfo { diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonPropertyInfo.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonPropertyInfo.cs index f767095bb244..38adc919f9ed 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonPropertyInfo.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonPropertyInfo.cs @@ -4,12 +4,11 @@ using System.Collections.Generic; using System.Diagnostics; using System.Reflection; -using System.Runtime.CompilerServices; using System.Text.Json.Serialization; namespace System.Text.Json { - [DebuggerDisplay("PropertyInfo={PropertyInfo}")] + [DebuggerDisplay("MemberInfo={MemberInfo}")] internal abstract class JsonPropertyInfo { public static readonly JsonPropertyInfo s_missingProperty = GetPropertyPlaceholder(); @@ -35,11 +34,11 @@ public static JsonPropertyInfo GetPropertyPlaceholder() // Create a property that is ignored at run-time. It uses the same type (typeof(sbyte)) to help // prevent issues with unsupported types and helps ensure we don't accidently (de)serialize it. - public static JsonPropertyInfo CreateIgnoredPropertyPlaceholder(PropertyInfo propertyInfo, JsonSerializerOptions options) + public static JsonPropertyInfo CreateIgnoredPropertyPlaceholder(MemberInfo memberInfo, JsonSerializerOptions options) { JsonPropertyInfo jsonPropertyInfo = new JsonPropertyInfo(); jsonPropertyInfo.Options = options; - jsonPropertyInfo.PropertyInfo = propertyInfo; + jsonPropertyInfo.MemberInfo = memberInfo; jsonPropertyInfo.DeterminePropertyName(); jsonPropertyInfo.IsIgnored = true; @@ -53,12 +52,12 @@ public static JsonPropertyInfo CreateIgnoredPropertyPlaceholder(PropertyInfo pro private void DeterminePropertyName() { - if (PropertyInfo == null) + if (MemberInfo == null) { return; } - JsonPropertyNameAttribute? nameAttribute = GetAttribute(PropertyInfo); + JsonPropertyNameAttribute? nameAttribute = GetAttribute(MemberInfo); if (nameAttribute != null) { string name = nameAttribute.Name; @@ -71,7 +70,7 @@ private void DeterminePropertyName() } else if (Options.PropertyNamingPolicy != null) { - string name = Options.PropertyNamingPolicy.ConvertName(PropertyInfo.Name); + string name = Options.PropertyNamingPolicy.ConvertName(MemberInfo.Name); if (name == null) { ThrowHelper.ThrowInvalidOperationException_SerializerPropertyNameNull(ParentClassType, this); @@ -81,7 +80,7 @@ private void DeterminePropertyName() } else { - NameAsString = PropertyInfo.Name; + NameAsString = MemberInfo.Name; } Debug.Assert(NameAsString != null); @@ -97,10 +96,12 @@ private void DetermineSerializationCapabilities(JsonIgnoreCondition? ignoreCondi Debug.Assert(ignoreCondition != JsonIgnoreCondition.Always); // Three possible values for ignoreCondition: - // null = JsonIgnore was not placed on this property, global IgnoreReadOnlyProperties wins - // WhenNull = only ignore when null, global IgnoreReadOnlyProperties loses - // Never = never ignore (always include), global IgnoreReadOnlyProperties loses - bool serializeReadOnlyProperty = ignoreCondition != null || !Options.IgnoreReadOnlyProperties; + // null = JsonIgnore was not placed on this property, global IgnoreReadOnlyProperties/Fields wins + // WhenNull = only ignore when null, global IgnoreReadOnlyProperties/Fields loses + // Never = never ignore (always include), global IgnoreReadOnlyProperties/Fields loses + bool serializeReadOnlyProperty = ignoreCondition != null || (MemberInfo is PropertyInfo + ? !Options.IgnoreReadOnlyProperties + : !Options.IgnoreReadOnlyFields); // We serialize if there is a getter + not ignoring readonly properties. ShouldSerialize = HasGetter && (HasSetter || serializeReadOnlyProperty); @@ -124,25 +125,46 @@ private void DetermineSerializationCapabilities(JsonIgnoreCondition? ignoreCondi } } - private void DetermineIgnoreCondition(JsonIgnoreCondition? ignoreCondition) + private void DetermineIgnoreCondition(JsonIgnoreCondition? ignoreCondition, bool defaultValueIsNull) { if (ignoreCondition != null) { - Debug.Assert(PropertyInfo != null); + Debug.Assert(MemberInfo != null); Debug.Assert(ignoreCondition != JsonIgnoreCondition.Always); - if (ignoreCondition != JsonIgnoreCondition.Never) + if (ignoreCondition == JsonIgnoreCondition.WhenWritingDefault) { - Debug.Assert(ignoreCondition == JsonIgnoreCondition.WhenWritingDefault); IgnoreDefaultValuesOnWrite = true; } + else if (ignoreCondition == JsonIgnoreCondition.WhenWritingNull) + { + if (defaultValueIsNull) + { + IgnoreDefaultValuesOnWrite = true; + } + else + { + ThrowHelper.ThrowInvalidOperationException_IgnoreConditionOnValueTypeInvalid(this); + } + } } #pragma warning disable CS0618 // IgnoreNullValues is obsolete else if (Options.IgnoreNullValues) { Debug.Assert(Options.DefaultIgnoreCondition == JsonIgnoreCondition.Never); - IgnoreDefaultValuesOnRead = true; - IgnoreDefaultValuesOnWrite = true; + if (defaultValueIsNull) + { + IgnoreDefaultValuesOnRead = true; + IgnoreDefaultValuesOnWrite = true; + } + } + else if (Options.DefaultIgnoreCondition == JsonIgnoreCondition.WhenWritingNull) + { + Debug.Assert(!Options.IgnoreNullValues); + if (defaultValueIsNull) + { + IgnoreDefaultValuesOnWrite = true; + } } else if (Options.DefaultIgnoreCondition == JsonIgnoreCondition.WhenWritingDefault) { @@ -152,19 +174,19 @@ private void DetermineIgnoreCondition(JsonIgnoreCondition? ignoreCondition) #pragma warning restore CS0618 // IgnoreNullValues is obsolete } - public static TAttribute? GetAttribute(PropertyInfo propertyInfo) where TAttribute : Attribute + public static TAttribute? GetAttribute(MemberInfo memberInfo) where TAttribute : Attribute { - return (TAttribute?)propertyInfo.GetCustomAttribute(typeof(TAttribute), inherit: false); + return (TAttribute?)memberInfo.GetCustomAttribute(typeof(TAttribute), inherit: false); } public abstract bool GetMemberAndWriteJson(object obj, ref WriteStack state, Utf8JsonWriter writer); public abstract bool GetMemberAndWriteJsonExtensionData(object obj, ref WriteStack state, Utf8JsonWriter writer); - public virtual void GetPolicies(JsonIgnoreCondition? ignoreCondition) + public virtual void GetPolicies(JsonIgnoreCondition? ignoreCondition, bool defaultValueIsNull) { DetermineSerializationCapabilities(ignoreCondition); DeterminePropertyName(); - DetermineIgnoreCondition(ignoreCondition); + DetermineIgnoreCondition(ignoreCondition, defaultValueIsNull); } public abstract object? GetValueAsObject(object obj); @@ -177,7 +199,7 @@ public virtual void Initialize( Type declaredPropertyType, Type? runtimePropertyType, ClassType runtimeClassType, - PropertyInfo? propertyInfo, + MemberInfo? memberInfo, JsonConverter converter, JsonIgnoreCondition? ignoreCondition, JsonSerializerOptions options) @@ -188,7 +210,7 @@ public virtual void Initialize( DeclaredPropertyType = declaredPropertyType; RuntimePropertyType = runtimePropertyType; ClassType = runtimeClassType; - PropertyInfo = propertyInfo; + MemberInfo = memberInfo; ConverterBase = converter; Options = options; } @@ -300,7 +322,7 @@ public bool ReadJsonExtensionDataValue(ref ReadStack state, ref Utf8JsonReader r public Type ParentClassType { get; private set; } = null!; - public PropertyInfo? PropertyInfo { get; private set; } + public MemberInfo? MemberInfo { get; private set; } public JsonClassInfo RuntimeClassInfo { diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonPropertyInfoOfT.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonPropertyInfoOfT.cs index dd28fb37ff0d..83c5ee116372 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonPropertyInfoOfT.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonPropertyInfoOfT.cs @@ -25,7 +25,7 @@ public override void Initialize( Type declaredPropertyType, Type? runtimePropertyType, ClassType runtimeClassType, - PropertyInfo? propertyInfo, + MemberInfo? memberInfo, JsonConverter converter, JsonIgnoreCondition? ignoreCondition, JsonSerializerOptions options) @@ -35,37 +35,61 @@ public override void Initialize( declaredPropertyType, runtimePropertyType, runtimeClassType, - propertyInfo, + memberInfo, converter, ignoreCondition, options); - if (propertyInfo != null) + switch (memberInfo) { - bool useNonPublicAccessors = GetAttribute(propertyInfo) != null; + case PropertyInfo propertyInfo: + { + bool useNonPublicAccessors = GetAttribute(propertyInfo) != null; + + MethodInfo? getMethod = propertyInfo.GetMethod; + if (getMethod != null && (getMethod.IsPublic || useNonPublicAccessors)) + { + HasGetter = true; + Get = options.MemberAccessorStrategy.CreatePropertyGetter(propertyInfo); + } + + MethodInfo? setMethod = propertyInfo.SetMethod; + if (setMethod != null && (setMethod.IsPublic || useNonPublicAccessors)) + { + HasSetter = true; + Set = options.MemberAccessorStrategy.CreatePropertySetter(propertyInfo); + } + + break; + } - MethodInfo? getMethod = propertyInfo.GetMethod; - if (getMethod != null && (getMethod.IsPublic || useNonPublicAccessors)) - { - HasGetter = true; - Get = options.MemberAccessorStrategy.CreatePropertyGetter(propertyInfo); - } + case FieldInfo fieldInfo: + { + Debug.Assert(fieldInfo.IsPublic); - MethodInfo? setMethod = propertyInfo.SetMethod; - if (setMethod != null && (setMethod.IsPublic || useNonPublicAccessors)) - { - HasSetter = true; - Set = options.MemberAccessorStrategy.CreatePropertySetter(propertyInfo); - } - } - else - { - IsForClassInfo = true; - HasGetter = true; - HasSetter = true; + HasGetter = true; + Get = options.MemberAccessorStrategy.CreateFieldGetter(fieldInfo); + + if (!fieldInfo.IsInitOnly) + { + HasSetter = true; + Set = options.MemberAccessorStrategy.CreateFieldSetter(fieldInfo); + } + + break; + } + + default: + { + IsForClassInfo = true; + HasGetter = true; + HasSetter = true; + + break; + } } - GetPolicies(ignoreCondition); + GetPolicies(ignoreCondition, defaultValueIsNull: Converter.CanBeNull); } public override JsonConverter ConverterBase @@ -97,7 +121,7 @@ public override bool GetMemberAndWriteJson(object obj, ref WriteStack state, Utf T value = Get!(obj); // Since devirtualization only works in non-shared generics, - // the default comparer is uded only for value types for now. + // the default comparer is used only for value types for now. // For reference types there is a quick check for null. if (IgnoreDefaultValuesOnWrite && ( default(T) == null ? value == null : EqualityComparer.Default.Equals(default, value))) diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandleMetadata.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandleMetadata.cs index fe75ab4d593e..26a2fb116088 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandleMetadata.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandleMetadata.cs @@ -12,6 +12,9 @@ public static partial class JsonSerializer internal static readonly byte[] s_idPropertyName = new byte[] { (byte)'$', (byte)'i', (byte)'d' }; + internal static ReadOnlySpan s_refPropertyName + => new byte[] { (byte)'$', (byte)'r', (byte)'e', (byte)'f' }; + /// /// Returns true if successful, false is the reader ran out of buffer. /// Sets state.Current.ReturnValue to the $ref target for MetadataRefProperty cases. @@ -270,5 +273,46 @@ internal static MetadataPropertyName GetMetadataPropertyName(ReadOnlySpan return MetadataPropertyName.NoMetadata; } + + internal static bool TryGetReferenceFromJsonElement( + ref ReadStack state, + JsonElement element, + out object? referenceValue) + { + bool refMetadataFound = false; + referenceValue = default; + + if (element.ValueKind == JsonValueKind.Object) + { + int propertyCount = 0; + foreach (JsonProperty property in element.EnumerateObject()) + { + propertyCount++; + if (refMetadataFound) + { + // There are more properties in an object with $ref. + ThrowHelper.ThrowJsonException_MetadataReferenceObjectCannotContainOtherProperties(); + } + else if (property.EscapedNameEquals(s_refPropertyName)) + { + if (propertyCount > 1) + { + // $ref was found but there were other properties before. + ThrowHelper.ThrowJsonException_MetadataReferenceObjectCannotContainOtherProperties(); + } + + if (property.Value.ValueKind != JsonValueKind.String) + { + ThrowHelper.ThrowJsonException_MetadataValueWasNotString(property.Value.ValueKind); + } + + referenceValue = state.ReferenceResolver.ResolveReference(property.Value.GetString()!); + refMetadataFound = true; + } + } + } + + return refMetadataFound; + } } } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Converters.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Converters.cs index 59a9c510194e..0796280c369d 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Converters.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Converters.cs @@ -145,21 +145,21 @@ void Add(JsonConverter converter) => /// public IList Converters { get; } - internal JsonConverter DetermineConverter(Type? parentClassType, Type runtimePropertyType, PropertyInfo? propertyInfo) + internal JsonConverter DetermineConverter(Type? parentClassType, Type runtimePropertyType, MemberInfo? memberInfo) { JsonConverter converter = null!; // Priority 1: attempt to get converter from JsonConverterAttribute on property. - if (propertyInfo != null) + if (memberInfo != null) { Debug.Assert(parentClassType != null); JsonConverterAttribute? converterAttribute = (JsonConverterAttribute?) - GetAttributeThatCanHaveMultiple(parentClassType!, typeof(JsonConverterAttribute), propertyInfo); + GetAttributeThatCanHaveMultiple(parentClassType!, typeof(JsonConverterAttribute), memberInfo); if (converterAttribute != null) { - converter = GetConverterFromAttribute(converterAttribute, typeToConvert: runtimePropertyType, classTypeAttributeIsOn: parentClassType!, propertyInfo); + converter = GetConverterFromAttribute(converterAttribute, typeToConvert: runtimePropertyType, classTypeAttributeIsOn: parentClassType!, memberInfo); } } @@ -221,7 +221,7 @@ public JsonConverter GetConverter(Type typeToConvert) if (converterAttribute != null) { - converter = GetConverterFromAttribute(converterAttribute, typeToConvert: typeToConvert, classTypeAttributeIsOn: typeToConvert, propertyInfo: null); + converter = GetConverterFromAttribute(converterAttribute, typeToConvert: typeToConvert, classTypeAttributeIsOn: typeToConvert, memberInfo: null); } } @@ -278,7 +278,7 @@ public JsonConverter GetConverter(Type typeToConvert) return converter; } - private JsonConverter GetConverterFromAttribute(JsonConverterAttribute converterAttribute, Type typeToConvert, Type classTypeAttributeIsOn, PropertyInfo? propertyInfo) + private JsonConverter GetConverterFromAttribute(JsonConverterAttribute converterAttribute, Type typeToConvert, Type classTypeAttributeIsOn, MemberInfo? memberInfo) { JsonConverter? converter; @@ -289,7 +289,7 @@ private JsonConverter GetConverterFromAttribute(JsonConverterAttribute converter converter = converterAttribute.CreateConverter(typeToConvert); if (converter == null) { - ThrowHelper.ThrowInvalidOperationException_SerializationConverterOnAttributeNotCompatible(classTypeAttributeIsOn, propertyInfo, typeToConvert); + ThrowHelper.ThrowInvalidOperationException_SerializationConverterOnAttributeNotCompatible(classTypeAttributeIsOn, memberInfo, typeToConvert); } } else @@ -297,7 +297,7 @@ private JsonConverter GetConverterFromAttribute(JsonConverterAttribute converter ConstructorInfo? ctor = type.GetConstructor(Type.EmptyTypes); if (!typeof(JsonConverter).IsAssignableFrom(type) || ctor == null || !ctor.IsPublic) { - ThrowHelper.ThrowInvalidOperationException_SerializationConverterOnAttributeInvalid(classTypeAttributeIsOn, propertyInfo); + ThrowHelper.ThrowInvalidOperationException_SerializationConverterOnAttributeInvalid(classTypeAttributeIsOn, memberInfo); } converter = (JsonConverter)Activator.CreateInstance(type)!; @@ -313,16 +313,16 @@ private JsonConverter GetConverterFromAttribute(JsonConverterAttribute converter return NullableConverterFactory.CreateValueConverter(underlyingType, converter); } - ThrowHelper.ThrowInvalidOperationException_SerializationConverterOnAttributeNotCompatible(classTypeAttributeIsOn, propertyInfo, typeToConvert); + ThrowHelper.ThrowInvalidOperationException_SerializationConverterOnAttributeNotCompatible(classTypeAttributeIsOn, memberInfo, typeToConvert); } return converter; } - private static Attribute? GetAttributeThatCanHaveMultiple(Type classType, Type attributeType, PropertyInfo propertyInfo) + private static Attribute? GetAttributeThatCanHaveMultiple(Type classType, Type attributeType, MemberInfo memberInfo) { - object[] attributes = propertyInfo.GetCustomAttributes(attributeType, inherit: false); - return GetAttributeThatCanHaveMultiple(attributeType, classType, propertyInfo, attributes); + object[] attributes = memberInfo.GetCustomAttributes(attributeType, inherit: false); + return GetAttributeThatCanHaveMultiple(attributeType, classType, memberInfo, attributes); } private static Attribute? GetAttributeThatCanHaveMultiple(Type classType, Type attributeType) @@ -331,7 +331,7 @@ private JsonConverter GetConverterFromAttribute(JsonConverterAttribute converter return GetAttributeThatCanHaveMultiple(attributeType, classType, null, attributes); } - private static Attribute? GetAttributeThatCanHaveMultiple(Type attributeType, Type classType, PropertyInfo? propertyInfo, object[] attributes) + private static Attribute? GetAttributeThatCanHaveMultiple(Type attributeType, Type classType, MemberInfo? memberInfo, object[] attributes) { if (attributes.Length == 0) { @@ -343,7 +343,7 @@ private JsonConverter GetConverterFromAttribute(JsonConverterAttribute converter return (Attribute)attributes[0]; } - ThrowHelper.ThrowInvalidOperationException_SerializationDuplicateAttribute(attributeType, classType, propertyInfo); + ThrowHelper.ThrowInvalidOperationException_SerializationDuplicateAttribute(attributeType, classType, memberInfo); return default; } } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs index cba01879ff8d..e26eb9e0176a 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs @@ -40,6 +40,8 @@ public sealed partial class JsonSerializerOptions private bool _haveTypesBeenCreated; private bool _ignoreNullValues; private bool _ignoreReadOnlyProperties; + private bool _ignoreReadonlyFields; + private bool _includeFields; private bool _propertyNameCaseInsensitive; private bool _writeIndented; @@ -78,6 +80,8 @@ public JsonSerializerOptions(JsonSerializerOptions options) _allowTrailingCommas = options._allowTrailingCommas; _ignoreNullValues = options._ignoreNullValues; _ignoreReadOnlyProperties = options._ignoreReadOnlyProperties; + _ignoreReadonlyFields = options._ignoreReadonlyFields; + _includeFields = options._includeFields; _propertyNameCaseInsensitive = options._propertyNameCaseInsensitive; _writeIndented = options._writeIndented; @@ -216,7 +220,6 @@ public bool IgnoreNullValues if (value && _defaultIgnoreCondition != JsonIgnoreCondition.Never) { - Debug.Assert(_defaultIgnoreCondition == JsonIgnoreCondition.WhenWritingDefault); throw new InvalidOperationException(SR.DefaultIgnoreConditionAlreadySpecified); } @@ -283,6 +286,50 @@ public bool IgnoreReadOnlyProperties } } + /// + /// Determines whether read-only fields are ignored during serialization. + /// A property is read-only if it isn't marked with the readonly keyword. + /// The default value is false. + /// + /// + /// Read-only fields are not deserialized regardless of this setting. + /// + /// + /// Thrown if this property is set after serialization or deserialization has occurred. + /// + public bool IgnoreReadOnlyFields + { + get + { + return _ignoreReadonlyFields; + } + set + { + VerifyMutable(); + _ignoreReadonlyFields = value; + } + } + + /// + /// Determines whether fields are handled serialization and deserialization. + /// The default value is false. + /// + /// + /// Thrown if this property is set after serialization or deserialization has occurred. + /// + public bool IncludeFields + { + get + { + return _includeFields; + } + set + { + VerifyMutable(); + _includeFields = value; + } + } + /// /// Gets or sets the maximum depth allowed when serializing or deserializing JSON, with the default (i.e. 0) indicating a max depth of 64. /// diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/MemberAccessor.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/MemberAccessor.cs index a9415810560b..badc1b45a711 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/MemberAccessor.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/MemberAccessor.cs @@ -24,5 +24,9 @@ public abstract JsonClassInfo.ParameterizedConstructorDelegate CreatePropertyGetter(PropertyInfo propertyInfo); public abstract Action CreatePropertySetter(PropertyInfo propertyInfo); + + public abstract Func CreateFieldGetter(FieldInfo fieldInfo); + + public abstract Action CreateFieldSetter(FieldInfo fieldInfo); } } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReadStackFrame.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReadStackFrame.cs index 650c1c27c8c1..b0c333568bda 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReadStackFrame.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReadStackFrame.cs @@ -39,9 +39,6 @@ internal struct ReadStackFrame public int PropertyIndex; public List? PropertyRefCache; - // Add method delegate for Non-generic Stack and Queue; and types that derive from them. - public object? AddMethodDelegate; - // Holds relevant state when deserializing objects with parameterized constructors. public int CtorArgumentStateIndex; public ArgumentState? CtorArgumentState; @@ -89,7 +86,6 @@ public bool IsProcessingEnumerable() public void Reset() { - AddMethodDelegate = null; CtorArgumentStateIndex = 0; CtorArgumentState = null; JsonClassInfo = null!; diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReflectionEmitMemberAccessor.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReflectionEmitMemberAccessor.cs index 5a0e3ad884b2..5e7d1e8c0944 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReflectionEmitMemberAccessor.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReflectionEmitMemberAccessor.cs @@ -220,33 +220,29 @@ private static DynamicMethod CreateImmutableDictionaryCreateRangeDelegate(Type c } public override Func CreatePropertyGetter(PropertyInfo propertyInfo) => - CreateDelegate>(CreatePropertyGetter(propertyInfo, propertyInfo.DeclaringType!, typeof(TProperty))); + CreateDelegate>(CreatePropertyGetter(propertyInfo, typeof(TProperty))); - private static DynamicMethod CreatePropertyGetter(PropertyInfo propertyInfo, Type classType, Type propertyType) + private static DynamicMethod CreatePropertyGetter(PropertyInfo propertyInfo, Type propertyType) { MethodInfo? realMethod = propertyInfo.GetMethod; - Type objectType = JsonClassInfo.ObjectType; - Debug.Assert(realMethod != null); - var dynamicMethod = new DynamicMethod( - realMethod.Name, - propertyType, - new[] { objectType }, - typeof(ReflectionEmitMemberAccessor).Module, - skipVisibility: true); + Type? declaringType = propertyInfo.DeclaringType; + Debug.Assert(declaringType != null); + + DynamicMethod dynamicMethod = CreateGetterMethod(propertyInfo.Name, propertyType); ILGenerator generator = dynamicMethod.GetILGenerator(); generator.Emit(OpCodes.Ldarg_0); - if (classType.IsValueType) + if (declaringType.IsValueType) { - generator.Emit(OpCodes.Unbox, classType); + generator.Emit(OpCodes.Unbox, declaringType); generator.Emit(OpCodes.Call, realMethod); } else { - generator.Emit(OpCodes.Castclass, classType); + generator.Emit(OpCodes.Castclass, declaringType); generator.Emit(OpCodes.Callvirt, realMethod); } @@ -256,34 +252,30 @@ private static DynamicMethod CreatePropertyGetter(PropertyInfo propertyInfo, Typ } public override Action CreatePropertySetter(PropertyInfo propertyInfo) => - CreateDelegate>(CreatePropertySetter(propertyInfo, propertyInfo.DeclaringType!, typeof(TProperty))); + CreateDelegate>(CreatePropertySetter(propertyInfo, typeof(TProperty))); - private static DynamicMethod CreatePropertySetter(PropertyInfo propertyInfo, Type classType, Type propertyType) + private static DynamicMethod CreatePropertySetter(PropertyInfo propertyInfo, Type propertyType) { MethodInfo? realMethod = propertyInfo.SetMethod; - Type objectType = JsonClassInfo.ObjectType; - Debug.Assert(realMethod != null); - var dynamicMethod = new DynamicMethod( - realMethod.Name, - typeof(void), - new[] { objectType, propertyType }, - typeof(ReflectionEmitMemberAccessor).Module, - skipVisibility: true); + Type? declaringType = propertyInfo.DeclaringType; + Debug.Assert(declaringType != null); + + DynamicMethod dynamicMethod = CreateSetterMethod(propertyInfo.Name, propertyType); ILGenerator generator = dynamicMethod.GetILGenerator(); generator.Emit(OpCodes.Ldarg_0); - if (classType.IsValueType) + if (declaringType.IsValueType) { - generator.Emit(OpCodes.Unbox, classType); + generator.Emit(OpCodes.Unbox, declaringType); generator.Emit(OpCodes.Ldarg_1); generator.Emit(OpCodes.Call, realMethod); } else { - generator.Emit(OpCodes.Castclass, classType); + generator.Emit(OpCodes.Castclass, declaringType); generator.Emit(OpCodes.Ldarg_1); generator.Emit(OpCodes.Callvirt, realMethod); }; @@ -293,6 +285,69 @@ private static DynamicMethod CreatePropertySetter(PropertyInfo propertyInfo, Typ return dynamicMethod; } + public override Func CreateFieldGetter(FieldInfo fieldInfo) => + CreateDelegate>(CreateFieldGetter(fieldInfo, typeof(TProperty))); + + private static DynamicMethod CreateFieldGetter(FieldInfo fieldInfo, Type fieldType) + { + Type? declaringType = fieldInfo.DeclaringType; + Debug.Assert(declaringType != null); + + DynamicMethod dynamicMethod = CreateGetterMethod(fieldInfo.Name, fieldType); + ILGenerator generator = dynamicMethod.GetILGenerator(); + + generator.Emit(OpCodes.Ldarg_0); + generator.Emit( + declaringType.IsValueType + ? OpCodes.Unbox + : OpCodes.Castclass, + declaringType); + generator.Emit(OpCodes.Ldfld, fieldInfo); + generator.Emit(OpCodes.Ret); + + return dynamicMethod; + } + + public override Action CreateFieldSetter(FieldInfo fieldInfo) => + CreateDelegate>(CreateFieldSetter(fieldInfo, typeof(TProperty))); + + private static DynamicMethod CreateFieldSetter(FieldInfo fieldInfo, Type fieldType) + { + Type? declaringType = fieldInfo.DeclaringType; + Debug.Assert(declaringType != null); + + DynamicMethod dynamicMethod = CreateSetterMethod(fieldInfo.Name, fieldType); + ILGenerator generator = dynamicMethod.GetILGenerator(); + + generator.Emit(OpCodes.Ldarg_0); + generator.Emit( + declaringType.IsValueType + ? OpCodes.Unbox + : OpCodes.Castclass, + declaringType); + generator.Emit(OpCodes.Ldarg_1); + generator.Emit(OpCodes.Stfld, fieldInfo); + generator.Emit(OpCodes.Ret); + + return dynamicMethod; + } + + private static DynamicMethod CreateGetterMethod(string memberName, Type memberType) => + new DynamicMethod( + memberName + "Getter", + memberType, + new[] { JsonClassInfo.ObjectType }, + typeof(ReflectionEmitMemberAccessor).Module, + skipVisibility: true); + + private static DynamicMethod CreateSetterMethod(string memberName, Type memberType) => + new DynamicMethod( + memberName + "Setter", + typeof(void), + new[] { JsonClassInfo.ObjectType, memberType }, + typeof(ReflectionEmitMemberAccessor).Module, + skipVisibility: true); + [return: NotNullIfNotNull("method")] private static T? CreateDelegate(DynamicMethod? method) where T : Delegate => (T?)method?.CreateDelegate(typeof(T)); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReflectionMemberAccessor.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReflectionMemberAccessor.cs index 4570543c77f0..bb9537d50384 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReflectionMemberAccessor.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReflectionMemberAccessor.cs @@ -156,5 +156,17 @@ public override Action CreatePropertySetter(Proper setMethodInfo.Invoke(obj, new object[] { value! }); }; } + + public override Func CreateFieldGetter(FieldInfo fieldInfo) => + delegate (object obj) + { + return (TProperty)fieldInfo.GetValue(obj)!; + }; + + public override Action CreateFieldSetter(FieldInfo fieldInfo) => + delegate (object obj, TProperty value) + { + fieldInfo.SetValue(obj, value); + }; } } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/WriteStack.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/WriteStack.cs index 5cfafb3eef7e..ec90b0c75e02 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/WriteStack.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/WriteStack.cs @@ -203,7 +203,7 @@ public string PropertyPath() void AppendStackFrame(StringBuilder sb, in WriteStackFrame frame) { // Append the property name. - string? propertyName = frame.DeclaredJsonPropertyInfo?.PropertyInfo?.Name; + string? propertyName = frame.DeclaredJsonPropertyInfo?.MemberInfo?.Name; if (propertyName == null) { // Attempt to get the JSON property name from the property name specified in re-entry. diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Serialization.cs b/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Serialization.cs index e91db0dd8875..2194ab03fab1 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Serialization.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Serialization.cs @@ -11,13 +11,6 @@ namespace System.Text.Json { internal static partial class ThrowHelper { - [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] - public static void ThrowOutOfMemoryException_BufferMaximumSizeExceeded(uint capacity) - { - throw new OutOfMemoryException(SR.Format(SR.BufferMaximumSizeExceeded, capacity)); - } - [DoesNotReturn] [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowArgumentException_DeserializeWrongType(Type type, object value) @@ -100,16 +93,16 @@ public static void ThrowJsonException(string? message = null) [DoesNotReturn] [MethodImpl(MethodImplOptions.NoInlining)] - public static void ThrowInvalidOperationException_CannotSerializeInvalidType(Type type, Type? parentClassType, PropertyInfo? propertyInfo) + public static void ThrowInvalidOperationException_CannotSerializeInvalidType(Type type, Type? parentClassType, MemberInfo? memberInfo) { if (parentClassType == null) { - Debug.Assert(propertyInfo == null); + Debug.Assert(memberInfo == null); throw new InvalidOperationException(SR.Format(SR.CannotSerializeInvalidType, type)); } - Debug.Assert(propertyInfo != null); - throw new InvalidOperationException(SR.Format(SR.CannotSerializeInvalidMember, type, propertyInfo.Name, parentClassType)); + Debug.Assert(memberInfo != null); + throw new InvalidOperationException(SR.Format(SR.CannotSerializeInvalidMember, type, memberInfo.Name, parentClassType)); } [DoesNotReturn] @@ -121,12 +114,12 @@ public static void ThrowInvalidOperationException_SerializationConverterNotCompa [DoesNotReturn] [MethodImpl(MethodImplOptions.NoInlining)] - public static void ThrowInvalidOperationException_SerializationConverterOnAttributeInvalid(Type classType, PropertyInfo? propertyInfo) + public static void ThrowInvalidOperationException_SerializationConverterOnAttributeInvalid(Type classType, MemberInfo? memberInfo) { string location = classType.ToString(); - if (propertyInfo != null) + if (memberInfo != null) { - location += $".{propertyInfo.Name}"; + location += $".{memberInfo.Name}"; } throw new InvalidOperationException(SR.Format(SR.SerializationConverterOnAttributeInvalid, location)); @@ -134,13 +127,13 @@ public static void ThrowInvalidOperationException_SerializationConverterOnAttrib [DoesNotReturn] [MethodImpl(MethodImplOptions.NoInlining)] - public static void ThrowInvalidOperationException_SerializationConverterOnAttributeNotCompatible(Type classTypeAttributeIsOn, PropertyInfo? propertyInfo, Type typeToConvert) + public static void ThrowInvalidOperationException_SerializationConverterOnAttributeNotCompatible(Type classTypeAttributeIsOn, MemberInfo? memberInfo, Type typeToConvert) { string location = classTypeAttributeIsOn.ToString(); - if (propertyInfo != null) + if (memberInfo != null) { - location += $".{propertyInfo.Name}"; + location += $".{memberInfo.Name}"; } throw new InvalidOperationException(SR.Format(SR.SerializationConverterOnAttributeNotCompatible, location, typeToConvert)); @@ -157,14 +150,14 @@ public static void ThrowInvalidOperationException_SerializerOptionsImmutable() [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_SerializerPropertyNameConflict(Type type, JsonPropertyInfo jsonPropertyInfo) { - throw new InvalidOperationException(SR.Format(SR.SerializerPropertyNameConflict, type, jsonPropertyInfo.PropertyInfo?.Name)); + throw new InvalidOperationException(SR.Format(SR.SerializerPropertyNameConflict, type, jsonPropertyInfo.MemberInfo?.Name)); } [DoesNotReturn] [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_SerializerPropertyNameNull(Type parentType, JsonPropertyInfo jsonPropertyInfo) { - throw new InvalidOperationException(SR.Format(SR.SerializerPropertyNameNull, parentType, jsonPropertyInfo.PropertyInfo?.Name)); + throw new InvalidOperationException(SR.Format(SR.SerializerPropertyNameNull, parentType, jsonPropertyInfo.MemberInfo?.Name)); } [DoesNotReturn] @@ -184,18 +177,18 @@ public static void ThrowInvalidOperationException_SerializerConverterFactoryRetu [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_MultiplePropertiesBindToConstructorParameters( Type parentType, - ParameterInfo parameterInfo, - PropertyInfo firstMatch, - PropertyInfo secondMatch, + string parameterName, + string firstMatchName, + string secondMatchName, ConstructorInfo constructorInfo) { throw new InvalidOperationException( SR.Format( SR.MultipleMembersBindWithConstructorParameter, - firstMatch.Name, - secondMatch.Name, + firstMatchName, + secondMatchName, parentType, - parameterInfo.Name, + parameterName, constructorInfo)); } @@ -209,18 +202,26 @@ public static void ThrowInvalidOperationException_ConstructorParameterIncomplete [DoesNotReturn] [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_ExtensionDataCannotBindToCtorParam( - PropertyInfo propertyInfo, + MemberInfo memberInfo, Type classType, ConstructorInfo constructorInfo) { - throw new InvalidOperationException(SR.Format(SR.ExtensionDataCannotBindToCtorParam, propertyInfo, classType, constructorInfo)); + throw new InvalidOperationException(SR.Format(SR.ExtensionDataCannotBindToCtorParam, memberInfo, classType, constructorInfo)); + } + + [DoesNotReturn] + [MethodImpl(MethodImplOptions.NoInlining)] + public static void ThrowInvalidOperationException_JsonIncludeOnNonPublicInvalid(MemberInfo memberInfo, Type parentType) + { + throw new InvalidOperationException(SR.Format(SR.JsonIncludeOnNonPublicInvalid, memberInfo.Name, parentType)); } [DoesNotReturn] [MethodImpl(MethodImplOptions.NoInlining)] - public static void ThrowInvalidOperationException_JsonIncludeOnNonPublicInvalid(PropertyInfo propertyInfo, Type parentType) + public static void ThrowInvalidOperationException_IgnoreConditionOnValueTypeInvalid(JsonPropertyInfo jsonPropertyInfo) { - throw new InvalidOperationException(SR.Format(SR.JsonIncludeOnNonPublicInvalid, propertyInfo.Name, parentType)); + MemberInfo memberInfo = jsonPropertyInfo.MemberInfo!; + throw new InvalidOperationException(SR.Format(SR.IgnoreConditionOnValueTypeInvalid, memberInfo.Name, memberInfo.DeclaringType)); } [DoesNotReturn] @@ -333,12 +334,12 @@ public static void AddJsonExceptionInformation(in WriteStack state, JsonExceptio [DoesNotReturn] [MethodImpl(MethodImplOptions.NoInlining)] - public static void ThrowInvalidOperationException_SerializationDuplicateAttribute(Type attribute, Type classType, PropertyInfo? propertyInfo) + public static void ThrowInvalidOperationException_SerializationDuplicateAttribute(Type attribute, Type classType, MemberInfo? memberInfo) { string location = classType.ToString(); - if (propertyInfo != null) + if (memberInfo != null) { - location += $".{propertyInfo.Name}"; + location += $".{memberInfo.Name}"; } throw new InvalidOperationException(SR.Format(SR.SerializationDuplicateAttribute, attribute, location)); @@ -362,7 +363,7 @@ public static void ThrowInvalidOperationException_SerializationDuplicateTypeAttr [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_SerializationDataExtensionPropertyInvalid(Type type, JsonPropertyInfo jsonPropertyInfo) { - throw new InvalidOperationException(SR.Format(SR.SerializationDataExtensionPropertyInvalid, type, jsonPropertyInfo.PropertyInfo?.Name)); + throw new InvalidOperationException(SR.Format(SR.SerializationDataExtensionPropertyInvalid, type, jsonPropertyInfo.MemberInfo?.Name)); } [DoesNotReturn] @@ -473,11 +474,25 @@ public static void ThrowJsonException_MetadataValueWasNotString(JsonTokenType to ThrowJsonException(SR.Format(SR.MetadataValueWasNotString, tokenType)); } + [DoesNotReturn] + [MethodImpl(MethodImplOptions.NoInlining)] + public static void ThrowJsonException_MetadataValueWasNotString(JsonValueKind valueKind) + { + ThrowJsonException(SR.Format(SR.MetadataValueWasNotString, valueKind)); + } + [DoesNotReturn] [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_MetadataReferenceObjectCannotContainOtherProperties(ReadOnlySpan propertyName, ref ReadStack state) { state.Current.JsonPropertyName = propertyName.ToArray(); + ThrowJsonException_MetadataReferenceObjectCannotContainOtherProperties(); + } + + [DoesNotReturn] + [MethodImpl(MethodImplOptions.NoInlining)] + public static void ThrowJsonException_MetadataReferenceObjectCannotContainOtherProperties() + { ThrowJsonException(SR.MetadataReferenceCannotContainOtherProperties); } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Bytes.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Bytes.cs index 6ee1df069608..7852c0052001 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Bytes.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Bytes.cs @@ -18,10 +18,8 @@ public sealed partial class Utf8JsonWriter /// Thrown if this would result in invalid JSON being written (while validation is enabled). /// public void WriteBase64String(JsonEncodedText propertyName, ReadOnlySpan bytes) - => WriteBase64StringHelper(propertyName.EncodedUtf8Bytes, bytes); - - private void WriteBase64StringHelper(ReadOnlySpan utf8PropertyName, ReadOnlySpan bytes) { + ReadOnlySpan utf8PropertyName = propertyName.EncodedUtf8Bytes; Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); JsonWriterHelper.ValidateBytes(bytes); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.DateTime.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.DateTime.cs index 15309dfa2ea4..fa96ffc6e8dc 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.DateTime.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.DateTime.cs @@ -22,10 +22,8 @@ public sealed partial class Utf8JsonWriter /// The property name should already be escaped when the instance of was created. /// public void WriteString(JsonEncodedText propertyName, DateTime value) - => WriteStringHelper(propertyName.EncodedUtf8Bytes, value); - - private void WriteStringHelper(ReadOnlySpan utf8PropertyName, DateTime value) { + ReadOnlySpan utf8PropertyName = propertyName.EncodedUtf8Bytes; Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); WriteStringByOptions(utf8PropertyName, value); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.DateTimeOffset.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.DateTimeOffset.cs index 78fdedb7e0a1..3cbfef7cf4fb 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.DateTimeOffset.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.DateTimeOffset.cs @@ -21,10 +21,8 @@ public sealed partial class Utf8JsonWriter /// Writes the using the round-trippable ('O') , for example: 2017-06-12T05:30:45.7680000-07:00. /// public void WriteString(JsonEncodedText propertyName, DateTimeOffset value) - => WriteStringHelper(propertyName.EncodedUtf8Bytes, value); - - private void WriteStringHelper(ReadOnlySpan utf8PropertyName, DateTimeOffset value) { + ReadOnlySpan utf8PropertyName = propertyName.EncodedUtf8Bytes; Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); WriteStringByOptions(utf8PropertyName, value); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Decimal.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Decimal.cs index 2ffce4d8c4ff..861ce7e00599 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Decimal.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Decimal.cs @@ -21,10 +21,8 @@ public sealed partial class Utf8JsonWriter /// Writes the using the default (that is, 'G'). /// public void WriteNumber(JsonEncodedText propertyName, decimal value) - => WriteNumberHelper(propertyName.EncodedUtf8Bytes, value); - - private void WriteNumberHelper(ReadOnlySpan utf8PropertyName, decimal value) { + ReadOnlySpan utf8PropertyName = propertyName.EncodedUtf8Bytes; Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); WriteNumberByOptions(utf8PropertyName, value); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Double.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Double.cs index eae9668079fb..359cfd430367 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Double.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Double.cs @@ -21,10 +21,8 @@ public sealed partial class Utf8JsonWriter /// Writes the using the default (that is, 'G'). /// public void WriteNumber(JsonEncodedText propertyName, double value) - => WriteNumberHelper(propertyName.EncodedUtf8Bytes, value); - - private void WriteNumberHelper(ReadOnlySpan utf8PropertyName, double value) { + ReadOnlySpan utf8PropertyName = propertyName.EncodedUtf8Bytes; Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); JsonWriterHelper.ValidateDouble(value); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Float.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Float.cs index a9226298567c..6e46a4f6efbf 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Float.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Float.cs @@ -21,10 +21,8 @@ public sealed partial class Utf8JsonWriter /// Writes the using the default (that is, 'G'). /// public void WriteNumber(JsonEncodedText propertyName, float value) - => WriteNumberHelper(propertyName.EncodedUtf8Bytes, value); - - private void WriteNumberHelper(ReadOnlySpan utf8PropertyName, float value) { + ReadOnlySpan utf8PropertyName = propertyName.EncodedUtf8Bytes; Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); JsonWriterHelper.ValidateSingle(value); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Guid.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Guid.cs index 9dc0569ce336..899ff6febf34 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Guid.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Guid.cs @@ -21,10 +21,8 @@ public sealed partial class Utf8JsonWriter /// Writes the using the default (that is, 'D'), as the form: nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn. /// public void WriteString(JsonEncodedText propertyName, Guid value) - => WriteStringHelper(propertyName.EncodedUtf8Bytes, value); - - private void WriteStringHelper(ReadOnlySpan utf8PropertyName, Guid value) { + ReadOnlySpan utf8PropertyName = propertyName.EncodedUtf8Bytes; Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); WriteStringByOptions(utf8PropertyName, value); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.SignedNumber.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.SignedNumber.cs index ec0ebad5c470..b231446cd680 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.SignedNumber.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.SignedNumber.cs @@ -21,10 +21,8 @@ public sealed partial class Utf8JsonWriter /// Writes the using the default (that is, 'G'), for example: 32767. /// public void WriteNumber(JsonEncodedText propertyName, long value) - => WriteNumberHelper(propertyName.EncodedUtf8Bytes, value); - - private void WriteNumberHelper(ReadOnlySpan utf8PropertyName, long value) { + ReadOnlySpan utf8PropertyName = propertyName.EncodedUtf8Bytes; Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); WriteNumberByOptions(utf8PropertyName, value); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.UnsignedNumber.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.UnsignedNumber.cs index 653fb190dcca..5b6698143f11 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.UnsignedNumber.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.UnsignedNumber.cs @@ -22,10 +22,8 @@ public sealed partial class Utf8JsonWriter /// [CLSCompliant(false)] public void WriteNumber(JsonEncodedText propertyName, ulong value) - => WriteNumberHelper(propertyName.EncodedUtf8Bytes, value); - - private void WriteNumberHelper(ReadOnlySpan utf8PropertyName, ulong value) { + ReadOnlySpan utf8PropertyName = propertyName.EncodedUtf8Bytes; Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); WriteNumberByOptions(utf8PropertyName, value); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Bytes.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Bytes.cs index 4e7e209dd86c..07d8077c16c1 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Bytes.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Bytes.cs @@ -33,7 +33,10 @@ public void WriteBase64StringValue(ReadOnlySpan bytes) private void WriteBase64ByOptions(ReadOnlySpan bytes) { - ValidateWritingValue(); + if (!_options.SkipValidation) + { + ValidateWritingValue(); + } if (_options.Indented) { diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.DateTime.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.DateTime.cs index 194232e69c55..0d5687c2be4a 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.DateTime.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.DateTime.cs @@ -21,7 +21,11 @@ public sealed partial class Utf8JsonWriter /// public void WriteStringValue(DateTime value) { - ValidateWritingValue(); + if (!_options.SkipValidation) + { + ValidateWritingValue(); + } + if (_options.Indented) { WriteStringValueIndented(value); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.DateTimeOffset.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.DateTimeOffset.cs index 6b42c4d369c4..b92b79921795 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.DateTimeOffset.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.DateTimeOffset.cs @@ -22,7 +22,11 @@ public sealed partial class Utf8JsonWriter /// public void WriteStringValue(DateTimeOffset value) { - ValidateWritingValue(); + if (!_options.SkipValidation) + { + ValidateWritingValue(); + } + if (_options.Indented) { WriteStringValueIndented(value); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Decimal.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Decimal.cs index 71d7d37cf9f0..ca5b059be50b 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Decimal.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Decimal.cs @@ -21,7 +21,11 @@ public sealed partial class Utf8JsonWriter /// public void WriteNumberValue(decimal value) { - ValidateWritingValue(); + if (!_options.SkipValidation) + { + ValidateWritingValue(); + } + if (_options.Indented) { WriteNumberValueIndented(value); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Double.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Double.cs index 7eb318ee3541..cf8732bc44ec 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Double.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Double.cs @@ -25,7 +25,11 @@ public void WriteNumberValue(double value) { JsonWriterHelper.ValidateDouble(value); - ValidateWritingValue(); + if (!_options.SkipValidation) + { + ValidateWritingValue(); + } + if (_options.Indented) { WriteNumberValueIndented(value); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Float.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Float.cs index 5de5bab33932..f120a09373c4 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Float.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Float.cs @@ -25,7 +25,11 @@ public void WriteNumberValue(float value) { JsonWriterHelper.ValidateSingle(value); - ValidateWritingValue(); + if (!_options.SkipValidation) + { + ValidateWritingValue(); + } + if (_options.Indented) { WriteNumberValueIndented(value); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.FormattedNumber.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.FormattedNumber.cs index 069dc310efa2..5dfb4e9e8ff4 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.FormattedNumber.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.FormattedNumber.cs @@ -25,7 +25,11 @@ internal void WriteNumberValue(ReadOnlySpan utf8FormattedNumber) { JsonWriterHelper.ValidateValue(utf8FormattedNumber); JsonWriterHelper.ValidateNumber(utf8FormattedNumber); - ValidateWritingValue(); + + if (!_options.SkipValidation) + { + ValidateWritingValue(); + } if (_options.Indented) { diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Guid.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Guid.cs index 26a757600a5f..e9884f744a58 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Guid.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Guid.cs @@ -21,7 +21,11 @@ public sealed partial class Utf8JsonWriter /// public void WriteStringValue(Guid value) { - ValidateWritingValue(); + if (!_options.SkipValidation) + { + ValidateWritingValue(); + } + if (_options.Indented) { WriteStringValueIndented(value); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Helpers.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Helpers.cs index 5ac6a4bafc20..6e617bdec880 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Helpers.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Helpers.cs @@ -12,25 +12,24 @@ public sealed partial class Utf8JsonWriter { private void ValidateWritingValue() { - if (!_options.SkipValidation) + Debug.Assert(!_options.SkipValidation); + + if (_inObject) { - if (_inObject) + if (_tokenType != JsonTokenType.PropertyName) { - if (_tokenType != JsonTokenType.PropertyName) - { - Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); - ThrowHelper.ThrowInvalidOperationException(ExceptionResource.CannotWriteValueWithinObject, currentDepth: default, token: default, _tokenType); - } + Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); + ThrowHelper.ThrowInvalidOperationException(ExceptionResource.CannotWriteValueWithinObject, currentDepth: default, token: default, _tokenType); } - else - { - Debug.Assert(_tokenType != JsonTokenType.PropertyName); + } + else + { + Debug.Assert(_tokenType != JsonTokenType.PropertyName); - // It is more likely for CurrentDepth to not equal 0 when writing valid JSON, so check that first to rely on short-circuiting and return quickly. - if (CurrentDepth == 0 && _tokenType != JsonTokenType.None) - { - ThrowHelper.ThrowInvalidOperationException(ExceptionResource.CannotWriteValueAfterPrimitiveOrClose, currentDepth: default, token: default, _tokenType); - } + // It is more likely for CurrentDepth to not equal 0 when writing valid JSON, so check that first to rely on short-circuiting and return quickly. + if (CurrentDepth == 0 && _tokenType != JsonTokenType.None) + { + ThrowHelper.ThrowInvalidOperationException(ExceptionResource.CannotWriteValueAfterPrimitiveOrClose, currentDepth: default, token: default, _tokenType); } } } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Literal.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Literal.cs index e1eba43d1ae5..c5beb15ae3f1 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Literal.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Literal.cs @@ -46,7 +46,11 @@ public void WriteBooleanValue(bool value) private void WriteLiteralByOptions(ReadOnlySpan utf8Value) { - ValidateWritingValue(); + if (!_options.SkipValidation) + { + ValidateWritingValue(); + } + if (_options.Indented) { WriteLiteralIndented(utf8Value); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.SignedNumber.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.SignedNumber.cs index c37211d622a9..957573ddb7a7 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.SignedNumber.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.SignedNumber.cs @@ -34,7 +34,11 @@ public void WriteNumberValue(int value) /// public void WriteNumberValue(long value) { - ValidateWritingValue(); + if (!_options.SkipValidation) + { + ValidateWritingValue(); + } + if (_options.Indented) { WriteNumberValueIndented(value); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.String.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.String.cs index c3eb222a2fed..c86a8af22f16 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.String.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.String.cs @@ -16,10 +16,8 @@ public sealed partial class Utf8JsonWriter /// Thrown if this would result in invalid JSON being written (while validation is enabled). /// public void WriteStringValue(JsonEncodedText value) - => WriteStringValueHelper(value.EncodedUtf8Bytes); - - private void WriteStringValueHelper(ReadOnlySpan utf8Value) { + ReadOnlySpan utf8Value = value.EncodedUtf8Bytes; Debug.Assert(utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize); WriteStringByOptions(utf8Value); @@ -99,7 +97,11 @@ private void WriteStringEscape(ReadOnlySpan value) private void WriteStringByOptions(ReadOnlySpan value) { - ValidateWritingValue(); + if (!_options.SkipValidation) + { + ValidateWritingValue(); + } + if (_options.Indented) { WriteStringIndented(value); @@ -242,7 +244,11 @@ private void WriteStringEscape(ReadOnlySpan utf8Value) private void WriteStringByOptions(ReadOnlySpan utf8Value) { - ValidateWritingValue(); + if (!_options.SkipValidation) + { + ValidateWritingValue(); + } + if (_options.Indented) { WriteStringIndented(utf8Value); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.UnsignedNumber.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.UnsignedNumber.cs index 4cb253bef866..2c15441d4325 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.UnsignedNumber.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.UnsignedNumber.cs @@ -36,7 +36,11 @@ public void WriteNumberValue(uint value) [CLSCompliant(false)] public void WriteNumberValue(ulong value) { - ValidateWritingValue(); + if (!_options.SkipValidation) + { + ValidateWritingValue(); + } + if (_options.Indented) { WriteNumberValueIndented(value); diff --git a/src/libraries/System.Text.Json/tests/Serialization/CacheTests.cs b/src/libraries/System.Text.Json/tests/Serialization/CacheTests.cs index 96df1bb8a224..9c5704976cd6 100644 --- a/src/libraries/System.Text.Json/tests/Serialization/CacheTests.cs +++ b/src/libraries/System.Text.Json/tests/Serialization/CacheTests.cs @@ -162,7 +162,7 @@ public static void PropertyCacheWithMinInputsLast() // Use a common options instance to encourage additional metadata collisions across types. Also since // this options is not the default options instance the tests will not use previously cached metadata. - private static JsonSerializerOptions s_options = new JsonSerializerOptions(); + private static JsonSerializerOptions s_options = new JsonSerializerOptions { IncludeFields = true }; [Theory] [MemberData(nameof(WriteSuccessCases))] @@ -173,7 +173,8 @@ public static async Task MultipleTypes(ITestClass testObj) // Get the test json with the default options to avoid cache pollution of Deserialize() below. testObj.Initialize(); testObj.Verify(); - string json = JsonSerializer.Serialize(testObj, type); + var options = new JsonSerializerOptions { IncludeFields = true }; + string json = JsonSerializer.Serialize(testObj, type, options); void Serialize() { diff --git a/src/libraries/System.Text.Json/tests/Serialization/ConstructorTests/ConstructorTests.Exceptions.cs b/src/libraries/System.Text.Json/tests/Serialization/ConstructorTests/ConstructorTests.Exceptions.cs index 9f1a85e618f2..d268205dce95 100644 --- a/src/libraries/System.Text.Json/tests/Serialization/ConstructorTests/ConstructorTests.Exceptions.cs +++ b/src/libraries/System.Text.Json/tests/Serialization/ConstructorTests/ConstructorTests.Exceptions.cs @@ -28,7 +28,16 @@ public async Task MultipleProperties_Cannot_BindTo_TheSame_ConstructorParameter( Assert.Contains("'X'", exStr); Assert.Contains("'x'", exStr); Assert.Contains("(Int32)", exStr); - Assert.Contains("System.Text.Json.Serialization.Tests.Point_MultipleMembers_BindTo_OneConstructorParameter_Variant", exStr); + Assert.Contains("Point_MultipleMembers_BindTo_OneConstructorParameter_Variant", exStr); + + ex = await Assert.ThrowsAsync( + () => Serializer.DeserializeWrapper("{}")); + + exStr = ex.ToString(); + Assert.Contains("'URL'", exStr); + Assert.Contains("'Url'", exStr); + Assert.Contains("(Int32)", exStr); + Assert.Contains("Url_BindTo_OneConstructorParameter", exStr); } [Fact] @@ -128,20 +137,6 @@ public class Class_ExtData_CtorParam public Class_ExtData_CtorParam(Dictionary extensionData) { } } - [Fact] - public void AnonymousObject_InvalidOperationException() - { - var obj = new { Prop = 5 }; - - InvalidOperationException ex = Assert.Throws(() => JsonSerializer.Deserialize("{}", obj.GetType())); - - // We expect property 'Prop' to bind with a ctor arg called 'prop', but the ctor arg is called 'Prop'. - string exStr = ex.ToString(); - Assert.Contains("AnonymousType", exStr); - Assert.Contains("(Int32)", exStr); - Assert.Contains("[System.Int32]", exStr); - } - [Fact] public async Task DeserializePathForObjectFails() { @@ -251,10 +246,11 @@ public Parameterized_ClassWithUnicodeProperty(int a\u0467) } [Fact] - [ActiveIssue("JsonElement needs to support Path")] public async Task ExtensionPropertyRoundTripFails() { - JsonException e = await Assert.ThrowsAsync(() => Serializer.DeserializeWrapper(@"{""MyNestedClass"":{""UnknownProperty"":bad}}")); + JsonException e = await Assert.ThrowsAsync(() => + Serializer.DeserializeWrapper(@"{""MyNestedClass"":{""UnknownProperty"":bad}}")); + Assert.Equal("$.MyNestedClass.UnknownProperty", e.Path); } diff --git a/src/libraries/System.Text.Json/tests/Serialization/ConstructorTests/ConstructorTests.ParameterMatching.cs b/src/libraries/System.Text.Json/tests/Serialization/ConstructorTests/ConstructorTests.ParameterMatching.cs index 7cf574598d7e..b3315fc88711 100644 --- a/src/libraries/System.Text.Json/tests/Serialization/ConstructorTests/ConstructorTests.ParameterMatching.cs +++ b/src/libraries/System.Text.Json/tests/Serialization/ConstructorTests/ConstructorTests.ParameterMatching.cs @@ -1013,5 +1013,126 @@ public async Task InvalidJsonFails() await Assert.ThrowsAsync(() => Serializer.DeserializeWrapper("{x")); await Assert.ThrowsAsync(() => Serializer.DeserializeWrapper("{true")); } + + [Fact] + public void AnonymousObject() + { + var obj = new { Prop = 5 }; + Type objType = obj.GetType(); + + // 'Prop' property binds with a ctor arg called 'Prop'. + + object newObj = JsonSerializer.Deserialize("{}", objType); + Assert.Equal(0, objType.GetProperty("Prop").GetValue(newObj)); + + newObj = JsonSerializer.Deserialize(@"{""Prop"":5}", objType); + Assert.Equal(5, objType.GetProperty("Prop").GetValue(newObj)); + } + + [Fact] + public void AnonymousObject_NamingPolicy() + { + const string Json = @"{""prop"":5}"; + + var obj = new { Prop = 5 }; + Type objType = obj.GetType(); + + // 'Prop' property binds with a ctor arg called 'Prop'. + + object newObj = JsonSerializer.Deserialize(Json, objType); + // Verify no match if no naming policy + Assert.Equal(0, objType.GetProperty("Prop").GetValue(newObj)); + + var options = new JsonSerializerOptions + { + PropertyNamingPolicy = JsonNamingPolicy.CamelCase + }; + + newObj = JsonSerializer.Deserialize(Json, objType, options); + // Verify match with naming policy + Assert.Equal(5, objType.GetProperty("Prop").GetValue(newObj)); + } + + private record MyRecord(int Prop); + + [Fact] + public void Record() + { + // 'Prop' property binds with a ctor arg called 'Prop'. + MyRecord obj = JsonSerializer.Deserialize("{}"); + Assert.Equal(0, obj.Prop); + + obj = JsonSerializer.Deserialize(@"{""Prop"":5}"); + Assert.Equal(5, obj.Prop); + } + + private record AgeRecord(int age) + { + public string Age { get; set; } = age.ToString(); + } + + [Fact] + public void RecordWithSamePropertyNameDifferentTypes() + { + AgeRecord obj = JsonSerializer.Deserialize(@"{""age"":1}"); + Assert.Equal(1, obj.age); + } + + private record MyRecordWithUnboundCtorProperty(int IntProp1, int IntProp2) + { + public string StringProp { get; set; } + } + + [Fact] + public void RecordWithAdditionalProperty() + { + MyRecordWithUnboundCtorProperty obj = JsonSerializer.Deserialize( + @"{""IntProp1"":1,""IntProp2"":2,""StringProp"":""hello""}"); + + Assert.Equal(1, obj.IntProp1); + Assert.Equal(2, obj.IntProp2); + + // StringProp is not bound to any constructor property. + Assert.Equal("hello", obj.StringProp); + } + + [Fact] + public void Record_NamingPolicy() + { + const string Json = @"{""prop"":5}"; + + // 'Prop' property binds with a ctor arg called 'Prop'. + + // Verify no match if no naming policy + MyRecord obj = JsonSerializer.Deserialize(Json); + Assert.Equal(0, obj.Prop); + + var options = new JsonSerializerOptions + { + PropertyNamingPolicy = JsonNamingPolicy.CamelCase + }; + + // Verify match with naming policy + obj = JsonSerializer.Deserialize(Json, options); + Assert.Equal(5, obj.Prop); + } + + private class AgePoco + { + public AgePoco(int age) + { + this.age = age; + } + + public int age { get; set; } + public string Age { get; set; } + } + + [Fact] + public void PocoWithSamePropertyNameDifferentTypes() + { + AgePoco obj = JsonSerializer.Deserialize(@"{""age"":1}"); + Assert.Equal(1, obj.age); + } } } diff --git a/src/libraries/System.Text.Json/tests/Serialization/ExtensionDataTests.cs b/src/libraries/System.Text.Json/tests/Serialization/ExtensionDataTests.cs index 255b348751d6..8899ef5e9c18 100644 --- a/src/libraries/System.Text.Json/tests/Serialization/ExtensionDataTests.cs +++ b/src/libraries/System.Text.Json/tests/Serialization/ExtensionDataTests.cs @@ -54,6 +54,49 @@ void Verify() } } + [Fact] + public static void ExtensioFieldNotUsed() + { + string json = @"{""MyNestedClass"":" + SimpleTestClass.s_json + "}"; + ClassWithExtensionField obj = JsonSerializer.Deserialize(json); + Assert.Null(obj.MyOverflow); + } + + [Fact] + public static void ExtensionFieldRoundTrip() + { + ClassWithExtensionField obj; + + { + string json = @"{""MyIntMissing"":2, ""MyInt"":1, ""MyNestedClassMissing"":" + SimpleTestClass.s_json + "}"; + obj = JsonSerializer.Deserialize(json); + Verify(); + } + + // Round-trip the json. + { + string json = JsonSerializer.Serialize(obj); + obj = JsonSerializer.Deserialize(json); + Verify(); + + // The json should not contain the dictionary name. + Assert.DoesNotContain(nameof(ClassWithExtensionField.MyOverflow), json); + } + + void Verify() + { + Assert.NotNull(obj.MyOverflow); + Assert.Equal(1, obj.MyInt); + Assert.Equal(2, obj.MyOverflow["MyIntMissing"].GetInt32()); + + JsonProperty[] properties = obj.MyOverflow["MyNestedClassMissing"].EnumerateObject().ToArray(); + + // Verify a couple properties + Assert.Equal(1, properties.Where(prop => prop.Name == "MyInt16").First().Value.GetInt32()); + Assert.True(properties.Where(prop => prop.Name == "MyBooleanTrue").First().Value.GetBoolean()); + } + } + [Fact] public static void ExtensionPropertyIgnoredWhenWritingDefault() { diff --git a/src/libraries/System.Text.Json/tests/Serialization/IsExternalInit.cs b/src/libraries/System.Text.Json/tests/Serialization/IsExternalInit.cs new file mode 100644 index 000000000000..d789ecb6e2a1 --- /dev/null +++ b/src/libraries/System.Text.Json/tests/Serialization/IsExternalInit.cs @@ -0,0 +1,10 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Runtime.CompilerServices +{ + /// + /// Dummy class so C# 'Record' types can compile on NetStandard and NetFx. + /// + public sealed class IsExternalInit { } +} diff --git a/src/libraries/System.Text.Json/tests/Serialization/Object.WriteTests.cs b/src/libraries/System.Text.Json/tests/Serialization/Object.WriteTests.cs index b45dd3d14646..09a263c267d1 100644 --- a/src/libraries/System.Text.Json/tests/Serialization/Object.WriteTests.cs +++ b/src/libraries/System.Text.Json/tests/Serialization/Object.WriteTests.cs @@ -19,16 +19,17 @@ public static void VerifyTypeFail() [MemberData(nameof(WriteSuccessCases))] public static void Write(ITestClass testObj) { + var options = new JsonSerializerOptions { IncludeFields = true }; string json; { testObj.Initialize(); testObj.Verify(); - json = JsonSerializer.Serialize(testObj, testObj.GetType()); + json = JsonSerializer.Serialize(testObj, testObj.GetType(), options); } { - ITestClass obj = (ITestClass)JsonSerializer.Deserialize(json, testObj.GetType()); + ITestClass obj = (ITestClass)JsonSerializer.Deserialize(json, testObj.GetType(), options); obj.Verify(); } } diff --git a/src/libraries/System.Text.Json/tests/Serialization/PropertyVisibilityTests.NonPublicAccessors.cs b/src/libraries/System.Text.Json/tests/Serialization/PropertyVisibilityTests.NonPublicAccessors.cs index 522cced6624a..be76b5e424a0 100644 --- a/src/libraries/System.Text.Json/tests/Serialization/PropertyVisibilityTests.NonPublicAccessors.cs +++ b/src/libraries/System.Text.Json/tests/Serialization/PropertyVisibilityTests.NonPublicAccessors.cs @@ -295,6 +295,9 @@ private class ClassWithMixedPropertyAccessors_PropertyAttributes [InlineData(typeof(ClassWithPrivateProperty_WithJsonIncludeProperty))] [InlineData(typeof(ClassWithInternalProperty_WithJsonIncludeProperty))] [InlineData(typeof(ClassWithProtectedProperty_WithJsonIncludeProperty))] + [InlineData(typeof(ClassWithPrivateField_WithJsonIncludeProperty))] + [InlineData(typeof(ClassWithInternalField_WithJsonIncludeProperty))] + [InlineData(typeof(ClassWithProtectedField_WithJsonIncludeProperty))] public static void NonPublicProperty_WithJsonInclude_Invalid(Type type) { InvalidOperationException ex = Assert.Throws(() => JsonSerializer.Deserialize("", type)); @@ -327,5 +330,25 @@ private class ClassWithProtectedProperty_WithJsonIncludeProperty [JsonInclude] protected string MyString { get; private set; } } + + private class ClassWithPrivateField_WithJsonIncludeProperty + { + [JsonInclude] + private string MyString = null; + + public override string ToString() => MyString; + } + + private class ClassWithInternalField_WithJsonIncludeProperty + { + [JsonInclude] + internal string MyString = null; + } + + private class ClassWithProtectedField_WithJsonIncludeProperty + { + [JsonInclude] + protected string MyString = null; + } } } diff --git a/src/libraries/System.Text.Json/tests/Serialization/PropertyVisibilityTests.cs b/src/libraries/System.Text.Json/tests/Serialization/PropertyVisibilityTests.cs index 9744335c7865..6e377f8340be 100644 --- a/src/libraries/System.Text.Json/tests/Serialization/PropertyVisibilityTests.cs +++ b/src/libraries/System.Text.Json/tests/Serialization/PropertyVisibilityTests.cs @@ -10,6 +10,23 @@ namespace System.Text.Json.Serialization.Tests { public static partial class PropertyVisibilityTests { + [Fact] + public static void Serialize_NewSlotPublicField() + { + // Serialize + var obj = new ClassWithNewSlotField(); + string json = JsonSerializer.Serialize(obj); + + Assert.Equal(@"{""MyString"":""NewDefaultValue""}", json); + + // Deserialize + json = @"{""MyString"":""NewValue""}"; + obj = JsonSerializer.Deserialize(json); + + Assert.Equal("NewValue", ((ClassWithNewSlotField)obj).MyString); + Assert.Equal("DefaultValue", ((ClassWithInternalField)obj).MyString); + } + [Fact] public static void Serialize_NewSlotPublicProperty() { @@ -102,6 +119,40 @@ public static void Serialize_NewSlotPublicProperty_ConflictWithBasePublicPropert Assert.Equal(2.5M, obj.MyNumeric); } + [Fact] + public static void Serialize_NewSlotPublicField_ConflictWithBasePublicProperty() + { + // Serialize + var obj = new ClassWithNewSlotDecimalField(); + string json = JsonSerializer.Serialize(obj); + + Assert.Equal(@"{""MyNumeric"":1.5}", json); + + // Deserialize + json = @"{""MyNumeric"":2.5}"; + obj = JsonSerializer.Deserialize(json); + + Assert.Equal(2.5M, obj.MyNumeric); + } + + [Fact] + public static void Serialize_NewSlotPublicField_SpecifiedJsonPropertyName() + { + // Serialize + var obj = new ClassWithNewSlotAttributedDecimalField(); + string json = JsonSerializer.Serialize(obj); + + Assert.Contains(@"""MyNewNumeric"":1.5", json); + Assert.Contains(@"""MyNumeric"":1", json); + + // Deserialize + json = @"{""MyNewNumeric"":2.5,""MyNumeric"":4}"; + obj = JsonSerializer.Deserialize(json); + + Assert.Equal(4, ((ClassWithHiddenByNewSlotIntProperty)obj).MyNumeric); + Assert.Equal(2.5M, ((ClassWithNewSlotAttributedDecimalField)obj).MyNumeric); + } + [Fact] public static void Serialize_NewSlotPublicProperty_SpecifiedJsonPropertyName() { @@ -136,6 +187,23 @@ public static void Ignore_NonPublicProperty() Assert.Equal("DefaultValue", obj.MyString); } + [Fact] + public static void Ignore_NewSlotPublicFieldIgnored() + { + // Serialize + var obj = new ClassWithIgnoredNewSlotField(); + string json = JsonSerializer.Serialize(obj); + + Assert.Equal(@"{}", json); + + // Deserialize + json = @"{""MyString"":""NewValue""}"; + obj = JsonSerializer.Deserialize(json); + + Assert.Equal("NewDefaultValue", ((ClassWithIgnoredNewSlotField)obj).MyString); + Assert.Equal("DefaultValue", ((ClassWithInternalField)obj).MyString); + } + [Fact] public static void Ignore_NewSlotPublicPropertyIgnored() { @@ -263,6 +331,20 @@ public static void Throw_PublicProperty_ConflictDueAttributes() () => JsonSerializer.Deserialize(json)); } + [Fact] + public static void Throw_PublicPropertyAndField_ConflictDueAttributes() + { + // Serialize + var obj = new ClassWithPropertyFieldNamingConflictWhichThrows(); + Assert.Throws( + () => JsonSerializer.Serialize(obj)); + + // Deserialize + string json = @"{""MyString"":""NewValue""}"; + Assert.Throws( + () => JsonSerializer.Deserialize(json)); + } + [Fact] public static void Throw_PublicProperty_ConflictDueAttributes_SingleInheritance() { @@ -286,6 +368,29 @@ public static void Throw_PublicProperty_ConflictDueAttributes_SingleInheritance( // obj.MyString still equals "DefaultValue" } + [Fact] + public static void Throw_PublicPropertyAndField_ConflictDueAttributes_SingleInheritance() + { + // Serialize + var obj = new ClassInheritedWithPropertyFieldNamingConflictWhichThrows(); + Assert.Throws( + () => JsonSerializer.Serialize(obj)); + + // The output for Newtonsoft.Json is: + // {"MyString":"ConflictingValue"} + // Conflicts at different type-hierarchy levels that are not caused by + // deriving or the new keyword are allowed. Properties on more derived types win. + + // Deserialize + string json = @"{""MyString"":""NewValue""}"; + Assert.Throws( + () => JsonSerializer.Deserialize(json)); + + // The output for Newtonsoft.Json is: + // obj.ConflictingString = "NewValue" + // obj.MyString still equals "DefaultValue" + } + [Fact] public static void Throw_PublicProperty_ConflictDueAttributes_DoubleInheritance() { @@ -310,6 +415,30 @@ public static void Throw_PublicProperty_ConflictDueAttributes_DoubleInheritance( // obj.MyString still equals "DefaultValue" } + [Fact] + public static void Throw_PublicPropertyAndField_ConflictDueAttributes_DoubleInheritance() + { + // Serialize + var obj = new ClassTwiceInheritedWithPropertyFieldNamingConflictWhichThrows(); + Assert.Throws( + () => JsonSerializer.Serialize(obj)); + + // The output for Newtonsoft.Json is: + // {"MyString":"ConflictingValue"} + // Conflicts at different type-hierarchy levels that are not caused by + // deriving or the new keyword are allowed. Properties on more derived types win. + + // Deserialize + string json = @"{""MyString"":""NewValue""}"; + + Assert.Throws( + () => JsonSerializer.Deserialize(json)); + + // The output for Newtonsoft.Json is: + // obj.ConflictingString = "NewValue" + // obj.MyString still equals "DefaultValue" + } + [Fact] public static void Throw_PublicProperty_ConflictDuePolicy() { @@ -326,6 +455,22 @@ public static void Throw_PublicProperty_ConflictDuePolicy() () => JsonSerializer.Deserialize(json, options)); } + [Fact] + public static void Throw_PublicPropertyAndField_ConflictDuePolicy() + { + var options = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; + + // Serialize + var obj = new ClassWithPropertyFieldPolicyConflictWhichThrows(); + Assert.Throws( + () => JsonSerializer.Serialize(obj, options)); + + // Deserialize + string json = @"{""MyString"":""NewValue""}"; + Assert.Throws( + () => JsonSerializer.Deserialize(json, options)); + } + [Fact] public static void Throw_PublicProperty_ConflictDuePolicy_SingleInheritance() { @@ -352,6 +497,32 @@ public static void Throw_PublicProperty_ConflictDuePolicy_SingleInheritance() // obj.MyString still equals "DefaultValue" } + [Fact] + public static void Throw_PublicPropertyAndField_ConflictDuePolicy_SingleInheritance() + { + var options = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; + + // Serialize + var obj = new ClassInheritedWithPropertyFieldPolicyConflictWhichThrows(); + + Assert.Throws( + () => JsonSerializer.Serialize(obj, options)); + + // The output for Newtonsoft.Json is: + // {"myString":"ConflictingValue"} + // Conflicts at different type-hierarchy levels that are not caused by + // deriving or the new keyword are allowed. Properties on more derived types win. + + // Deserialize + string json = @"{""MyString"":""NewValue""}"; + Assert.Throws( + () => JsonSerializer.Deserialize(json, options)); + + // The output for Newtonsoft.Json is: + // obj.myString = "NewValue" + // obj.MyString still equals "DefaultValue" + } + [Fact] public static void Throw_PublicProperty_ConflictDuePolicy_DobuleInheritance() { @@ -379,6 +550,33 @@ public static void Throw_PublicProperty_ConflictDuePolicy_DobuleInheritance() // obj.MyString still equals "DefaultValue" } + [Fact] + public static void Throw_PublicPropertyAndField_ConflictDuePolicy_DobuleInheritance() + { + var options = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; + + // Serialize + var obj = new ClassTwiceInheritedWithPropertyFieldPolicyConflictWhichThrows(); + + Assert.Throws( + () => JsonSerializer.Serialize(obj, options)); + + // The output for Newtonsoft.Json is: + // {"myString":"ConflictingValue"} + // Conflicts at different type-hierarchy levels that are not caused by + // deriving or the new keyword are allowed. Properties on more derived types win. + + // Deserialize + string json = @"{""MyString"":""NewValue""}"; + + Assert.Throws( + () => JsonSerializer.Deserialize(json, options)); + + // The output for Newtonsoft.Json is: + // obj.myString = "NewValue" + // obj.MyString still equals "DefaultValue" + } + [Fact] public static void HiddenPropertiesIgnored_WhenOverridesIgnored() { @@ -429,6 +627,17 @@ public static void HiddenPropertiesIgnored_WhenOverridesIgnored() Assert.Equal(@"{""MyProp"":null}", serialized); } + public class ClassWithInternalField + { + internal string MyString = "DefaultValue"; + } + + public class ClassWithNewSlotField : ClassWithInternalField + { + [JsonInclude] + public new string MyString = "NewDefaultValue"; + } + public class ClassWithInternalProperty { internal string MyString { get; set; } = "DefaultValue"; @@ -465,12 +674,28 @@ public class ClassWithPropertyNamingConflictWhichThrows public string ConflictingString { get; set; } = "ConflictingValue"; } + public class ClassWithPropertyFieldNamingConflictWhichThrows + { + public string MyString { get; set; } = "DefaultValue"; + + [JsonInclude] + [JsonPropertyName(nameof(MyString))] + public string ConflictingString = "ConflictingValue"; + } + public class ClassInheritedWithPropertyNamingConflictWhichThrows : ClassWithPublicProperty { [JsonPropertyName(nameof(MyString))] public string ConflictingString { get; set; } = "ConflictingValue"; } + public class ClassInheritedWithPropertyFieldNamingConflictWhichThrows : ClassWithPublicProperty + { + [JsonInclude] + [JsonPropertyName(nameof(MyString))] + public string ConflictingString = "ConflictingValue"; + } + public class ClassTwiceInheritedWithPropertyNamingConflictWhichThrowsDummy : ClassWithPublicProperty { } @@ -481,6 +706,13 @@ public class ClassTwiceInheritedWithPropertyNamingConflictWhichThrows : ClassTwi public string ConflictingString { get; set; } = "ConflictingValue"; } + public class ClassTwiceInheritedWithPropertyFieldNamingConflictWhichThrows : ClassTwiceInheritedWithPropertyNamingConflictWhichThrowsDummy + { + [JsonInclude] + [JsonPropertyName(nameof(MyString))] + public string ConflictingString = "ConflictingValue"; + } + public class ClassWithPropertyPolicyConflict { public string MyString { get; set; } = "DefaultValue"; @@ -495,11 +727,25 @@ public class ClassWithPropertyPolicyConflictWhichThrows public string myString { get; set; } = "ConflictingValue"; } + public class ClassWithPropertyFieldPolicyConflictWhichThrows + { + public string MyString { get; set; } = "DefaultValue"; + + [JsonInclude] + public string myString = "ConflictingValue"; + } + public class ClassInheritedWithPropertyPolicyConflictWhichThrows : ClassWithPublicProperty { public string myString { get; set; } = "ConflictingValue"; } + public class ClassInheritedWithPropertyFieldPolicyConflictWhichThrows : ClassWithPublicProperty + { + [JsonInclude] + public string myString = "ConflictingValue"; + } + public class ClassInheritedWithPropertyPolicyConflictWhichThrowsDummy : ClassWithPublicProperty { } @@ -509,6 +755,18 @@ public class ClassTwiceInheritedWithPropertyPolicyConflictWhichThrows : ClassInh public string myString { get; set; } = "ConflictingValue"; } + public class ClassTwiceInheritedWithPropertyFieldPolicyConflictWhichThrows : ClassInheritedWithPropertyPolicyConflictWhichThrowsDummy + { + [JsonInclude] + public string myString { get; set; } = "ConflictingValue"; + } + + public class ClassWithIgnoredNewSlotField : ClassWithInternalField + { + [JsonIgnore] + public new string MyString = "NewDefaultValue"; + } + public class ClassWithIgnoredNewSlotProperty : ClassWithInternalProperty { [JsonIgnore] @@ -565,11 +823,24 @@ public class ClassWithHiddenByNewSlotIntProperty public int MyNumeric { get; set; } = 1; } + public class ClassWithNewSlotDecimalField : ClassWithHiddenByNewSlotIntProperty + { + [JsonInclude] + public new decimal MyNumeric = 1.5M; + } + public class ClassWithNewSlotDecimalProperty : ClassWithHiddenByNewSlotIntProperty { public new decimal MyNumeric { get; set; } = 1.5M; } + public class ClassWithNewSlotAttributedDecimalField : ClassWithHiddenByNewSlotIntProperty + { + [JsonInclude] + [JsonPropertyName("MyNewNumeric")] + public new decimal MyNumeric = 1.5M; + } + public class ClassWithNewSlotAttributedDecimalProperty : ClassWithHiddenByNewSlotIntProperty { [JsonPropertyName("MyNewNumeric")] @@ -683,26 +954,27 @@ private class FurtherDerivedClass_With_IgnoredOverride : DerivedClass_WithConfli } [Fact] - public static void NoSetter() + public static void IgnoreReadOnlyProperties() { + var options = new JsonSerializerOptions(); + options.IgnoreReadOnlyProperties = true; + var obj = new ClassWithNoSetter(); - string json = JsonSerializer.Serialize(obj); - Assert.Contains(@"""MyString"":""DefaultValue""", json); - Assert.Contains(@"""MyInts"":[1,2]", json); + string json = JsonSerializer.Serialize(obj, options); - obj = JsonSerializer.Deserialize(@"{""MyString"":""IgnoreMe"",""MyInts"":[0]}"); - Assert.Equal("DefaultValue", obj.MyString); - Assert.Equal(2, obj.MyInts.Length); + // Collections are always serialized unless they have [JsonIgnore]. + Assert.Equal(@"{""MyInts"":[1,2]}", json); } [Fact] - public static void IgnoreReadOnlyProperties() + public static void IgnoreReadOnlyFields() { var options = new JsonSerializerOptions(); - options.IgnoreReadOnlyProperties = true; + options.IncludeFields = true; + options.IgnoreReadOnlyFields = true; - var obj = new ClassWithNoSetter(); + var obj = new ClassWithReadOnlyFields(); string json = JsonSerializer.Serialize(obj, options); @@ -710,6 +982,20 @@ public static void IgnoreReadOnlyProperties() Assert.Equal(@"{""MyInts"":[1,2]}", json); } + [Fact] + public static void NoSetter() + { + var obj = new ClassWithNoSetter(); + + string json = JsonSerializer.Serialize(obj); + Assert.Contains(@"""MyString"":""DefaultValue""", json); + Assert.Contains(@"""MyInts"":[1,2]", json); + + obj = JsonSerializer.Deserialize(@"{""MyString"":""IgnoreMe"",""MyInts"":[0]}"); + Assert.Equal("DefaultValue", obj.MyString); + Assert.Equal(2, obj.MyInts.Length); + } + [Fact] public static void NoGetter() { @@ -783,34 +1069,40 @@ private class NestedClass [Fact] public static void JsonIgnoreAttribute() { + var options = new JsonSerializerOptions { IncludeFields = true }; + // Verify default state. var obj = new ClassWithIgnoreAttributeProperty(); Assert.Equal(@"MyString", obj.MyString); Assert.Equal(@"MyStringWithIgnore", obj.MyStringWithIgnore); Assert.Equal(2, obj.MyStringsWithIgnore.Length); Assert.Equal(1, obj.MyDictionaryWithIgnore["Key"]); + Assert.Equal(3.14M, obj.MyNumeric); // Verify serialize. - string json = JsonSerializer.Serialize(obj); + string json = JsonSerializer.Serialize(obj, options); Assert.Contains(@"""MyString""", json); Assert.DoesNotContain(@"MyStringWithIgnore", json); Assert.DoesNotContain(@"MyStringsWithIgnore", json); Assert.DoesNotContain(@"MyDictionaryWithIgnore", json); + Assert.DoesNotContain(@"MyNumeric", json); // Verify deserialize default. - obj = JsonSerializer.Deserialize(@"{}"); + obj = JsonSerializer.Deserialize(@"{}", options); Assert.Equal(@"MyString", obj.MyString); Assert.Equal(@"MyStringWithIgnore", obj.MyStringWithIgnore); Assert.Equal(2, obj.MyStringsWithIgnore.Length); Assert.Equal(1, obj.MyDictionaryWithIgnore["Key"]); + Assert.Equal(3.14M, obj.MyNumeric); // Verify deserialize ignores the json for MyStringWithIgnore and MyStringsWithIgnore. obj = JsonSerializer.Deserialize( - @"{""MyString"":""Hello"", ""MyStringWithIgnore"":""IgnoreMe"", ""MyStringsWithIgnore"":[""IgnoreMe""], ""MyDictionaryWithIgnore"":{""Key"":9}}"); + @"{""MyString"":""Hello"", ""MyStringWithIgnore"":""IgnoreMe"", ""MyStringsWithIgnore"":[""IgnoreMe""], ""MyDictionaryWithIgnore"":{""Key"":9}, ""MyNumeric"": 2.71828}", options); Assert.Contains(@"Hello", obj.MyString); Assert.Equal(@"MyStringWithIgnore", obj.MyStringWithIgnore); Assert.Equal(2, obj.MyStringsWithIgnore.Length); Assert.Equal(1, obj.MyDictionaryWithIgnore["Key"]); + Assert.Equal(3.14M, obj.MyNumeric); } [Fact] @@ -1008,6 +1300,18 @@ public void SetMyString(string value) } } + public class ClassWithReadOnlyFields + { + public ClassWithReadOnlyFields() + { + MyString = "DefaultValue"; + MyInts = new int[] { 1, 2 }; + } + + public readonly string MyString; + public readonly int[] MyInts; + } + public class ClassWithNoSetter { public ClassWithNoSetter() @@ -1074,6 +1378,7 @@ public ClassWithIgnoreAttributeProperty() MyString = "MyString"; MyStringWithIgnore = "MyStringWithIgnore"; MyStringsWithIgnore = new string[] { "1", "2" }; + MyNumeric = 3.14M; } [JsonIgnore] @@ -1086,6 +1391,9 @@ public ClassWithIgnoreAttributeProperty() [JsonIgnore] public string[] MyStringsWithIgnore { get; set; } + + [JsonIgnore] + public decimal MyNumeric; } private enum MyEnum @@ -1511,60 +1819,117 @@ public class ClassUsingIgnoreNeverAttribute } [Fact] - public static void IgnoreConditionNever_WinsOver_IgnoreReadOnlyValues() + public static void IgnoreConditionNever_WinsOver_IgnoreReadOnlyProperties() + { + var options = new JsonSerializerOptions { IgnoreReadOnlyProperties = true }; + + // Baseline + string json = JsonSerializer.Serialize(new ClassWithReadOnlyStringProperty("Hello"), options); + Assert.Equal("{}", json); + + // With condition to never ignore + json = JsonSerializer.Serialize(new ClassWithReadOnlyStringProperty_IgnoreNever("Hello"), options); + Assert.Equal(@"{""MyString"":""Hello""}", json); + + json = JsonSerializer.Serialize(new ClassWithReadOnlyStringProperty_IgnoreNever(null), options); + Assert.Equal(@"{""MyString"":null}", json); + } + + [Fact] + public static void IgnoreConditionWhenWritingDefault_WinsOver_IgnoreReadOnlyProperties() + { + var options = new JsonSerializerOptions { IgnoreReadOnlyProperties = true }; + + // Baseline + string json = JsonSerializer.Serialize(new ClassWithReadOnlyStringProperty("Hello"), options); + Assert.Equal("{}", json); + + // With condition to ignore when null + json = JsonSerializer.Serialize(new ClassWithReadOnlyStringProperty_IgnoreWhenWritingDefault("Hello"), options); + Assert.Equal(@"{""MyString"":""Hello""}", json); + + json = JsonSerializer.Serialize(new ClassWithReadOnlyStringProperty_IgnoreWhenWritingDefault(null), options); + Assert.Equal(@"{}", json); + } + + [Fact] + public static void IgnoreConditionNever_WinsOver_IgnoreReadOnlyFields() { var options = new JsonSerializerOptions { IgnoreReadOnlyProperties = true }; // Baseline - string json = JsonSerializer.Serialize(new ClassWithReadOnlyString("Hello"), options); + string json = JsonSerializer.Serialize(new ClassWithReadOnlyStringField("Hello"), options); Assert.Equal("{}", json); // With condition to never ignore - json = JsonSerializer.Serialize(new ClassWithReadOnlyString_IgnoreNever("Hello"), options); + json = JsonSerializer.Serialize(new ClassWithReadOnlyStringField_IgnoreNever("Hello"), options); Assert.Equal(@"{""MyString"":""Hello""}", json); - json = JsonSerializer.Serialize(new ClassWithReadOnlyString_IgnoreNever(null), options); + json = JsonSerializer.Serialize(new ClassWithReadOnlyStringField_IgnoreNever(null), options); Assert.Equal(@"{""MyString"":null}", json); } [Fact] - public static void IgnoreConditionWhenWritingDefault_WinsOver_IgnoreReadOnlyValues() + public static void IgnoreConditionWhenWritingDefault_WinsOver_IgnoreReadOnlyFields() { var options = new JsonSerializerOptions { IgnoreReadOnlyProperties = true }; // Baseline - string json = JsonSerializer.Serialize(new ClassWithReadOnlyString("Hello"), options); + string json = JsonSerializer.Serialize(new ClassWithReadOnlyStringField("Hello"), options); Assert.Equal("{}", json); // With condition to ignore when null - json = JsonSerializer.Serialize(new ClassWithReadOnlyString_IgnoreWhenWritingDefault("Hello"), options); + json = JsonSerializer.Serialize(new ClassWithReadOnlyStringField_IgnoreWhenWritingDefault("Hello"), options); Assert.Equal(@"{""MyString"":""Hello""}", json); - json = JsonSerializer.Serialize(new ClassWithReadOnlyString_IgnoreWhenWritingDefault(null), options); + json = JsonSerializer.Serialize(new ClassWithReadOnlyStringField_IgnoreWhenWritingDefault(null), options); Assert.Equal(@"{}", json); } - private class ClassWithReadOnlyString + private class ClassWithReadOnlyStringProperty + { + public string MyString { get; } + + public ClassWithReadOnlyStringProperty(string myString) => MyString = myString; + } + + private class ClassWithReadOnlyStringProperty_IgnoreNever + { + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + public string MyString { get; } + + public ClassWithReadOnlyStringProperty_IgnoreNever(string myString) => MyString = myString; + } + + private class ClassWithReadOnlyStringProperty_IgnoreWhenWritingDefault + { + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public string MyString { get; } + + public ClassWithReadOnlyStringProperty_IgnoreWhenWritingDefault(string myString) => MyString = myString; + } + + private class ClassWithReadOnlyStringField { public string MyString { get; } - public ClassWithReadOnlyString(string myString) => MyString = myString; + public ClassWithReadOnlyStringField(string myString) => MyString = myString; } - private class ClassWithReadOnlyString_IgnoreNever + private class ClassWithReadOnlyStringField_IgnoreNever { [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public string MyString { get; } - public ClassWithReadOnlyString_IgnoreNever(string myString) => MyString = myString; + public ClassWithReadOnlyStringField_IgnoreNever(string myString) => MyString = myString; } - private class ClassWithReadOnlyString_IgnoreWhenWritingDefault + private class ClassWithReadOnlyStringField_IgnoreWhenWritingDefault { [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] public string MyString { get; } - public ClassWithReadOnlyString_IgnoreWhenWritingDefault(string myString) => MyString = myString; + public ClassWithReadOnlyStringField_IgnoreWhenWritingDefault(string myString) => MyString = myString; } [Fact] @@ -1666,5 +2031,341 @@ private class ClassWithInitializedProps public int MyInt { get; set; } = -1; public Point_2D_Struct MyPoint { get; set; } = new Point_2D_Struct(-1, -1); } + + [Fact] + public static void ValueType_Properties_NotIgnoredWhen_IgnoreNullValues_Active_ClassTest() + { + var options = new JsonSerializerOptions { IgnoreNullValues = true }; + + // Deserialization. + string json = @"{""MyString"":null,""MyInt"":0,""MyBool"":null,""MyPointClass"":null,""MyPointStruct"":{""X"":0,""Y"":0}}"; + + ClassWithValueAndReferenceTypes obj = JsonSerializer.Deserialize(json, options); + + // Null values ignored for reference types/nullable value types. + Assert.Equal("Default", obj.MyString); + Assert.NotNull(obj.MyPointClass); + Assert.True(obj.MyBool); + + // Default values not ignored for value types. + Assert.Equal(0, obj.MyInt); + Assert.Equal(0, obj.MyPointStruct.X); + Assert.Equal(0, obj.MyPointStruct.Y); + + // Serialization. + + // Make all members their default CLR value. + obj.MyString = null; + obj.MyPointClass = null; + obj.MyBool = null; + + json = JsonSerializer.Serialize(obj, options); + + // Null values not serialized, default values for value types serialized. + JsonTestHelper.AssertJsonEqual(@"{""MyInt"":0,""MyPointStruct"":{""X"":0,""Y"":0}}", json); + } + + [Fact] + public static void ValueType_Properties_NotIgnoredWhen_IgnoreNullValues_Active_LargeStructTest() + { + var options = new JsonSerializerOptions { IgnoreNullValues = true }; + + // Deserialization. + string json = @"{""MyString"":null,""MyInt"":0,""MyBool"":null,""MyPointClass"":null,""MyPointStruct"":{""X"":0,""Y"":0}}"; + + LargeStructWithValueAndReferenceTypes obj = JsonSerializer.Deserialize(json, options); + + // Null values ignored for reference types. + + Assert.Equal("Default", obj.MyString); + // No way to specify a non-constant default before construction with ctor, so this remains null. + Assert.Null(obj.MyPointClass); + Assert.True(obj.MyBool); + + // Default values not ignored for value types. + Assert.Equal(0, obj.MyInt); + Assert.Equal(0, obj.MyPointStruct.X); + Assert.Equal(0, obj.MyPointStruct.Y); + + // Serialization. + + // Make all members their default CLR value. + obj = new LargeStructWithValueAndReferenceTypes(null, new Point_2D_Struct(0, 0), null, 0, null); + + json = JsonSerializer.Serialize(obj, options); + + // Null values not serialized, default values for value types serialized. + JsonTestHelper.AssertJsonEqual(@"{""MyInt"":0,""MyPointStruct"":{""X"":0,""Y"":0}}", json); + } + + [Fact] + public static void ValueType_Properties_NotIgnoredWhen_IgnoreNullValues_Active_SmallStructTest() + { + var options = new JsonSerializerOptions { IgnoreNullValues = true }; + + // Deserialization. + string json = @"{""MyString"":null,""MyInt"":0,""MyBool"":null,""MyPointStruct"":{""X"":0,""Y"":0}}"; + + SmallStructWithValueAndReferenceTypes obj = JsonSerializer.Deserialize(json, options); + + // Null values ignored for reference types. + Assert.Equal("Default", obj.MyString); + Assert.True(obj.MyBool); + + // Default values not ignored for value types. + Assert.Equal(0, obj.MyInt); + Assert.Equal(0, obj.MyPointStruct.X); + Assert.Equal(0, obj.MyPointStruct.Y); + + // Serialization. + + // Make all members their default CLR value. + obj = new SmallStructWithValueAndReferenceTypes(new Point_2D_Struct(0, 0), null, 0, null); + + json = JsonSerializer.Serialize(obj, options); + + // Null values not serialized, default values for value types serialized. + JsonTestHelper.AssertJsonEqual(@"{""MyInt"":0,""MyPointStruct"":{""X"":0,""Y"":0}}", json); + } + + private class ClassWithValueAndReferenceTypes + { + public string MyString { get; set; } = "Default"; + public int MyInt { get; set; } = -1; + public bool? MyBool { get; set; } = true; + public PointClass MyPointClass { get; set; } = new PointClass(); + public Point_2D_Struct MyPointStruct { get; set; } = new Point_2D_Struct(1, 2); + } + + private struct LargeStructWithValueAndReferenceTypes + { + public string MyString { get; } + public int MyInt { get; set; } + public bool? MyBool { get; set; } + public PointClass MyPointClass { get; set; } + public Point_2D_Struct MyPointStruct { get; set; } + + [JsonConstructor] + public LargeStructWithValueAndReferenceTypes( + PointClass myPointClass, + Point_2D_Struct myPointStruct, + string myString = "Default", + int myInt = -1, + bool? myBool = true) + { + MyString = myString; + MyInt = myInt; + MyBool = myBool; + MyPointClass = myPointClass; + MyPointStruct = myPointStruct; + } + } + + private struct SmallStructWithValueAndReferenceTypes + { + public string MyString { get; } + public int MyInt { get; set; } + public bool? MyBool { get; set; } + public Point_2D_Struct MyPointStruct { get; set; } + + [JsonConstructor] + public SmallStructWithValueAndReferenceTypes( + Point_2D_Struct myPointStruct, + string myString = "Default", + int myInt = -1, + bool? myBool = true) + { + MyString = myString; + MyInt = myInt; + MyBool = myBool; + MyPointStruct = myPointStruct; + } + } + + public class PointClass { } + + [Fact] + public static void Ignore_WhenWritingNull_Globally() + { + var options = new JsonSerializerOptions + { + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, + IncludeFields = true + }; + + string json = @"{ +""MyPointClass2_IgnoredWhenWritingNull"":{}, +""MyString1_IgnoredWhenWritingNull"":""Default"", +""MyNullableBool1_IgnoredWhenWritingNull"":null, +""MyInt2"":0, +""MyPointStruct2"":{""X"":1,""Y"":2}, +""MyInt1"":1, +""MyString2_IgnoredWhenWritingNull"":null, +""MyPointClass1_IgnoredWhenWritingNull"":null, +""MyNullableBool2_IgnoredWhenWritingNull"":true, +""MyPointStruct1"":{""X"":0,""Y"":0} +}"; + + // All members should correspond to JSON contents, as ignore doesn't apply to deserialization. + ClassWithThingsToIgnore obj = JsonSerializer.Deserialize(json, options); + Assert.NotNull(obj.MyPointClass2_IgnoredWhenWritingNull); + Assert.Equal("Default", obj.MyString1_IgnoredWhenWritingNull); + Assert.Null(obj.MyNullableBool1_IgnoredWhenWritingNull); + Assert.Equal(0, obj.MyInt2); + Assert.Equal(1, obj.MyPointStruct2.X); + Assert.Equal(2, obj.MyPointStruct2.Y); + Assert.Equal(1, obj.MyInt1); + Assert.Null(obj.MyString2_IgnoredWhenWritingNull); + Assert.Null(obj.MyPointClass1_IgnoredWhenWritingNull); + Assert.True(obj.MyNullableBool2_IgnoredWhenWritingNull); + Assert.Equal(0, obj.MyPointStruct1.X); + Assert.Equal(0, obj.MyPointStruct1.Y); + + // Ignore null as appropriate during serialization. + string expectedJson = @"{ +""MyPointClass2_IgnoredWhenWritingNull"":{}, +""MyString1_IgnoredWhenWritingNull"":""Default"", +""MyInt2"":0, +""MyPointStruct2"":{""X"":1,""Y"":2}, +""MyInt1"":1, +""MyNullableBool2_IgnoredWhenWritingNull"":true, +""MyPointStruct1"":{""X"":0,""Y"":0} +}"; + JsonTestHelper.AssertJsonEqual(expectedJson, JsonSerializer.Serialize(obj, options)); + } + + public class ClassWithThingsToIgnore + { + public string MyString1_IgnoredWhenWritingNull { get; set; } + + public string MyString2_IgnoredWhenWritingNull; + + public int MyInt1; + + public int MyInt2 { get; set; } + + public bool? MyNullableBool1_IgnoredWhenWritingNull { get; set; } + + public bool? MyNullableBool2_IgnoredWhenWritingNull; + + public PointClass MyPointClass1_IgnoredWhenWritingNull; + + public PointClass MyPointClass2_IgnoredWhenWritingNull { get; set; } + + public Point_2D_Struct_WithAttribute MyPointStruct1; + + public Point_2D_Struct_WithAttribute MyPointStruct2 { get; set; } + } + + [Fact] + public static void Ignore_WhenWritingNull_PerProperty() + { + var options = new JsonSerializerOptions + { + IncludeFields = true + }; + + string json = @"{ +""MyPointClass2_IgnoredWhenWritingNull"":{}, +""MyString1_IgnoredWhenWritingNull"":""Default"", +""MyNullableBool1_IgnoredWhenWritingNull"":null, +""MyInt2"":0, +""MyPointStruct2"":{""X"":1,""Y"":2}, +""MyInt1"":1, +""MyString2_IgnoredWhenWritingNull"":null, +""MyPointClass1_IgnoredWhenWritingNull"":null, +""MyNullableBool2_IgnoredWhenWritingNull"":true, +""MyPointStruct1"":{""X"":0,""Y"":0} +}"; + + // All members should correspond to JSON contents, as ignore doesn't apply to deserialization. + ClassWithThingsToIgnore_PerProperty obj = JsonSerializer.Deserialize(json, options); + Assert.NotNull(obj.MyPointClass2_IgnoredWhenWritingNull); + Assert.Equal("Default", obj.MyString1_IgnoredWhenWritingNull); + Assert.Null(obj.MyNullableBool1_IgnoredWhenWritingNull); + Assert.Equal(0, obj.MyInt2); + Assert.Equal(1, obj.MyPointStruct2.X); + Assert.Equal(2, obj.MyPointStruct2.Y); + Assert.Equal(1, obj.MyInt1); + Assert.Null(obj.MyString2_IgnoredWhenWritingNull); + Assert.Null(obj.MyPointClass1_IgnoredWhenWritingNull); + Assert.True(obj.MyNullableBool2_IgnoredWhenWritingNull); + Assert.Equal(0, obj.MyPointStruct1.X); + Assert.Equal(0, obj.MyPointStruct1.Y); + + // Ignore null as appropriate during serialization. + string expectedJson = @"{ +""MyPointClass2_IgnoredWhenWritingNull"":{}, +""MyString1_IgnoredWhenWritingNull"":""Default"", +""MyInt2"":0, +""MyPointStruct2"":{""X"":1,""Y"":2}, +""MyInt1"":1, +""MyNullableBool2_IgnoredWhenWritingNull"":true, +""MyPointStruct1"":{""X"":0,""Y"":0} +}"; + JsonTestHelper.AssertJsonEqual(expectedJson, JsonSerializer.Serialize(obj, options)); + } + + public class ClassWithThingsToIgnore_PerProperty + { + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string MyString1_IgnoredWhenWritingNull { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string MyString2_IgnoredWhenWritingNull; + + public int MyInt1; + + public int MyInt2 { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public bool? MyNullableBool1_IgnoredWhenWritingNull { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public bool? MyNullableBool2_IgnoredWhenWritingNull; + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public PointClass MyPointClass1_IgnoredWhenWritingNull; + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public PointClass MyPointClass2_IgnoredWhenWritingNull { get; set; } + + public Point_2D_Struct_WithAttribute MyPointStruct1; + + public Point_2D_Struct_WithAttribute MyPointStruct2 { get; set; } + } + + [Theory] + [InlineData(typeof(ClassWithBadIgnoreAttribute))] + [InlineData(typeof(StructWithBadIgnoreAttribute))] + public static void JsonIgnoreCondition_WhenWritingNull_OnValueType_Fail(Type type) + { + InvalidOperationException ex = Assert.Throws(() => JsonSerializer.Deserialize("", type)); + string exAsStr = ex.ToString(); + Assert.Contains("JsonIgnoreCondition.WhenWritingNull", exAsStr); + Assert.Contains("MyBadMember", exAsStr); + Assert.Contains(type.ToString(), exAsStr); + Assert.Contains("JsonIgnoreCondition.WhenWritingDefault", exAsStr); + + ex = Assert.Throws(() => JsonSerializer.Serialize(Activator.CreateInstance(type))); + exAsStr = ex.ToString(); + Assert.Contains("JsonIgnoreCondition.WhenWritingNull", exAsStr); + Assert.Contains("MyBadMember", exAsStr); + Assert.Contains(type.ToString(), exAsStr); + Assert.Contains("JsonIgnoreCondition.WhenWritingDefault", exAsStr); + } + + private class ClassWithBadIgnoreAttribute + { + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public int MyBadMember { get; set; } + } + + private struct StructWithBadIgnoreAttribute + { + [JsonInclude] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public Point_2D_Struct MyBadMember { get; set; } + } } } diff --git a/src/libraries/System.Text.Json/tests/Serialization/ReferenceHandlerTests.Deserialize.cs b/src/libraries/System.Text.Json/tests/Serialization/ReferenceHandlerTests.Deserialize.cs index ae7ec150b903..ddf29310c7ba 100644 --- a/src/libraries/System.Text.Json/tests/Serialization/ReferenceHandlerTests.Deserialize.cs +++ b/src/libraries/System.Text.Json/tests/Serialization/ReferenceHandlerTests.Deserialize.cs @@ -1049,27 +1049,71 @@ public static void ImmutableDictionaryPreserveNestedObjects() } [Theory] - [ActiveIssue("https://github.com/dotnet/runtime/issues/1902")] - [InlineData(@"{""$id"": {}}", "$.$id")] - [InlineData(@"{""$id"": }", "$.$id")] - [InlineData(@"{""$id"": []}", "$.$id")] - [InlineData(@"{""$id"": ]", "$.$id")] - [InlineData(@"{""$id"": null}", "$.$id")] - [InlineData(@"{""$id"": true}", "$.$id")] - [InlineData(@"{""$id"": false}", "$.$id")] - [InlineData(@"{""$id"": 10}", "$.$id")] - [InlineData(@"{""$ref"": {}}", "$.$ref")] - [InlineData(@"{""$ref"": }", "$.$ref")] - [InlineData(@"{""$ref"": []}", "$.$ref")] - [InlineData(@"{""$ref"": ]", "$.$ref")] - [InlineData(@"{""$ref"": null}", "$.$ref")] - [InlineData(@"{""$ref"": true}", "$.$ref")] - [InlineData(@"{""$ref"": false}", "$.$ref")] - [InlineData(@"{""$ref"": 10}", "$.$ref")] - public static void IdAndRefContainInvalidToken(string json, string expectedPath) + [InlineData(@"{""$id"":{}}", JsonTokenType.StartObject)] + [InlineData(@"{""$id"":[]}", JsonTokenType.StartArray)] + [InlineData(@"{""$id"":null}", JsonTokenType.Null)] + [InlineData(@"{""$id"":true}", JsonTokenType.True)] + [InlineData(@"{""$id"":false}", JsonTokenType.False)] + [InlineData(@"{""$id"":9}", JsonTokenType.Number)] + // Invalid JSON, the reader will throw before we reach the serializer validation. + [InlineData(@"{""$id"":}", JsonTokenType.None)] + [InlineData(@"{""$id"":]", JsonTokenType.None)] + public static void MetadataId_StartsWithInvalidToken(string json, JsonTokenType incorrectToken) { - JsonException ex = Assert.Throws(() => JsonSerializer.Deserialize(json, s_deserializerOptionsPreserve)); - Assert.Equal(expectedPath, ex.Path); + JsonException ex = Assert.Throws(() => JsonSerializer.Deserialize(json, s_deserializerOptionsPreserve)); + Assert.True(incorrectToken == JsonTokenType.None || ex.Message.Contains($"'{incorrectToken}'")); + Assert.Equal("$.$id", ex.Path); + + ex = Assert.Throws(() => JsonSerializer.Deserialize>(json, s_deserializerOptionsPreserve)); + Assert.True(incorrectToken == JsonTokenType.None || ex.Message.Contains($"'{incorrectToken}'")); + Assert.Equal("$.$id", ex.Path); + + ex = Assert.Throws(() => JsonSerializer.Deserialize>(json, s_deserializerOptionsPreserve)); + Assert.True(incorrectToken == JsonTokenType.None || ex.Message.Contains($"'{incorrectToken}'")); + Assert.Equal("$.$id", ex.Path); + } + + + [Theory] + [InlineData(@"{""$ref"":{}}", JsonTokenType.StartObject)] + [InlineData(@"{""$ref"":[]}", JsonTokenType.StartArray)] + [InlineData(@"{""$ref"":null}", JsonTokenType.Null)] + [InlineData(@"{""$ref"":true}", JsonTokenType.True)] + [InlineData(@"{""$ref"":false}", JsonTokenType.False)] + [InlineData(@"{""$ref"":9}", JsonTokenType.Number)] + // Invalid JSON, the reader will throw before we reach the serializer validation. + [InlineData(@"{""$ref"":}", JsonTokenType.None)] + [InlineData(@"{""$ref"":]", JsonTokenType.None)] + public static void MetadataRef_StartsWithInvalidToken(string json, JsonTokenType incorrectToken) + { + JsonException ex = Assert.Throws(() => JsonSerializer.Deserialize(json, s_deserializerOptionsPreserve)); + Assert.True(incorrectToken == JsonTokenType.None || ex.Message.Contains($"'{incorrectToken}'")); + Assert.Equal("$.$ref", ex.Path); + + ex = Assert.Throws(() => JsonSerializer.Deserialize>(json, s_deserializerOptionsPreserve)); + Assert.True(incorrectToken == JsonTokenType.None || ex.Message.Contains($"'{incorrectToken}'")); + Assert.Equal("$.$ref", ex.Path); + + ex = Assert.Throws(() => JsonSerializer.Deserialize>(json, s_deserializerOptionsPreserve)); + Assert.True(incorrectToken == JsonTokenType.None || ex.Message.Contains($"'{incorrectToken}'")); + Assert.Equal("$.$ref", ex.Path); + } + + [Theory] + [InlineData(@"{""$id"":""1"",""$values"":{}}", JsonTokenType.StartObject)] + [InlineData(@"{""$id"":""1"",""$values"":null}", JsonTokenType.Null)] + [InlineData(@"{""$id"":""1"",""$values"":true}", JsonTokenType.True)] + [InlineData(@"{""$id"":""1"",""$values"":false}", JsonTokenType.False)] + [InlineData(@"{""$id"":""1"",""$values"":9}", JsonTokenType.Number)] + [InlineData(@"{""$id"":""1"",""$values"":""9""}", JsonTokenType.String)] + // Invalid JSON, the reader will throw before we reach the serializer validation. + [InlineData(@"{""$id"":""1"",""$values"":}", JsonTokenType.None)] + [InlineData(@"{""$id"":""1"",""$values"":]", JsonTokenType.None)] + public static void MetadataValues_StartsWithInvalidToken(string json, JsonTokenType incorrectToken) + { + JsonException ex = Assert.Throws(() => JsonSerializer.Deserialize>(json, s_deserializerOptionsPreserve)); + Assert.True(incorrectToken == JsonTokenType.None || ex.Message.Contains($"'{incorrectToken}'")); + Assert.Equal("$.$values", ex.Path); } #endregion @@ -1198,7 +1242,7 @@ public static void ReferenceObjectBeforePreservedObject() [MemberData(nameof(ReadSuccessCases))] public static void ReadTestClassesWithExtensionOption(Type classType, byte[] data) { - var options = new JsonSerializerOptions { ReferenceHandler = ReferenceHandler.Preserve }; + var options = new JsonSerializerOptions { IncludeFields = true, ReferenceHandler = ReferenceHandler.Preserve }; object obj = JsonSerializer.Deserialize(data, classType, options); Assert.IsAssignableFrom(obj); ((ITestClass)obj).Verify(); diff --git a/src/libraries/System.Text.Json/tests/Serialization/ReferenceHandlerTests.cs b/src/libraries/System.Text.Json/tests/Serialization/ReferenceHandlerTests.cs index 3f9657112c52..3caee283f9fc 100644 --- a/src/libraries/System.Text.Json/tests/Serialization/ReferenceHandlerTests.cs +++ b/src/libraries/System.Text.Json/tests/Serialization/ReferenceHandlerTests.cs @@ -3,8 +3,10 @@ using System.Collections.Generic; using System.Collections.Immutable; +using System.IO; using System.Text.Encodings.Web; using System.Text.Json.Tests; +using System.Threading.Tasks; using Newtonsoft.Json; using Xunit; @@ -12,7 +14,6 @@ namespace System.Text.Json.Serialization.Tests { public static partial class ReferenceHandlerTests { - [Fact] public static void ThrowByDefaultOnLoop() { @@ -697,5 +698,98 @@ public override object ResolveReference(string referenceId) } } #endregion + + [Fact] + public static void PreserveReferenceOfTypeObject() + { + var root = new ClassWithObjectProperty(); + root.Child = new ClassWithObjectProperty(); + root.Sibling = root.Child; + + Assert.Same(root.Child, root.Sibling); + + string json = JsonSerializer.Serialize(root, s_serializerOptionsPreserve); + + ClassWithObjectProperty rootCopy = JsonSerializer.Deserialize(json, s_serializerOptionsPreserve); + Assert.Same(rootCopy.Child, rootCopy.Sibling); + } + + [Fact] + public static async Task PreserveReferenceOfTypeObjectAsync() + { + var root = new ClassWithObjectProperty(); + root.Child = new ClassWithObjectProperty(); + root.Sibling = root.Child; + + Assert.Same(root.Child, root.Sibling); + + var stream = new MemoryStream(); + await JsonSerializer.SerializeAsync(stream, root, s_serializerOptionsPreserve); + stream.Position = 0; + + ClassWithObjectProperty rootCopy = await JsonSerializer.DeserializeAsync(stream, s_serializerOptionsPreserve); + Assert.Same(rootCopy.Child, rootCopy.Sibling); + } + + [Fact] + public static void PreserveReferenceOfTypeOfObjectOnCollection() + { + var root = new ClassWithListOfObjectProperty(); + root.Child = new ClassWithListOfObjectProperty(); + + root.ListOfObjects = new List(); + root.ListOfObjects.Add(root.Child); + + Assert.Same(root.Child, root.ListOfObjects[0]); + + string json = JsonSerializer.Serialize(root, s_serializerOptionsPreserve); + ClassWithListOfObjectProperty rootCopy = JsonSerializer.Deserialize(json, s_serializerOptionsPreserve); + Assert.Same(rootCopy.Child, rootCopy.ListOfObjects[0]); + } + + [Fact] + public static void DoNotPreserveReferenceWhenRefPropertyIsAbsent() + { + string json = @"{""Child"":{""$id"":""1""},""Sibling"":{""foo"":""1""}}"; + ClassWithObjectProperty root = JsonSerializer.Deserialize(json); + Assert.IsType(root.Sibling); + + // $ref with any escaped character shall not be treated as metadata, hence Sibling must be JsonElement. + json = @"{""Child"":{""$id"":""1""},""Sibling"":{""\\u0024ref"":""1""}}"; + root = JsonSerializer.Deserialize(json); + Assert.IsType(root.Sibling); + } + + [Fact] + public static void VerifyValidationsOnPreservedReferenceOfTypeObject() + { + const string baseJson = @"{""Child"":{""$id"":""1""},""Sibling"":"; + + // A JSON object that contains a '$ref' metadata property must not contain any other properties. + string testJson = baseJson + @"{""foo"":""value"",""$ref"":""1""}}"; + JsonException ex = Assert.Throws(() => JsonSerializer.Deserialize(testJson, s_serializerOptionsPreserve)); + Assert.Equal("$.Sibling", ex.Path); + + testJson = baseJson + @"{""$ref"":""1"",""bar"":""value""}}"; + ex = Assert.Throws(() => JsonSerializer.Deserialize(testJson, s_serializerOptionsPreserve)); + Assert.Equal("$.Sibling", ex.Path); + + // The '$id' and '$ref' metadata properties must be JSON strings. + testJson = baseJson + @"{""$ref"":1}}"; + ex = Assert.Throws(() => JsonSerializer.Deserialize(testJson, s_serializerOptionsPreserve)); + Assert.Equal("$.Sibling", ex.Path); + } + + private class ClassWithObjectProperty + { + public ClassWithObjectProperty Child { get; set; } + public object Sibling { get; set; } + } + + private class ClassWithListOfObjectProperty + { + public ClassWithListOfObjectProperty Child { get; set; } + public List ListOfObjects { get; set; } + } } } diff --git a/src/libraries/System.Text.Json/tests/Serialization/SpanTests.cs b/src/libraries/System.Text.Json/tests/Serialization/SpanTests.cs index 185b85ac79ee..c01ce57372c1 100644 --- a/src/libraries/System.Text.Json/tests/Serialization/SpanTests.cs +++ b/src/libraries/System.Text.Json/tests/Serialization/SpanTests.cs @@ -19,7 +19,8 @@ public static void ParseNullTypeFail() [MemberData(nameof(ReadSuccessCases))] public static void Read(Type classType, byte[] data) { - object obj = JsonSerializer.Deserialize(data, classType); + var options = new JsonSerializerOptions { IncludeFields = true }; + object obj = JsonSerializer.Deserialize(data, classType, options); Assert.IsAssignableFrom(obj); ((ITestClass)obj).Verify(); } @@ -29,9 +30,11 @@ public static void Read(Type classType, byte[] data) public static void ReadFromStream(Type classType, byte[] data) { MemoryStream stream = new MemoryStream(data); + var options = new JsonSerializerOptions { IncludeFields = true }; object obj = JsonSerializer.DeserializeAsync( stream, - classType).Result; + classType, + options).Result; Assert.IsAssignableFrom(obj); ((ITestClass)obj).Verify(); @@ -41,7 +44,7 @@ public static void ReadFromStream(Type classType, byte[] data) obj = JsonSerializer.DeserializeAsync( stream, classType, - new JsonSerializerOptions { DefaultBufferSize = 5 }).Result; + new JsonSerializerOptions { DefaultBufferSize = 5, IncludeFields = true }).Result; Assert.IsAssignableFrom(obj); ((ITestClass)obj).Verify(); diff --git a/src/libraries/System.Text.Json/tests/Serialization/Stream.Collections.cs b/src/libraries/System.Text.Json/tests/Serialization/Stream.Collections.cs index 4810dcb38410..eb371a431949 100644 --- a/src/libraries/System.Text.Json/tests/Serialization/Stream.Collections.cs +++ b/src/libraries/System.Text.Json/tests/Serialization/Stream.Collections.cs @@ -60,21 +60,21 @@ private static async Task PerformSerialization(object obj, Type type, { string expectedjson = JsonSerializer.Serialize(obj, options); - using (var memoryStream = new MemoryStream()) - { - await JsonSerializer.SerializeAsync(memoryStream, obj, options); - string serialized = Encoding.UTF8.GetString(memoryStream.ToArray()); - JsonTestHelper.AssertJsonEqual(expectedjson, serialized); + using var memoryStream = new MemoryStream(); + await JsonSerializer.SerializeAsync(memoryStream, obj, options); + string serialized = Encoding.UTF8.GetString(memoryStream.ToArray()); + JsonTestHelper.AssertJsonEqual(expectedjson, serialized); - memoryStream.Position = 0; - await TestDeserialization(memoryStream, expectedjson, type, options); - } + memoryStream.Position = 0; - // Deserialize with extra whitespace - string jsonWithWhiteSpace = GetPayloadWithWhiteSpace(expectedjson); - using (var memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(jsonWithWhiteSpace))) + if (options.ReferenceHandler == null || !GetTypesNonRoundtrippableWithReferenceHandler().Contains(type)) { await TestDeserialization(memoryStream, expectedjson, type, options); + + // Deserialize with extra whitespace + string jsonWithWhiteSpace = GetPayloadWithWhiteSpace(expectedjson); + using var memoryStreamWithWhiteSpace = new MemoryStream(Encoding.UTF8.GetBytes(jsonWithWhiteSpace)); + await TestDeserialization(memoryStreamWithWhiteSpace, expectedjson, type, options); } } @@ -353,6 +353,16 @@ private static IEnumerable DictionaryTypes() typeof(GenericIReadOnlyDictionaryWrapper) }; + // Non-generic types cannot roundtrip when they contain a $ref written on serialization and they are the root type. + private static HashSet GetTypesNonRoundtrippableWithReferenceHandler() => new HashSet + { + typeof(Hashtable), + typeof(Queue), + typeof(Stack), + typeof(WrapperForIList), + typeof(WrapperForIEnumerable) + }; + private class ClassWithKVP { public KeyValuePair MyKvp { get; set; } diff --git a/src/libraries/System.Text.Json/tests/Serialization/TestClasses/TestClasses.Constructor.cs b/src/libraries/System.Text.Json/tests/Serialization/TestClasses/TestClasses.Constructor.cs index 0006b67df110..070aaacb68a7 100644 --- a/src/libraries/System.Text.Json/tests/Serialization/TestClasses/TestClasses.Constructor.cs +++ b/src/libraries/System.Text.Json/tests/Serialization/TestClasses/TestClasses.Constructor.cs @@ -2066,7 +2066,20 @@ public class Point_MultipleMembers_BindTo_OneConstructorParameter public int x { get; } - public Point_MultipleMembers_BindTo_OneConstructorParameter(int X, int x) { } + public Point_MultipleMembers_BindTo_OneConstructorParameter(int X, int x) + { + this.X = X; + this.x = x; + } + } + + public class Url_BindTo_OneConstructorParameter + { + public int URL { get; } + + public int Url { get; } + + public Url_BindTo_OneConstructorParameter(int url) { } } public class Point_MultipleMembers_BindTo_OneConstructorParameter_Variant diff --git a/src/libraries/System.Text.Json/tests/Serialization/TestClasses/TestClasses.SimpleTestClassWithFields.cs b/src/libraries/System.Text.Json/tests/Serialization/TestClasses/TestClasses.SimpleTestClassWithFields.cs new file mode 100644 index 000000000000..73256d2147ea --- /dev/null +++ b/src/libraries/System.Text.Json/tests/Serialization/TestClasses/TestClasses.SimpleTestClassWithFields.cs @@ -0,0 +1,511 @@ +// 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; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Linq; +using Xunit; + +namespace System.Text.Json.Serialization.Tests +{ + public class SimpleTestClassWithFields : ITestClass + { + public short MyInt16; + public int MyInt32; + public long MyInt64; + public ushort MyUInt16; + public uint MyUInt32; + public ulong MyUInt64; + public byte MyByte; + public sbyte MySByte; + public char MyChar; + public string MyString; + public decimal MyDecimal; + public bool MyBooleanTrue; + public bool MyBooleanFalse; + public float MySingle; + public double MyDouble; + public DateTime MyDateTime; + public DateTimeOffset MyDateTimeOffset; + public Guid MyGuid; + public Uri MyUri; + public SampleEnumSByte MySByteEnum; + public SampleEnumByte MyByteEnum; + public SampleEnum MyEnum; + public SampleEnumInt16 MyInt16Enum; + public SampleEnumInt32 MyInt32Enum; + public SampleEnumInt64 MyInt64Enum; + public SampleEnumUInt16 MyUInt16Enum; + public SampleEnumUInt32 MyUInt32Enum; + public SampleEnumUInt64 MyUInt64Enum; + public SimpleStruct MySimpleStruct; + public SimpleTestStruct MySimpleTestStruct; + public short[] MyInt16Array; + public int[] MyInt32Array; + public long[] MyInt64Array; + public ushort[] MyUInt16Array; + public uint[] MyUInt32Array; + public ulong[] MyUInt64Array; + public byte[] MyByteArray; + public sbyte[] MySByteArray; + public char[] MyCharArray; + public string[] MyStringArray; + public decimal[] MyDecimalArray; + public bool[] MyBooleanTrueArray; + public bool[] MyBooleanFalseArray; + public float[] MySingleArray; + public double[] MyDoubleArray; + public DateTime[] MyDateTimeArray; + public DateTimeOffset[] MyDateTimeOffsetArray; + public Guid[] MyGuidArray; + public Uri[] MyUriArray; + public SampleEnum[] MyEnumArray; + public int[][] MyInt16TwoDimensionArray; + public List> MyInt16TwoDimensionList; + public int[][][] MyInt16ThreeDimensionArray; + public List>> MyInt16ThreeDimensionList; + public List MyStringList; + public IEnumerable MyStringIEnumerable; + public IList MyStringIList; + public ICollection MyStringICollection; + public IEnumerable MyStringIEnumerableT; + public IList MyStringIListT; + public ICollection MyStringICollectionT; + public IReadOnlyCollection MyStringIReadOnlyCollectionT; + public IReadOnlyList MyStringIReadOnlyListT; + public ISet MyStringISetT; + public KeyValuePair MyStringToStringKeyValuePair; + public IDictionary MyStringToStringIDict; + public Dictionary MyStringToStringGenericDict; + public IDictionary MyStringToStringGenericIDict; + public IReadOnlyDictionary MyStringToStringGenericIReadOnlyDict; + public ImmutableDictionary MyStringToStringImmutableDict; + public IImmutableDictionary MyStringToStringIImmutableDict; + public ImmutableSortedDictionary MyStringToStringImmutableSortedDict; + public Stack MyStringStackT; + public Queue MyStringQueueT; + public HashSet MyStringHashSetT; + public LinkedList MyStringLinkedListT; + public SortedSet MyStringSortedSetT; + public IImmutableList MyStringIImmutableListT; + public IImmutableStack MyStringIImmutableStackT; + public IImmutableQueue MyStringIImmutableQueueT; + public IImmutableSet MyStringIImmutableSetT; + public ImmutableHashSet MyStringImmutableHashSetT; + public ImmutableList MyStringImmutableListT; + public ImmutableStack MyStringImmutableStackT; + public ImmutableQueue MyStringImmutablQueueT; + public ImmutableSortedSet MyStringImmutableSortedSetT; + public List MyListOfNullString; + + public static readonly string s_json = $"{{{s_partialJsonProperties},{s_partialJsonArrays}}}"; + public static readonly string s_json_flipped = $"{{{s_partialJsonArrays},{s_partialJsonProperties}}}"; + + private const string s_partialJsonProperties = + @"""MyInt16"" : 1," + + @"""MyInt32"" : 2," + + @"""MyInt64"" : 3," + + @"""MyUInt16"" : 4," + + @"""MyUInt32"" : 5," + + @"""MyUInt64"" : 6," + + @"""MyByte"" : 7," + + @"""MySByte"" : 8," + + @"""MyChar"" : ""a""," + + @"""MyString"" : ""Hello""," + + @"""MyBooleanTrue"" : true," + + @"""MyBooleanFalse"" : false," + + @"""MySingle"" : 1.1," + + @"""MyDouble"" : 2.2," + + @"""MyDecimal"" : 3.3," + + @"""MyDateTime"" : ""2019-01-30T12:01:02.0000000Z""," + + @"""MyDateTimeOffset"" : ""2019-01-30T12:01:02.0000000+01:00""," + + @"""MyGuid"" : ""1B33498A-7B7D-4DDA-9C13-F6AA4AB449A6""," + + @"""MyUri"" : ""https://github.com/dotnet/runtime""," + + @"""MyEnum"" : 2," + // int by default + @"""MyInt64Enum"" : -9223372036854775808," + + @"""MyUInt64Enum"" : 18446744073709551615," + + @"""MyStringToStringKeyValuePair"" : {""Key"" : ""myKey"", ""Value"" : ""myValue""}," + + @"""MyStringToStringIDict"" : {""key"" : ""value""}," + + @"""MyStringToStringGenericDict"" : {""key"" : ""value""}," + + @"""MyStringToStringGenericIDict"" : {""key"" : ""value""}," + + @"""MyStringToStringGenericIReadOnlyDict"" : {""key"" : ""value""}," + + @"""MyStringToStringImmutableDict"" : {""key"" : ""value""}," + + @"""MyStringToStringIImmutableDict"" : {""key"" : ""value""}," + + @"""MyStringToStringImmutableSortedDict"" : {""key"" : ""value""}," + + @"""MySimpleStruct"" : {""One"" : 11, ""Two"" : 1.9999, ""Three"" : 33}," + + @"""MySimpleTestStruct"" : {""MyInt64"" : 64, ""MyString"" :""Hello"", ""MyInt32Array"" : [32]}"; + + private const string s_partialJsonArrays = + @"""MyInt16Array"" : [1]," + + @"""MyInt32Array"" : [2]," + + @"""MyInt64Array"" : [3]," + + @"""MyUInt16Array"" : [4]," + + @"""MyUInt32Array"" : [5]," + + @"""MyUInt64Array"" : [6]," + + @"""MyByteArray"" : ""Bw==""," + // Base64 encoded value of 7 + @"""MySByteArray"" : [8]," + + @"""MyCharArray"" : [""a""]," + + @"""MyStringArray"" : [""Hello""]," + + @"""MyBooleanTrueArray"" : [true]," + + @"""MyBooleanFalseArray"" : [false]," + + @"""MySingleArray"" : [1.1]," + + @"""MyDoubleArray"" : [2.2]," + + @"""MyDecimalArray"" : [3.3]," + + @"""MyDateTimeArray"" : [""2019-01-30T12:01:02.0000000Z""]," + + @"""MyDateTimeOffsetArray"" : [""2019-01-30T12:01:02.0000000+01:00""]," + + @"""MyGuidArray"" : [""1B33498A-7B7D-4DDA-9C13-F6AA4AB449A6""]," + + @"""MyUriArray"" : [""https://github.com/dotnet/runtime""]," + + @"""MyEnumArray"" : [2]," + // int by default + @"""MyInt16TwoDimensionArray"" : [[10, 11],[20, 21]]," + + @"""MyInt16TwoDimensionList"" : [[10, 11],[20, 21]]," + + @"""MyInt16ThreeDimensionArray"" : [[[11, 12],[13, 14]],[[21,22],[23,24]]]," + + @"""MyInt16ThreeDimensionList"" : [[[11, 12],[13, 14]],[[21,22],[23,24]]]," + + @"""MyStringList"" : [""Hello""]," + + @"""MyStringIEnumerable"" : [""Hello""]," + + @"""MyStringIList"" : [""Hello""]," + + @"""MyStringICollection"" : [""Hello""]," + + @"""MyStringIEnumerableT"" : [""Hello""]," + + @"""MyStringIListT"" : [""Hello""]," + + @"""MyStringICollectionT"" : [""Hello""]," + + @"""MyStringIReadOnlyCollectionT"" : [""Hello""]," + + @"""MyStringIReadOnlyListT"" : [""Hello""]," + + @"""MyStringISetT"" : [""Hello""]," + + @"""MyStringStackT"" : [""Hello"", ""World""]," + + @"""MyStringQueueT"" : [""Hello"", ""World""]," + + @"""MyStringHashSetT"" : [""Hello""]," + + @"""MyStringLinkedListT"" : [""Hello""]," + + @"""MyStringSortedSetT"" : [""Hello""]," + + @"""MyStringIImmutableListT"" : [""Hello""]," + + @"""MyStringIImmutableStackT"" : [""Hello""]," + + @"""MyStringIImmutableQueueT"" : [""Hello""]," + + @"""MyStringIImmutableSetT"" : [""Hello""]," + + @"""MyStringImmutableHashSetT"" : [""Hello""]," + + @"""MyStringImmutableListT"" : [""Hello""]," + + @"""MyStringImmutableStackT"" : [""Hello""]," + + @"""MyStringImmutablQueueT"" : [""Hello""]," + + @"""MyStringImmutableSortedSetT"" : [""Hello""]," + + @"""MyListOfNullString"" : [null]"; + + public static readonly byte[] s_data = Encoding.UTF8.GetBytes(s_json); + + public void Initialize() + { + MyInt16 = 1; + MyInt32 = 2; + MyInt64 = 3; + MyUInt16 = 4; + MyUInt32 = 5; + MyUInt64 = 6; + MyByte = 7; + MySByte = 8; + MyChar = 'a'; + MyString = "Hello"; + MyBooleanTrue = true; + MyBooleanFalse = false; + MySingle = 1.1f; + MyDouble = 2.2d; + MyDecimal = 3.3m; + MyDateTime = new DateTime(2019, 1, 30, 12, 1, 2, DateTimeKind.Utc); + MyDateTimeOffset = new DateTimeOffset(2019, 1, 30, 12, 1, 2, new TimeSpan(1, 0, 0)); + MyGuid = new Guid("1B33498A-7B7D-4DDA-9C13-F6AA4AB449A6"); + MyUri = new Uri("https://github.com/dotnet/runtime"); + MyEnum = SampleEnum.Two; + MyInt64Enum = SampleEnumInt64.MinNegative; + MyUInt64Enum = SampleEnumUInt64.Max; + MyInt16Array = new short[] { 1 }; + MyInt32Array = new int[] { 2 }; + MyInt64Array = new long[] { 3 }; + MyUInt16Array = new ushort[] { 4 }; + MyUInt32Array = new uint[] { 5 }; + MyUInt64Array = new ulong[] { 6 }; + MyByteArray = new byte[] { 7 }; + MySByteArray = new sbyte[] { 8 }; + MyCharArray = new char[] { 'a' }; + MyStringArray = new string[] { "Hello" }; + MyBooleanTrueArray = new bool[] { true }; + MyBooleanFalseArray = new bool[] { false }; + MySingleArray = new float[] { 1.1f }; + MyDoubleArray = new double[] { 2.2d }; + MyDecimalArray = new decimal[] { 3.3m }; + MyDateTimeArray = new DateTime[] { new DateTime(2019, 1, 30, 12, 1, 2, DateTimeKind.Utc) }; + MyDateTimeOffsetArray = new DateTimeOffset[] { new DateTimeOffset(2019, 1, 30, 12, 1, 2, new TimeSpan(1, 0, 0)) }; + MyGuidArray = new Guid[] { new Guid("1B33498A-7B7D-4DDA-9C13-F6AA4AB449A6") }; + MyUriArray = new Uri[] { new Uri("https://github.com/dotnet/runtime") }; + MyEnumArray = new SampleEnum[] { SampleEnum.Two }; + MySimpleStruct = new SimpleStruct { One = 11, Two = 1.9999 }; + MySimpleTestStruct = new SimpleTestStruct { MyInt64 = 64, MyString = "Hello", MyInt32Array = new int[] { 32 } }; + + MyInt16TwoDimensionArray = new int[2][]; + MyInt16TwoDimensionArray[0] = new int[] { 10, 11 }; + MyInt16TwoDimensionArray[1] = new int[] { 20, 21 }; + + MyInt16TwoDimensionList = new List>(); + MyInt16TwoDimensionList.Add(new List { 10, 11 }); + MyInt16TwoDimensionList.Add(new List { 20, 21 }); + + MyInt16ThreeDimensionArray = new int[2][][]; + MyInt16ThreeDimensionArray[0] = new int[2][]; + MyInt16ThreeDimensionArray[1] = new int[2][]; + MyInt16ThreeDimensionArray[0][0] = new int[] { 11, 12 }; + MyInt16ThreeDimensionArray[0][1] = new int[] { 13, 14 }; + MyInt16ThreeDimensionArray[1][0] = new int[] { 21, 22 }; + MyInt16ThreeDimensionArray[1][1] = new int[] { 23, 24 }; + + MyInt16ThreeDimensionList = new List>>(); + var list1 = new List>(); + MyInt16ThreeDimensionList.Add(list1); + list1.Add(new List { 11, 12 }); + list1.Add(new List { 13, 14 }); + var list2 = new List>(); + MyInt16ThreeDimensionList.Add(list2); + list2.Add(new List { 21, 22 }); + list2.Add(new List { 23, 24 }); + + MyStringList = new List() { "Hello" }; + + MyStringIEnumerable = new string[] { "Hello" }; + MyStringIList = new string[] { "Hello" }; + MyStringICollection = new string[] { "Hello" }; + + MyStringIEnumerableT = new string[] { "Hello" }; + MyStringIListT = new string[] { "Hello" }; + MyStringICollectionT = new string[] { "Hello" }; + MyStringIReadOnlyCollectionT = new string[] { "Hello" }; + MyStringIReadOnlyListT = new string[] { "Hello" }; + MyStringISetT = new HashSet { "Hello" }; + + MyStringToStringKeyValuePair = new KeyValuePair("myKey", "myValue"); + MyStringToStringIDict = new Dictionary { { "key", "value" } }; + + MyStringToStringGenericDict = new Dictionary { { "key", "value" } }; + MyStringToStringGenericIDict = new Dictionary { { "key", "value" } }; + MyStringToStringGenericIReadOnlyDict = new Dictionary { { "key", "value" } }; + + MyStringToStringImmutableDict = ImmutableDictionary.CreateRange(MyStringToStringGenericDict); + MyStringToStringIImmutableDict = ImmutableDictionary.CreateRange(MyStringToStringGenericDict); + MyStringToStringImmutableSortedDict = ImmutableSortedDictionary.CreateRange(MyStringToStringGenericDict); + + MyStringStackT = new Stack(new List() { "Hello", "World" }); + MyStringQueueT = new Queue(new List() { "Hello", "World" }); + MyStringHashSetT = new HashSet(new List() { "Hello" }); + MyStringLinkedListT = new LinkedList(new List() { "Hello" }); + MyStringSortedSetT = new SortedSet(new List() { "Hello" }); + + MyStringIImmutableListT = ImmutableList.CreateRange(new List { "Hello" }); + MyStringIImmutableStackT = ImmutableStack.CreateRange(new List { "Hello" }); + MyStringIImmutableQueueT = ImmutableQueue.CreateRange(new List { "Hello" }); + MyStringIImmutableSetT = ImmutableHashSet.CreateRange(new List { "Hello" }); + MyStringImmutableHashSetT = ImmutableHashSet.CreateRange(new List { "Hello" }); + MyStringImmutableListT = ImmutableList.CreateRange(new List { "Hello" }); + MyStringImmutableStackT = ImmutableStack.CreateRange(new List { "Hello" }); + MyStringImmutablQueueT = ImmutableQueue.CreateRange(new List { "Hello" }); + MyStringImmutableSortedSetT = ImmutableSortedSet.CreateRange(new List { "Hello" }); + + MyListOfNullString = new List { null }; + } + + public void Verify() + { + Assert.Equal((short)1, MyInt16); + Assert.Equal((int)2, MyInt32); + Assert.Equal((long)3, MyInt64); + Assert.Equal((ushort)4, MyUInt16); + Assert.Equal((uint)5, MyUInt32); + Assert.Equal((ulong)6, MyUInt64); + Assert.Equal((byte)7, MyByte); + Assert.Equal((sbyte)8, MySByte); + Assert.Equal('a', MyChar); + Assert.Equal("Hello", MyString); + Assert.Equal(3.3m, MyDecimal); + Assert.False(MyBooleanFalse); + Assert.True(MyBooleanTrue); + Assert.Equal(1.1f, MySingle); + Assert.Equal(2.2d, MyDouble); + Assert.Equal(new DateTime(2019, 1, 30, 12, 1, 2, DateTimeKind.Utc), MyDateTime); + Assert.Equal(new DateTimeOffset(2019, 1, 30, 12, 1, 2, new TimeSpan(1, 0, 0)), MyDateTimeOffset); + Assert.Equal(new Guid("1B33498A-7B7D-4DDA-9C13-F6AA4AB449A6"), MyGuid); + Assert.Equal(new Uri("https://github.com/dotnet/runtime"), MyUri); + Assert.Equal(SampleEnum.Two, MyEnum); + Assert.Equal(SampleEnumInt64.MinNegative, MyInt64Enum); + Assert.Equal(SampleEnumUInt64.Max, MyUInt64Enum); + Assert.Equal(11, MySimpleStruct.One); + Assert.Equal(1.9999, MySimpleStruct.Two); + Assert.Equal(64, MySimpleTestStruct.MyInt64); + Assert.Equal("Hello", MySimpleTestStruct.MyString); + Assert.Equal(32, MySimpleTestStruct.MyInt32Array[0]); + + Assert.Equal((short)1, MyInt16Array[0]); + Assert.Equal((int)2, MyInt32Array[0]); + Assert.Equal((long)3, MyInt64Array[0]); + Assert.Equal((ushort)4, MyUInt16Array[0]); + Assert.Equal((uint)5, MyUInt32Array[0]); + Assert.Equal((ulong)6, MyUInt64Array[0]); + Assert.Equal((byte)7, MyByteArray[0]); + Assert.Equal((sbyte)8, MySByteArray[0]); + Assert.Equal('a', MyCharArray[0]); + Assert.Equal("Hello", MyStringArray[0]); + Assert.Equal(3.3m, MyDecimalArray[0]); + Assert.False(MyBooleanFalseArray[0]); + Assert.True(MyBooleanTrueArray[0]); + Assert.Equal(1.1f, MySingleArray[0]); + Assert.Equal(2.2d, MyDoubleArray[0]); + Assert.Equal(new DateTime(2019, 1, 30, 12, 1, 2, DateTimeKind.Utc), MyDateTimeArray[0]); + Assert.Equal(new DateTimeOffset(2019, 1, 30, 12, 1, 2, new TimeSpan(1, 0, 0)), MyDateTimeOffsetArray[0]); + Assert.Equal(new Guid("1B33498A-7B7D-4DDA-9C13-F6AA4AB449A6"), MyGuidArray[0]); + Assert.Equal(new Uri("https://github.com/dotnet/runtime"), MyUriArray[0]); + Assert.Equal(SampleEnum.Two, MyEnumArray[0]); + + Assert.Equal(10, MyInt16TwoDimensionArray[0][0]); + Assert.Equal(11, MyInt16TwoDimensionArray[0][1]); + Assert.Equal(20, MyInt16TwoDimensionArray[1][0]); + Assert.Equal(21, MyInt16TwoDimensionArray[1][1]); + + Assert.Equal(10, MyInt16TwoDimensionList[0][0]); + Assert.Equal(11, MyInt16TwoDimensionList[0][1]); + Assert.Equal(20, MyInt16TwoDimensionList[1][0]); + Assert.Equal(21, MyInt16TwoDimensionList[1][1]); + + Assert.Equal(11, MyInt16ThreeDimensionArray[0][0][0]); + Assert.Equal(12, MyInt16ThreeDimensionArray[0][0][1]); + Assert.Equal(13, MyInt16ThreeDimensionArray[0][1][0]); + Assert.Equal(14, MyInt16ThreeDimensionArray[0][1][1]); + Assert.Equal(21, MyInt16ThreeDimensionArray[1][0][0]); + Assert.Equal(22, MyInt16ThreeDimensionArray[1][0][1]); + Assert.Equal(23, MyInt16ThreeDimensionArray[1][1][0]); + Assert.Equal(24, MyInt16ThreeDimensionArray[1][1][1]); + + Assert.Equal(11, MyInt16ThreeDimensionList[0][0][0]); + Assert.Equal(12, MyInt16ThreeDimensionList[0][0][1]); + Assert.Equal(13, MyInt16ThreeDimensionList[0][1][0]); + Assert.Equal(14, MyInt16ThreeDimensionList[0][1][1]); + Assert.Equal(21, MyInt16ThreeDimensionList[1][0][0]); + Assert.Equal(22, MyInt16ThreeDimensionList[1][0][1]); + Assert.Equal(23, MyInt16ThreeDimensionList[1][1][0]); + Assert.Equal(24, MyInt16ThreeDimensionList[1][1][1]); + + Assert.Equal("Hello", MyStringList[0]); + + IEnumerator enumerator = MyStringIEnumerable.GetEnumerator(); + enumerator.MoveNext(); + { + // Verifying after deserialization. + if (enumerator.Current is JsonElement currentJsonElement) + { + Assert.Equal("Hello", currentJsonElement.GetString()); + } + // Verifying test data. + else + { + Assert.Equal("Hello", enumerator.Current); + } + } + + { + // Verifying after deserialization. + if (MyStringIList[0] is JsonElement currentJsonElement) + { + Assert.Equal("Hello", currentJsonElement.GetString()); + } + // Verifying test data. + else + { + Assert.Equal("Hello", enumerator.Current); + } + } + + enumerator = MyStringICollection.GetEnumerator(); + enumerator.MoveNext(); + { + // Verifying after deserialization. + if (enumerator.Current is JsonElement currentJsonElement) + { + Assert.Equal("Hello", currentJsonElement.GetString()); + } + // Verifying test data. + else + { + Assert.Equal("Hello", enumerator.Current); + } + } + + Assert.Equal("Hello", MyStringIEnumerableT.First()); + Assert.Equal("Hello", MyStringIListT[0]); + Assert.Equal("Hello", MyStringICollectionT.First()); + Assert.Equal("Hello", MyStringIReadOnlyCollectionT.First()); + Assert.Equal("Hello", MyStringIReadOnlyListT[0]); + Assert.Equal("Hello", MyStringISetT.First()); + + enumerator = MyStringToStringIDict.GetEnumerator(); + enumerator.MoveNext(); + { + // Verifying after deserialization. + if (enumerator.Current is JsonElement currentJsonElement) + { + IEnumerator jsonEnumerator = currentJsonElement.EnumerateObject(); + jsonEnumerator.MoveNext(); + + JsonProperty property = (JsonProperty)jsonEnumerator.Current; + + Assert.Equal("key", property.Name); + Assert.Equal("value", property.Value.GetString()); + } + // Verifying test data. + else + { + DictionaryEntry entry = (DictionaryEntry)enumerator.Current; + Assert.Equal("key", entry.Key); + + if (entry.Value is JsonElement element) + { + Assert.Equal("value", element.GetString()); + } + else + { + Assert.Equal("value", entry.Value); + } + } + } + + Assert.Equal("value", MyStringToStringGenericDict["key"]); + Assert.Equal("value", MyStringToStringGenericIDict["key"]); + Assert.Equal("value", MyStringToStringGenericIReadOnlyDict["key"]); + + Assert.Equal("value", MyStringToStringImmutableDict["key"]); + Assert.Equal("value", MyStringToStringIImmutableDict["key"]); + Assert.Equal("value", MyStringToStringImmutableSortedDict["key"]); + + Assert.Equal("myKey", MyStringToStringKeyValuePair.Key); + Assert.Equal("myValue", MyStringToStringKeyValuePair.Value); + + Assert.Equal(2, MyStringStackT.Count); + Assert.True(MyStringStackT.Contains("Hello")); + Assert.True(MyStringStackT.Contains("World")); + + string[] expectedQueue = { "Hello", "World" }; + int i = 0; + foreach (string item in MyStringQueueT) + { + Assert.Equal(expectedQueue[i], item); + i++; + } + + Assert.Equal("Hello", MyStringHashSetT.First()); + Assert.Equal("Hello", MyStringLinkedListT.First()); + Assert.Equal("Hello", MyStringSortedSetT.First()); + + Assert.Equal("Hello", MyStringIImmutableListT[0]); + Assert.Equal("Hello", MyStringIImmutableStackT.First()); + Assert.Equal("Hello", MyStringIImmutableQueueT.First()); + Assert.Equal("Hello", MyStringIImmutableSetT.First()); + Assert.Equal("Hello", MyStringImmutableHashSetT.First()); + Assert.Equal("Hello", MyStringImmutableListT[0]); + Assert.Equal("Hello", MyStringImmutableStackT.First()); + Assert.Equal("Hello", MyStringImmutablQueueT.First()); + Assert.Equal("Hello", MyStringImmutableSortedSetT.First()); + + Assert.Null(MyListOfNullString[0]); + } + } +} diff --git a/src/libraries/System.Text.Json/tests/Serialization/TestClasses/TestClasses.SimpleTestStructWithFields.cs b/src/libraries/System.Text.Json/tests/Serialization/TestClasses/TestClasses.SimpleTestStructWithFields.cs new file mode 100644 index 000000000000..61b9a028f784 --- /dev/null +++ b/src/libraries/System.Text.Json/tests/Serialization/TestClasses/TestClasses.SimpleTestStructWithFields.cs @@ -0,0 +1,221 @@ +// 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.Linq; +using Xunit; + +namespace System.Text.Json.Serialization.Tests +{ + public struct SimpleTestStructWithFields : ITestClass + { + public short MyInt16; + public int MyInt32; + public long MyInt64; + public ushort MyUInt16; + public uint MyUInt32; + public ulong MyUInt64; + public byte MyByte; + public sbyte MySByte; + public char MyChar; + public string MyString; + public decimal MyDecimal; + public bool MyBooleanTrue; + public bool MyBooleanFalse; + public float MySingle; + public double MyDouble; + public DateTime MyDateTime; + public DateTimeOffset MyDateTimeOffset; + public SampleEnum MyEnum; + public SampleEnumInt64 MyInt64Enum; + public SampleEnumUInt64 MyUInt64Enum; + public SimpleStruct MySimpleStruct; + public SimpleTestClass MySimpleTestClass; + public short[] MyInt16Array; + public int[] MyInt32Array; + public long[] MyInt64Array; + public ushort[] MyUInt16Array; + public uint[] MyUInt32Array; + public ulong[] MyUInt64Array; + public byte[] MyByteArray; + public sbyte[] MySByteArray; + public char[] MyCharArray; + public string[] MyStringArray; + public decimal[] MyDecimalArray; + public bool[] MyBooleanTrueArray; + public bool[] MyBooleanFalseArray; + public float[] MySingleArray; + public double[] MyDoubleArray; + public DateTime[] MyDateTimeArray; + public DateTimeOffset[] MyDateTimeOffsetArray; + public SampleEnum[] MyEnumArray; + public List MyStringList; + public IEnumerable MyStringIEnumerableT; + public IList MyStringIListT; + public ICollection MyStringICollectionT; + public IReadOnlyCollection MyStringIReadOnlyCollectionT; + public IReadOnlyList MyStringIReadOnlyListT; + public ISet MyStringISetT; + + public static readonly string s_json = $"{{{s_partialJsonProperties},{s_partialJsonArrays}}}"; + public static readonly string s_json_flipped = $"{{{s_partialJsonArrays},{s_partialJsonProperties}}}"; + + private const string s_partialJsonProperties = + @"""MyInt16"" : 1," + + @"""MyInt32"" : 2," + + @"""MyInt64"" : 3," + + @"""MyUInt16"" : 4," + + @"""MyUInt32"" : 5," + + @"""MyUInt64"" : 6," + + @"""MyByte"" : 7," + + @"""MySByte"" : 8," + + @"""MyChar"" : ""a""," + + @"""MyString"" : ""Hello""," + + @"""MyBooleanTrue"" : true," + + @"""MyBooleanFalse"" : false," + + @"""MySingle"" : 1.1," + + @"""MyDouble"" : 2.2," + + @"""MyDecimal"" : 3.3," + + @"""MyDateTime"" : ""2019-01-30T12:01:02.0000000Z""," + + @"""MyDateTimeOffset"" : ""2019-01-30T12:01:02.0000000+01:00""," + + @"""MyEnum"" : 2," + // int by default + @"""MyInt64Enum"" : -9223372036854775808," + + @"""MyUInt64Enum"" : 18446744073709551615," + + @"""MySimpleStruct"" : {""One"" : 11, ""Two"" : 1.9999, ""Three"" : 33}"; + + private const string s_partialJsonArrays = + @"""MyInt16Array"" : [1]," + + @"""MyInt32Array"" : [2]," + + @"""MyInt64Array"" : [3]," + + @"""MyUInt16Array"" : [4]," + + @"""MyUInt32Array"" : [5]," + + @"""MyUInt64Array"" : [6]," + + @"""MyByteArray"" : ""Bw==""," + // Base64 encoded value of 7 + @"""MySByteArray"" : [8]," + + @"""MyCharArray"" : [""a""]," + + @"""MyStringArray"" : [""Hello""]," + + @"""MyBooleanTrueArray"" : [true]," + + @"""MyBooleanFalseArray"" : [false]," + + @"""MySingleArray"" : [1.1]," + + @"""MyDoubleArray"" : [2.2]," + + @"""MyDecimalArray"" : [3.3]," + + @"""MyDateTimeArray"" : [""2019-01-30T12:01:02.0000000Z""]," + + @"""MyDateTimeOffsetArray"" : [""2019-01-30T12:01:02.0000000+01:00""]," + + @"""MyEnumArray"" : [2]," + // int by default + @"""MyStringList"" : [""Hello""]," + + @"""MyStringIEnumerableT"" : [""Hello""]," + + @"""MyStringIListT"" : [""Hello""]," + + @"""MyStringICollectionT"" : [""Hello""]," + + @"""MyStringIReadOnlyCollectionT"" : [""Hello""]," + + @"""MyStringIReadOnlyListT"" : [""Hello""]," + + @"""MyStringISetT"" : [""Hello""]"; + + public static readonly byte[] s_data = Encoding.UTF8.GetBytes(s_json); + + public void Initialize() + { + MyInt16 = 1; + MyInt32 = 2; + MyInt64 = 3; + MyUInt16 = 4; + MyUInt32 = 5; + MyUInt64 = 6; + MyByte = 7; + MySByte = 8; + MyChar = 'a'; + MyString = "Hello"; + MyBooleanTrue = true; + MyBooleanFalse = false; + MySingle = 1.1f; + MyDouble = 2.2d; + MyDecimal = 3.3m; + MyDateTime = new DateTime(2019, 1, 30, 12, 1, 2, DateTimeKind.Utc); + MyDateTimeOffset = new DateTimeOffset(2019, 1, 30, 12, 1, 2, new TimeSpan(1, 0, 0)); + MyEnum = SampleEnum.Two; + MyInt64Enum = SampleEnumInt64.MinNegative; + MyUInt64Enum = SampleEnumUInt64.Max; + MySimpleStruct = new SimpleStruct { One = 11, Two = 1.9999 }; + + MyInt16Array = new short[] { 1 }; + MyInt32Array = new int[] { 2 }; + MyInt64Array = new long[] { 3 }; + MyUInt16Array = new ushort[] { 4 }; + MyUInt32Array = new uint[] { 5 }; + MyUInt64Array = new ulong[] { 6 }; + MyByteArray = new byte[] { 7 }; + MySByteArray = new sbyte[] { 8 }; + MyCharArray = new char[] { 'a' }; + MyStringArray = new string[] { "Hello" }; + MyBooleanTrueArray = new bool[] { true }; + MyBooleanFalseArray = new bool[] { false }; + MySingleArray = new float[] { 1.1f }; + MyDoubleArray = new double[] { 2.2d }; + MyDecimalArray = new decimal[] { 3.3m }; + MyDateTimeArray = new DateTime[] { new DateTime(2019, 1, 30, 12, 1, 2, DateTimeKind.Utc) }; + MyDateTimeOffsetArray = new DateTimeOffset[] { new DateTimeOffset(2019, 1, 30, 12, 1, 2, new TimeSpan(1, 0, 0)) }; + MyEnumArray = new SampleEnum[] { SampleEnum.Two }; + + MyStringList = new List() { "Hello" }; + MyStringIEnumerableT = new string[] { "Hello" }; + MyStringIListT = new string[] { "Hello" }; + MyStringICollectionT = new string[] { "Hello" }; + MyStringIReadOnlyCollectionT = new string[] { "Hello" }; + MyStringIReadOnlyListT = new string[] { "Hello" }; + MyStringISetT = new HashSet { "Hello" }; + } + + public void Verify() + { + Assert.Equal((short)1, MyInt16); + Assert.Equal((int)2, MyInt32); + Assert.Equal((long)3, MyInt64); + Assert.Equal((ushort)4, MyUInt16); + Assert.Equal((uint)5, MyUInt32); + Assert.Equal((ulong)6, MyUInt64); + Assert.Equal((byte)7, MyByte); + Assert.Equal((sbyte)8, MySByte); + Assert.Equal('a', MyChar); + Assert.Equal("Hello", MyString); + Assert.Equal(3.3m, MyDecimal); + Assert.False(MyBooleanFalse); + Assert.True(MyBooleanTrue); + Assert.Equal(1.1f, MySingle); + Assert.Equal(2.2d, MyDouble); + Assert.Equal(new DateTime(2019, 1, 30, 12, 1, 2, DateTimeKind.Utc), MyDateTime); + Assert.Equal(new DateTimeOffset(2019, 1, 30, 12, 1, 2, new TimeSpan(1, 0, 0)), MyDateTimeOffset); + Assert.Equal(SampleEnum.Two, MyEnum); + Assert.Equal(SampleEnumInt64.MinNegative, MyInt64Enum); + Assert.Equal(SampleEnumUInt64.Max, MyUInt64Enum); + Assert.Equal(11, MySimpleStruct.One); + Assert.Equal(1.9999, MySimpleStruct.Two); + + Assert.Equal((short)1, MyInt16Array[0]); + Assert.Equal((int)2, MyInt32Array[0]); + Assert.Equal((long)3, MyInt64Array[0]); + Assert.Equal((ushort)4, MyUInt16Array[0]); + Assert.Equal((uint)5, MyUInt32Array[0]); + Assert.Equal((ulong)6, MyUInt64Array[0]); + Assert.Equal((byte)7, MyByteArray[0]); + Assert.Equal((sbyte)8, MySByteArray[0]); + Assert.Equal('a', MyCharArray[0]); + Assert.Equal("Hello", MyStringArray[0]); + Assert.Equal(3.3m, MyDecimalArray[0]); + Assert.False(MyBooleanFalseArray[0]); + Assert.True(MyBooleanTrueArray[0]); + Assert.Equal(1.1f, MySingleArray[0]); + Assert.Equal(2.2d, MyDoubleArray[0]); + Assert.Equal(new DateTime(2019, 1, 30, 12, 1, 2, DateTimeKind.Utc), MyDateTimeArray[0]); + Assert.Equal(new DateTimeOffset(2019, 1, 30, 12, 1, 2, new TimeSpan(1, 0, 0)), MyDateTimeOffsetArray[0]); + Assert.Equal(SampleEnum.Two, MyEnumArray[0]); + + Assert.Equal("Hello", MyStringList[0]); + Assert.Equal("Hello", MyStringIEnumerableT.First()); + Assert.Equal("Hello", MyStringIListT[0]); + Assert.Equal("Hello", MyStringICollectionT.First()); + Assert.Equal("Hello", MyStringIReadOnlyCollectionT.First()); + Assert.Equal("Hello", MyStringIReadOnlyListT[0]); + Assert.Equal("Hello", MyStringISetT.First()); + } + } +} diff --git a/src/libraries/System.Text.Json/tests/Serialization/TestClasses/TestClasses.cs b/src/libraries/System.Text.Json/tests/Serialization/TestClasses/TestClasses.cs index 72278edeeecb..8496e4b5817e 100644 --- a/src/libraries/System.Text.Json/tests/Serialization/TestClasses/TestClasses.cs +++ b/src/libraries/System.Text.Json/tests/Serialization/TestClasses/TestClasses.cs @@ -1805,6 +1805,16 @@ public class ClassWithExtensionProperty public IDictionary MyOverflow { get; set; } } + public class ClassWithExtensionField + { + public SimpleTestClass MyNestedClass { get; set; } + public int MyInt { get; set; } + + [JsonInclude] + [JsonExtensionData] + public IDictionary MyOverflow; + } + public class TestClassWithNestedObjectCommentsInner : ITestClass { public SimpleTestClass MyData { get; set; } diff --git a/src/libraries/System.Text.Json/tests/Serialization/TestData.cs b/src/libraries/System.Text.Json/tests/Serialization/TestData.cs index bfb197a8c06f..190aebeddda7 100644 --- a/src/libraries/System.Text.Json/tests/Serialization/TestData.cs +++ b/src/libraries/System.Text.Json/tests/Serialization/TestData.cs @@ -12,7 +12,9 @@ public static IEnumerable ReadSuccessCases get { yield return new object[] { typeof(SimpleTestStruct), SimpleTestStruct.s_data }; + yield return new object[] { typeof(SimpleTestStructWithFields), SimpleTestStructWithFields.s_data }; yield return new object[] { typeof(SimpleTestClass), SimpleTestClass.s_data }; + yield return new object[] { typeof(SimpleTestClassWithFields), SimpleTestClassWithFields.s_data }; yield return new object[] { typeof(SimpleTestClassWithNullables), SimpleTestClassWithNullables.s_data }; yield return new object[] { typeof(SimpleTestClassWithNulls), SimpleTestClassWithNulls.s_data }; yield return new object[] { typeof(SimpleTestClassWithSimpleObject), SimpleTestClassWithSimpleObject.s_data }; @@ -50,12 +52,15 @@ public static IEnumerable ReadSuccessCases yield return new object[] { typeof(ClassWithComplexObjects), ClassWithComplexObjects.s_data }; } } + public static IEnumerable WriteSuccessCases { get { yield return new object[] { new SimpleTestStruct() }; + yield return new object[] { new SimpleTestStructWithFields() }; yield return new object[] { new SimpleTestClass() }; + yield return new object[] { new SimpleTestClassWithFields() }; yield return new object[] { new SimpleTestClassWithNullables() }; yield return new object[] { new SimpleTestClassWithNulls() }; yield return new object[] { new SimpleTestClassWithSimpleObject() }; diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests.csproj b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests.csproj index 918787c3201e..72f5dbc5097b 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests.csproj +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests.csproj @@ -119,11 +119,13 @@ + + @@ -140,6 +142,9 @@ + + + diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs index b26a627a8cf2..bd5bf8a60e67 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs @@ -1335,9 +1335,8 @@ protected void GenerateFindFirstChar() } // ch = runtext[runtextpos]; - // if (ch == lastChar) goto partialMatch; Rightchar(); - if (_boyerMoorePrefix.CaseInsensitive && ParticipatesInCaseConversion(chLast)) + if (_boyerMoorePrefix.CaseInsensitive) { CallToLower(); } @@ -1349,6 +1348,7 @@ protected void GenerateFindFirstChar() Ldloc(chLocal); Ldc(chLast); + // if (ch == lastChar) goto partialMatch; BeqFar(lPartialMatch); // ch -= lowAscii; diff --git a/src/libraries/System.Text.RegularExpressions/tests/Regex.Match.Tests.cs b/src/libraries/System.Text.RegularExpressions/tests/Regex.Match.Tests.cs index 9ae78f8f91d2..70dfee3c47d9 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/Regex.Match.Tests.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/Regex.Match.Tests.cs @@ -15,6 +15,8 @@ public class RegexMatchTests public static IEnumerable Match_Basic_TestData() { // pattern, input, options, beginning, length, expectedSuccess, expectedValue + yield return new object[] { @"H#", "#H#", RegexOptions.IgnoreCase, 0, 3, true, "H#" }; // https://github.com/dotnet/runtime/issues/39390 + yield return new object[] { @"H#", "#H#", RegexOptions.None, 0, 3, true, "H#" }; // Testing octal sequence matches: "\\060(\\061)?\\061" // Octal \061 is ASCII 49 ('1') diff --git a/src/libraries/System.Threading.AccessControl/Directory.Build.props b/src/libraries/System.Threading.AccessControl/Directory.Build.props index 63f02a0f817e..33e65b7cb465 100644 --- a/src/libraries/System.Threading.AccessControl/Directory.Build.props +++ b/src/libraries/System.Threading.AccessControl/Directory.Build.props @@ -2,5 +2,6 @@ Microsoft + true \ No newline at end of file diff --git a/src/libraries/System.Threading.Channels/src/System.Threading.Channels.csproj b/src/libraries/System.Threading.Channels/src/System.Threading.Channels.csproj index f3adbd227e09..b52a5869a938 100644 --- a/src/libraries/System.Threading.Channels/src/System.Threading.Channels.csproj +++ b/src/libraries/System.Threading.Channels/src/System.Threading.Channels.csproj @@ -1,6 +1,7 @@ - $(NetCoreAppCurrent);netstandard1.3;netstandard2.0;netstandard2.1;netcoreapp3.0 + $(NetCoreAppCurrent);netstandard1.3;netstandard2.0;netstandard2.1;netcoreapp3.0;net461;$(NetFrameworkCurrent) + true true enable @@ -8,16 +9,16 @@ - - + + - + - + @@ -39,8 +40,12 @@ - + + + + + diff --git a/src/libraries/System.Threading.Channels/src/System/Threading/Channels/SingleConsumerUnboundedChannel.cs b/src/libraries/System.Threading.Channels/src/System/Threading/Channels/SingleConsumerUnboundedChannel.cs index 015d7f893aa0..50398e841e7b 100644 --- a/src/libraries/System.Threading.Channels/src/System/Threading/Channels/SingleConsumerUnboundedChannel.cs +++ b/src/libraries/System.Threading.Channels/src/System/Threading/Channels/SingleConsumerUnboundedChannel.cs @@ -114,7 +114,7 @@ public override ValueTask ReadAsync(CancellationToken cancellationToken) parent._blockedReader = newBlockedReader; } - oldBlockedReader?.TrySetCanceled(); + oldBlockedReader?.TrySetCanceled(default); return newBlockedReader.ValueTaskOfT; } @@ -183,7 +183,7 @@ public override ValueTask WaitToReadAsync(CancellationToken cancellationTo parent._waitingReader = newWaitingReader; } - oldWaitingReader?.TrySetCanceled(); + oldWaitingReader?.TrySetCanceled(default); return newWaitingReader.ValueTaskOfT; } diff --git a/src/libraries/System.Threading.Overlapped/Directory.Build.props b/src/libraries/System.Threading.Overlapped/Directory.Build.props index 465e1110d6b0..0f058f12cba8 100644 --- a/src/libraries/System.Threading.Overlapped/Directory.Build.props +++ b/src/libraries/System.Threading.Overlapped/Directory.Build.props @@ -3,5 +3,6 @@ Microsoft true + true \ No newline at end of file diff --git a/src/libraries/System.Threading.Overlapped/src/Resources/Strings.resx b/src/libraries/System.Threading.Overlapped/src/Resources/Strings.resx deleted file mode 100644 index c7bbd1808ae4..000000000000 --- a/src/libraries/System.Threading.Overlapped/src/Resources/Strings.resx +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 'handle' has already been bound to the thread pool, or was not opened for asynchronous I/O. - - - Handle has been disposed or is invalid. - - - 'overlapped' has already been freed. - - - 'overlapped' was not allocated by this ThreadPoolBoundHandle instance. - - - 'preAllocated' is already in use. - - - NativeOverlapped cannot be reused for multiple operations. - - diff --git a/src/libraries/System.Threading.Overlapped/src/System.Threading.Overlapped.csproj b/src/libraries/System.Threading.Overlapped/src/System.Threading.Overlapped.csproj index a5c9c0d5417c..dd3dc2940a54 100644 --- a/src/libraries/System.Threading.Overlapped/src/System.Threading.Overlapped.csproj +++ b/src/libraries/System.Threading.Overlapped/src/System.Threading.Overlapped.csproj @@ -1,7 +1,5 @@ - System.Threading.Overlapped - true true $(NetCoreAppCurrent) enable diff --git a/src/libraries/System.Threading.Tasks.Dataflow/ref/System.Threading.Tasks.Dataflow.cs b/src/libraries/System.Threading.Tasks.Dataflow/ref/System.Threading.Tasks.Dataflow.cs index dcd70efc6979..e860e697ac7d 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/ref/System.Threading.Tasks.Dataflow.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/ref/System.Threading.Tasks.Dataflow.cs @@ -30,15 +30,15 @@ public BatchBlock(int batchSize, System.Threading.Tasks.Dataflow.GroupingDataflo public void Complete() { } public System.IDisposable LinkTo(System.Threading.Tasks.Dataflow.ITargetBlock target, System.Threading.Tasks.Dataflow.DataflowLinkOptions linkOptions) { throw null; } void System.Threading.Tasks.Dataflow.IDataflowBlock.Fault(System.Exception exception) { } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] T[] System.Threading.Tasks.Dataflow.ISourceBlock.ConsumeMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target, out bool messageConsumed) { throw null; } void System.Threading.Tasks.Dataflow.ISourceBlock.ReleaseReservation(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target) { } bool System.Threading.Tasks.Dataflow.ISourceBlock.ReserveMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target) { throw null; } System.Threading.Tasks.Dataflow.DataflowMessageStatus System.Threading.Tasks.Dataflow.ITargetBlock.OfferMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, T messageValue, System.Threading.Tasks.Dataflow.ISourceBlock? source, bool consumeToAccept) { throw null; } public override string ToString() { throw null; } public void TriggerBatch() { } - public bool TryReceive(System.Predicate? filter, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out T[]? item) { throw null; } - public bool TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Collections.Generic.IList? items) { throw null; } + public bool TryReceive(System.Predicate? filter, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out T[]? item) { throw null; } + public bool TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Collections.Generic.IList? items) { throw null; } } public sealed partial class BatchedJoinBlock : System.Threading.Tasks.Dataflow.IDataflowBlock, System.Threading.Tasks.Dataflow.IReceivableSourceBlock, System.Collections.Generic.IList>>, System.Threading.Tasks.Dataflow.ISourceBlock, System.Collections.Generic.IList>> { @@ -56,8 +56,8 @@ void System.Threading.Tasks.Dataflow.IDataflowBlock.Fault(System.Exception excep void System.Threading.Tasks.Dataflow.ISourceBlock,System.Collections.Generic.IList>>.ReleaseReservation(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock, System.Collections.Generic.IList>> target) { } bool System.Threading.Tasks.Dataflow.ISourceBlock,System.Collections.Generic.IList>>.ReserveMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock, System.Collections.Generic.IList>> target) { throw null; } public override string ToString() { throw null; } - public bool TryReceive(System.Predicate, System.Collections.Generic.IList>>? filter, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Tuple, System.Collections.Generic.IList>? item) { throw null; } - public bool TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Collections.Generic.IList, System.Collections.Generic.IList>>? items) { throw null; } + public bool TryReceive(System.Predicate, System.Collections.Generic.IList>>? filter, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Tuple, System.Collections.Generic.IList>? item) { throw null; } + public bool TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Collections.Generic.IList, System.Collections.Generic.IList>>? items) { throw null; } } public sealed partial class BatchedJoinBlock : System.Threading.Tasks.Dataflow.IDataflowBlock, System.Threading.Tasks.Dataflow.IReceivableSourceBlock, System.Collections.Generic.IList, System.Collections.Generic.IList>>, System.Threading.Tasks.Dataflow.ISourceBlock, System.Collections.Generic.IList, System.Collections.Generic.IList>> { @@ -76,8 +76,8 @@ void System.Threading.Tasks.Dataflow.IDataflowBlock.Fault(System.Exception excep void System.Threading.Tasks.Dataflow.ISourceBlock,System.Collections.Generic.IList,System.Collections.Generic.IList>>.ReleaseReservation(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock, System.Collections.Generic.IList, System.Collections.Generic.IList>> target) { } bool System.Threading.Tasks.Dataflow.ISourceBlock,System.Collections.Generic.IList,System.Collections.Generic.IList>>.ReserveMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock, System.Collections.Generic.IList, System.Collections.Generic.IList>> target) { throw null; } public override string ToString() { throw null; } - public bool TryReceive(System.Predicate, System.Collections.Generic.IList, System.Collections.Generic.IList>>? filter, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Tuple, System.Collections.Generic.IList, System.Collections.Generic.IList>? item) { throw null; } - public bool TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Collections.Generic.IList, System.Collections.Generic.IList, System.Collections.Generic.IList>>? items) { throw null; } + public bool TryReceive(System.Predicate, System.Collections.Generic.IList, System.Collections.Generic.IList>>? filter, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Tuple, System.Collections.Generic.IList, System.Collections.Generic.IList>? item) { throw null; } + public bool TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Collections.Generic.IList, System.Collections.Generic.IList, System.Collections.Generic.IList>>? items) { throw null; } } public sealed partial class BroadcastBlock : System.Threading.Tasks.Dataflow.IDataflowBlock, System.Threading.Tasks.Dataflow.IPropagatorBlock, System.Threading.Tasks.Dataflow.IReceivableSourceBlock, System.Threading.Tasks.Dataflow.ISourceBlock, System.Threading.Tasks.Dataflow.ITargetBlock { @@ -87,8 +87,8 @@ public BroadcastBlock(System.Func? cloningFunction, System.Threading.Tasks public void Complete() { } public System.IDisposable LinkTo(System.Threading.Tasks.Dataflow.ITargetBlock target, System.Threading.Tasks.Dataflow.DataflowLinkOptions linkOptions) { throw null; } void System.Threading.Tasks.Dataflow.IDataflowBlock.Fault(System.Exception exception) { } - bool System.Threading.Tasks.Dataflow.IReceivableSourceBlock.TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Collections.Generic.IList? items) { throw null; } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + bool System.Threading.Tasks.Dataflow.IReceivableSourceBlock.TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Collections.Generic.IList? items) { throw null; } + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] T System.Threading.Tasks.Dataflow.ISourceBlock.ConsumeMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target, out bool messageConsumed) { throw null; } void System.Threading.Tasks.Dataflow.ISourceBlock.ReleaseReservation(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target) { } bool System.Threading.Tasks.Dataflow.ISourceBlock.ReserveMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target) { throw null; } @@ -105,14 +105,14 @@ public BufferBlock(System.Threading.Tasks.Dataflow.DataflowBlockOptions dataflow public void Complete() { } public System.IDisposable LinkTo(System.Threading.Tasks.Dataflow.ITargetBlock target, System.Threading.Tasks.Dataflow.DataflowLinkOptions linkOptions) { throw null; } void System.Threading.Tasks.Dataflow.IDataflowBlock.Fault(System.Exception exception) { } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] T System.Threading.Tasks.Dataflow.ISourceBlock.ConsumeMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target, out bool messageConsumed) { throw null; } void System.Threading.Tasks.Dataflow.ISourceBlock.ReleaseReservation(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target) { } bool System.Threading.Tasks.Dataflow.ISourceBlock.ReserveMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target) { throw null; } System.Threading.Tasks.Dataflow.DataflowMessageStatus System.Threading.Tasks.Dataflow.ITargetBlock.OfferMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, T messageValue, System.Threading.Tasks.Dataflow.ISourceBlock? source, bool consumeToAccept) { throw null; } public override string ToString() { throw null; } public bool TryReceive(System.Predicate? filter, [System.Diagnostics.CodeAnalysis.MaybeNullWhen(false)] out T item) { throw null; } - public bool TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Collections.Generic.IList? items) { throw null; } + public bool TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Collections.Generic.IList? items) { throw null; } } public static partial class DataflowBlock { @@ -204,11 +204,11 @@ public partial interface IPropagatorBlock : System.Threa public partial interface IReceivableSourceBlock : System.Threading.Tasks.Dataflow.IDataflowBlock, System.Threading.Tasks.Dataflow.ISourceBlock { bool TryReceive(System.Predicate? filter, [System.Diagnostics.CodeAnalysis.MaybeNullWhen(false)] out TOutput item); - bool TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Collections.Generic.IList? items); + bool TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Collections.Generic.IList? items); } public partial interface ISourceBlock : System.Threading.Tasks.Dataflow.IDataflowBlock { - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] TOutput ConsumeMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target, out bool messageConsumed); System.IDisposable LinkTo(System.Threading.Tasks.Dataflow.ITargetBlock target, System.Threading.Tasks.Dataflow.DataflowLinkOptions linkOptions); void ReleaseReservation(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target); @@ -233,8 +233,8 @@ void System.Threading.Tasks.Dataflow.IDataflowBlock.Fault(System.Exception excep void System.Threading.Tasks.Dataflow.ISourceBlock>.ReleaseReservation(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock> target) { } bool System.Threading.Tasks.Dataflow.ISourceBlock>.ReserveMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock> target) { throw null; } public override string ToString() { throw null; } - public bool TryReceive(System.Predicate>? filter, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Tuple? item) { throw null; } - public bool TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Collections.Generic.IList>? items) { throw null; } + public bool TryReceive(System.Predicate>? filter, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Tuple? item) { throw null; } + public bool TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Collections.Generic.IList>? items) { throw null; } } public sealed partial class JoinBlock : System.Threading.Tasks.Dataflow.IDataflowBlock, System.Threading.Tasks.Dataflow.IReceivableSourceBlock>, System.Threading.Tasks.Dataflow.ISourceBlock> { @@ -252,8 +252,8 @@ void System.Threading.Tasks.Dataflow.IDataflowBlock.Fault(System.Exception excep void System.Threading.Tasks.Dataflow.ISourceBlock>.ReleaseReservation(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock> target) { } bool System.Threading.Tasks.Dataflow.ISourceBlock>.ReserveMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock> target) { throw null; } public override string ToString() { throw null; } - public bool TryReceive(System.Predicate>? filter, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Tuple? item) { throw null; } - public bool TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Collections.Generic.IList>? items) { throw null; } + public bool TryReceive(System.Predicate>? filter, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Tuple? item) { throw null; } + public bool TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Collections.Generic.IList>? items) { throw null; } } public sealed partial class TransformBlock : System.Threading.Tasks.Dataflow.IDataflowBlock, System.Threading.Tasks.Dataflow.IPropagatorBlock, System.Threading.Tasks.Dataflow.IReceivableSourceBlock, System.Threading.Tasks.Dataflow.ISourceBlock, System.Threading.Tasks.Dataflow.ITargetBlock { @@ -267,14 +267,14 @@ public TransformBlock(System.Func transform, System.Threading.T public void Complete() { } public System.IDisposable LinkTo(System.Threading.Tasks.Dataflow.ITargetBlock target, System.Threading.Tasks.Dataflow.DataflowLinkOptions linkOptions) { throw null; } void System.Threading.Tasks.Dataflow.IDataflowBlock.Fault(System.Exception exception) { } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] TOutput System.Threading.Tasks.Dataflow.ISourceBlock.ConsumeMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target, out bool messageConsumed) { throw null; } void System.Threading.Tasks.Dataflow.ISourceBlock.ReleaseReservation(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target) { } bool System.Threading.Tasks.Dataflow.ISourceBlock.ReserveMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target) { throw null; } System.Threading.Tasks.Dataflow.DataflowMessageStatus System.Threading.Tasks.Dataflow.ITargetBlock.OfferMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, TInput messageValue, System.Threading.Tasks.Dataflow.ISourceBlock? source, bool consumeToAccept) { throw null; } public override string ToString() { throw null; } public bool TryReceive(System.Predicate? filter, [System.Diagnostics.CodeAnalysis.MaybeNullWhen(false)] out TOutput item) { throw null; } - public bool TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Collections.Generic.IList? items) { throw null; } + public bool TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Collections.Generic.IList? items) { throw null; } } public sealed partial class TransformManyBlock : System.Threading.Tasks.Dataflow.IDataflowBlock, System.Threading.Tasks.Dataflow.IPropagatorBlock, System.Threading.Tasks.Dataflow.IReceivableSourceBlock, System.Threading.Tasks.Dataflow.ISourceBlock, System.Threading.Tasks.Dataflow.ITargetBlock { @@ -288,14 +288,14 @@ public TransformManyBlock(System.Func target, System.Threading.Tasks.Dataflow.DataflowLinkOptions linkOptions) { throw null; } void System.Threading.Tasks.Dataflow.IDataflowBlock.Fault(System.Exception exception) { } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] TOutput System.Threading.Tasks.Dataflow.ISourceBlock.ConsumeMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target, out bool messageConsumed) { throw null; } void System.Threading.Tasks.Dataflow.ISourceBlock.ReleaseReservation(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target) { } bool System.Threading.Tasks.Dataflow.ISourceBlock.ReserveMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target) { throw null; } System.Threading.Tasks.Dataflow.DataflowMessageStatus System.Threading.Tasks.Dataflow.ITargetBlock.OfferMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, TInput messageValue, System.Threading.Tasks.Dataflow.ISourceBlock? source, bool consumeToAccept) { throw null; } public override string ToString() { throw null; } public bool TryReceive(System.Predicate? filter, [System.Diagnostics.CodeAnalysis.MaybeNullWhen(false)] out TOutput item) { throw null; } - public bool TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Collections.Generic.IList? items) { throw null; } + public bool TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Collections.Generic.IList? items) { throw null; } } public sealed partial class WriteOnceBlock : System.Threading.Tasks.Dataflow.IDataflowBlock, System.Threading.Tasks.Dataflow.IPropagatorBlock, System.Threading.Tasks.Dataflow.IReceivableSourceBlock, System.Threading.Tasks.Dataflow.ISourceBlock, System.Threading.Tasks.Dataflow.ITargetBlock { @@ -305,8 +305,8 @@ public WriteOnceBlock(System.Func? cloningFunction, System.Threading.Tasks public void Complete() { } public System.IDisposable LinkTo(System.Threading.Tasks.Dataflow.ITargetBlock target, System.Threading.Tasks.Dataflow.DataflowLinkOptions linkOptions) { throw null; } void System.Threading.Tasks.Dataflow.IDataflowBlock.Fault(System.Exception exception) { } - bool System.Threading.Tasks.Dataflow.IReceivableSourceBlock.TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Collections.Generic.IList? items) { throw null; } - [return: System.Diagnostics.CodeAnalysis.MaybeNull] + bool System.Threading.Tasks.Dataflow.IReceivableSourceBlock.TryReceiveAll([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Collections.Generic.IList? items) { throw null; } + [return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute] T System.Threading.Tasks.Dataflow.ISourceBlock.ConsumeMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target, out bool messageConsumed) { throw null; } void System.Threading.Tasks.Dataflow.ISourceBlock.ReleaseReservation(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target) { } bool System.Threading.Tasks.Dataflow.ISourceBlock.ReserveMessage(System.Threading.Tasks.Dataflow.DataflowMessageHeader messageHeader, System.Threading.Tasks.Dataflow.ITargetBlock target) { throw null; } diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/System.Threading.Tasks.Dataflow.csproj b/src/libraries/System.Threading.Tasks.Dataflow/src/System.Threading.Tasks.Dataflow.csproj index 2af9d7adad7f..9aefb2928ff4 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/System.Threading.Tasks.Dataflow.csproj +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/System.Threading.Tasks.Dataflow.csproj @@ -1,11 +1,12 @@ - netstandard2.0;netstandard1.0;netstandard1.1 + netstandard2.0;netstandard1.0;netstandard1.1;net461;$(NetFrameworkCurrent) + true enable - $(DefineConstants);FEATURE_TRACING + $(DefineConstants);FEATURE_TRACING $(DefineConstants);USE_INTERNAL_CONCURRENT_COLLECTIONS $(DefineConstants);USE_INTERNAL_THREADING netstandard1.1;portable-net45+win8+wpa81 @@ -78,4 +79,9 @@ + + + + + diff --git a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/DataflowBlockExtensionTests.cs b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/DataflowBlockExtensionTests.cs index 062bc7f10aa8..a28003d44325 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/DataflowBlockExtensionTests.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/DataflowBlockExtensionTests.cs @@ -1120,6 +1120,7 @@ public async Task TestReceiveAsync_ManyInOrder() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/38817", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))] [PlatformSpecific(~TestPlatforms.Browser)] // uses a lot of stack public async Task TestReceiveAsync_LongChain() { @@ -1921,6 +1922,7 @@ public async Task TestOutputAvailableAsync_DataAfterCompletion() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/38817", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))] [PlatformSpecific(~TestPlatforms.Browser)] // uses a lot of stack public async Task TestOutputAvailableAsync_LongSequence() { diff --git a/src/libraries/System.Threading.Thread/ref/System.Threading.Thread.cs b/src/libraries/System.Threading.Thread/ref/System.Threading.Thread.cs index a2ef24a9bcba..142afdea8ec2 100644 --- a/src/libraries/System.Threading.Thread/ref/System.Threading.Thread.cs +++ b/src/libraries/System.Threading.Thread/ref/System.Threading.Thread.cs @@ -78,6 +78,7 @@ public static void MemoryBarrier() { } public static void ResetAbort() { } [System.ObsoleteAttribute("Thread.Resume has been deprecated. Please use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources. https://go.microsoft.com/fwlink/?linkid=14202", false)] public void Resume() { } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public void SetApartmentState(System.Threading.ApartmentState state) { } [System.ObsoleteAttribute("Thread.SetCompressedStack is no longer supported. Please use the System.Threading.CompressedStack class")] public void SetCompressedStack(System.Threading.CompressedStack stack) { } diff --git a/src/libraries/System.Threading/ref/System.Threading.cs b/src/libraries/System.Threading/ref/System.Threading.cs index 314043b59709..d0f85e23252d 100644 --- a/src/libraries/System.Threading/ref/System.Threading.cs +++ b/src/libraries/System.Threading/ref/System.Threading.cs @@ -115,9 +115,11 @@ public partial class EventWaitHandle : System.Threading.WaitHandle public EventWaitHandle(bool initialState, System.Threading.EventResetMode mode) { } public EventWaitHandle(bool initialState, System.Threading.EventResetMode mode, string? name) { } public EventWaitHandle(bool initialState, System.Threading.EventResetMode mode, string? name, out bool createdNew) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static System.Threading.EventWaitHandle OpenExisting(string name) { throw null; } public bool Reset() { throw null; } public bool Set() { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static bool TryOpenExisting(string name, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Threading.EventWaitHandle? result) { throw null; } } public sealed partial class ExecutionContext : System.IDisposable, System.Runtime.Serialization.ISerializable @@ -151,23 +153,23 @@ public virtual void Revert(object previousState) { } public static partial class Interlocked { public static int Add(ref int location1, int value) { throw null; } - [System.CLSCompliant(false)] + [System.CLSCompliantAttribute(false)] public static uint Add(ref uint location1, uint value) { throw null; } public static long Add(ref long location1, long value) { throw null; } - [System.CLSCompliant(false)] + [System.CLSCompliantAttribute(false)] public static ulong Add(ref ulong location1, ulong value) { throw null; } public static int And(ref int location1, int value) { throw null; } - [System.CLSCompliant(false)] + [System.CLSCompliantAttribute(false)] public static uint And(ref uint location1, uint value) { throw null; } public static long And(ref long location1, long value) { throw null; } - [System.CLSCompliant(false)] + [System.CLSCompliantAttribute(false)] public static ulong And(ref ulong location1, ulong value) { throw null; } public static double CompareExchange(ref double location1, double value, double comparand) { throw null; } public static int CompareExchange(ref int location1, int value, int comparand) { throw null; } - [System.CLSCompliant(false)] + [System.CLSCompliantAttribute(false)] public static uint CompareExchange(ref uint location1, uint value, uint comparand) { throw null; } public static long CompareExchange(ref long location1, long value, long comparand) { throw null; } - [System.CLSCompliant(false)] + [System.CLSCompliantAttribute(false)] public static ulong CompareExchange(ref ulong location1, ulong value, ulong comparand) { throw null; } public static System.IntPtr CompareExchange(ref System.IntPtr location1, System.IntPtr value, System.IntPtr comparand) { throw null; } [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("location1")] @@ -176,17 +178,17 @@ public static partial class Interlocked [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("location1")] public static T CompareExchange(ref T location1, T value, T comparand) where T : class? { throw null; } public static int Decrement(ref int location) { throw null; } - [System.CLSCompliant(false)] + [System.CLSCompliantAttribute(false)] public static uint Decrement(ref uint location) { throw null; } public static long Decrement(ref long location) { throw null; } - [System.CLSCompliant(false)] + [System.CLSCompliantAttribute(false)] public static ulong Decrement(ref ulong location) { throw null; } public static double Exchange(ref double location1, double value) { throw null; } public static int Exchange(ref int location1, int value) { throw null; } - [System.CLSCompliant(false)] + [System.CLSCompliantAttribute(false)] public static uint Exchange(ref uint location1, uint value) { throw null; } public static long Exchange(ref long location1, long value) { throw null; } - [System.CLSCompliant(false)] + [System.CLSCompliantAttribute(false)] public static ulong Exchange(ref ulong location1, ulong value) { throw null; } public static System.IntPtr Exchange(ref System.IntPtr location1, System.IntPtr value) { throw null; } [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("location1")] @@ -195,21 +197,21 @@ public static partial class Interlocked [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("location1")] public static T Exchange([System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")] ref T location1, T value) where T : class? { throw null; } public static int Increment(ref int location) { throw null; } - [System.CLSCompliant(false)] + [System.CLSCompliantAttribute(false)] public static uint Increment(ref uint location) { throw null; } public static long Increment(ref long location) { throw null; } - [System.CLSCompliant(false)] + [System.CLSCompliantAttribute(false)] public static ulong Increment(ref ulong location) { throw null; } public static void MemoryBarrier() { } public static void MemoryBarrierProcessWide() { } public static int Or(ref int location1, int value) { throw null; } - [System.CLSCompliant(false)] + [System.CLSCompliantAttribute(false)] public static uint Or(ref uint location1, uint value) { throw null; } public static long Or(ref long location1, long value) { throw null; } - [System.CLSCompliant(false)] + [System.CLSCompliantAttribute(false)] public static ulong Or(ref ulong location1, ulong value) { throw null; } public static long Read(ref long location) { throw null; } - [System.CLSCompliant(false)] + [System.CLSCompliantAttribute(false)] public static ulong Read(ref ulong location) { throw null; } } public static partial class LazyInitializer @@ -348,9 +350,11 @@ public sealed partial class Semaphore : System.Threading.WaitHandle public Semaphore(int initialCount, int maximumCount) { } public Semaphore(int initialCount, int maximumCount, string? name) { } public Semaphore(int initialCount, int maximumCount, string? name, out bool createdNew) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static System.Threading.Semaphore OpenExisting(string name) { throw null; } public int Release() { throw null; } public int Release(int releaseCount) { throw null; } + [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] public static bool TryOpenExisting(string name, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Threading.Semaphore? result) { throw null; } } public partial class SemaphoreFullException : System.SystemException diff --git a/src/libraries/System.Utf8String.Experimental/pkg/System.Utf8String.Experimental.pkgproj b/src/libraries/System.Utf8String.Experimental/pkg/System.Utf8String.Experimental.pkgproj index 1577c85ef190..5de0422cf63b 100644 --- a/src/libraries/System.Utf8String.Experimental/pkg/System.Utf8String.Experimental.pkgproj +++ b/src/libraries/System.Utf8String.Experimental/pkg/System.Utf8String.Experimental.pkgproj @@ -2,10 +2,9 @@ - + net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks) - diff --git a/src/libraries/System.Utf8String.Experimental/ref/System.Utf8String.Experimental.cs b/src/libraries/System.Utf8String.Experimental/ref/System.Utf8String.Experimental.cs index c28e0545edb1..b37545e6f47a 100644 --- a/src/libraries/System.Utf8String.Experimental/ref/System.Utf8String.Experimental.cs +++ b/src/libraries/System.Utf8String.Experimental/ref/System.Utf8String.Experimental.cs @@ -257,7 +257,7 @@ public readonly struct SplitOnResult private readonly object _dummy; public System.Utf8String? After { get { throw null; } } public System.Utf8String Before { get { throw null; } } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public void Deconstruct(out System.Utf8String before, out System.Utf8String? after) { throw null; } } } diff --git a/src/libraries/System.Utf8String.Experimental/src/System.Utf8String.Experimental.csproj b/src/libraries/System.Utf8String.Experimental/src/System.Utf8String.Experimental.csproj index 5b84d79c116d..016238e9a83e 100644 --- a/src/libraries/System.Utf8String.Experimental/src/System.Utf8String.Experimental.csproj +++ b/src/libraries/System.Utf8String.Experimental/src/System.Utf8String.Experimental.csproj @@ -1,7 +1,8 @@ true - $(NetCoreAppCurrent);netstandard2.0;netstandard2.1;netcoreapp3.0 + $(NetCoreAppCurrent);netstandard2.0;netstandard2.1;netcoreapp3.0;net461;$(NetFrameworkCurrent) + true enable $(DefineContants);FEATURE_UTF8STRING @@ -10,13 +11,13 @@ $(NoWarn);CS3019;CS0162 - true + true - + - + - + @@ -142,4 +143,12 @@ + + + + + + + + diff --git a/src/libraries/System.Utf8String.Experimental/src/System/IO/Utf8StringStream.cs b/src/libraries/System.Utf8String.Experimental/src/System/IO/Utf8StringStream.cs index 02e854d47472..d448a7cc1b90 100644 --- a/src/libraries/System.Utf8String.Experimental/src/System/IO/Utf8StringStream.cs +++ b/src/libraries/System.Utf8String.Experimental/src/System/IO/Utf8StringStream.cs @@ -57,7 +57,7 @@ public override int Read(byte[] buffer, int offset, int count) } public -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) override #endif int Read(Span buffer) @@ -79,7 +79,7 @@ public override Task ReadAsync(byte[] buffer, int offset, int count, Cancel return Task.FromResult(Read(new Span(buffer, offset, count))); } -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) public override ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken = default) { return new ValueTask(Read(buffer.Span)); @@ -127,13 +127,13 @@ public override long Seek(long offset, SeekOrigin origin) public override void Write(byte[] buffer, int offset, int count) => throw new NotSupportedException(); -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) public override void Write(ReadOnlySpan buffer) => throw new NotSupportedException(); #endif public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => throw new NotSupportedException(); -#if !NETSTANDARD2_0 +#if (!NETSTANDARD2_0 && !NETFRAMEWORK) public override ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) => throw new NotSupportedException(); #endif public override void WriteByte(byte value) => throw new NotSupportedException(); diff --git a/src/libraries/System.Utf8String.Experimental/src/System/Net/Http/Utf8StringContent.cs b/src/libraries/System.Utf8String.Experimental/src/System/Net/Http/Utf8StringContent.cs index 3efd25fa2402..f5fc6a1f843b 100644 --- a/src/libraries/System.Utf8String.Experimental/src/System/Net/Http/Utf8StringContent.cs +++ b/src/libraries/System.Utf8String.Experimental/src/System/Net/Http/Utf8StringContent.cs @@ -41,7 +41,7 @@ public Utf8StringContent(Utf8String content, string? mediaType) protected override Task CreateContentReadStreamAsync() => Task.FromResult(new Utf8StringStream(_content)); -#if NETSTANDARD2_0 +#if (NETSTANDARD2_0 || NETFRAMEWORK) protected override async Task SerializeToStreamAsync(Stream stream, TransportContext? context) { ReadOnlyMemory buffer = _content.AsMemoryBytes(); diff --git a/src/libraries/System.Utf8String.Experimental/src/System/Runtime/Intrinsics/Intrinsics.Shims.cs b/src/libraries/System.Utf8String.Experimental/src/System/Runtime/Intrinsics/Intrinsics.Shims.cs index e5f9284769d6..c4c68e966eba 100644 --- a/src/libraries/System.Utf8String.Experimental/src/System/Runtime/Intrinsics/Intrinsics.Shims.cs +++ b/src/libraries/System.Utf8String.Experimental/src/System/Runtime/Intrinsics/Intrinsics.Shims.cs @@ -16,11 +16,14 @@ internal readonly struct Vector64 internal static class Vector128 { + public static Vector128 Create(long value) => throw new PlatformNotSupportedException(); public static Vector128 Create(short value) => throw new PlatformNotSupportedException(); + public static Vector128 Create(ulong value) => throw new PlatformNotSupportedException(); public static Vector128 Create(ushort value) => throw new PlatformNotSupportedException(); public static Vector128 CreateScalarUnsafe(ulong value) => throw new PlatformNotSupportedException(); public static Vector128 AsByte(this Vector128 vector) where T : struct => throw new PlatformNotSupportedException(); public static Vector128 AsInt16(this Vector128 vector) where T : struct => throw new PlatformNotSupportedException(); + public static Vector128 AsSByte(this Vector128 vector) where T : struct => throw new PlatformNotSupportedException(); public static Vector128 AsUInt16(this Vector128 vector) where T : struct => throw new PlatformNotSupportedException(); public static Vector128 AsUInt32(this Vector128 vector) where T : struct => throw new PlatformNotSupportedException(); public static Vector128 AsUInt64(this Vector128 vector) where T : struct => throw new PlatformNotSupportedException(); diff --git a/src/libraries/pkg/baseline/packageIndex.json b/src/libraries/pkg/baseline/packageIndex.json index 8952f21b1775..1446eaab3297 100644 --- a/src/libraries/pkg/baseline/packageIndex.json +++ b/src/libraries/pkg/baseline/packageIndex.json @@ -545,7 +545,8 @@ "3.1.2", "3.1.3", "3.1.4", - "3.1.5" + "3.1.5", + "3.1.6" ], "BaselineVersion": "5.0.0", "InboxOn": {}, @@ -553,6 +554,7 @@ "3.1.3.0": "3.1.3", "3.1.4.0": "3.1.4", "3.1.5.0": "3.1.5", + "3.1.6.0": "3.1.6", "5.0.0.0": "5.0.0" } }, @@ -1565,9 +1567,10 @@ "4.0.0", "4.3.0", "4.4.0", - "4.5.0" + "4.5.0", + "4.5.1" ], - "BaselineVersion": "4.5.0", + "BaselineVersion": "4.5.1", "InboxOn": { "netcoreapp2.0": "4.0.2.0", "netcoreapp2.1": "4.0.3.0", @@ -1687,7 +1690,9 @@ "1.3.2", "1.4.0", "1.5.0", - "1.6.0" + "1.6.0", + "1.7.0", + "1.7.1" ], "BaselineVersion": "5.0.0", "InboxOn": { @@ -3640,9 +3645,10 @@ "4.5.0", "4.5.1", "4.5.2", - "4.5.3" + "4.5.3", + "4.5.4" ], - "BaselineVersion": "4.5.3", + "BaselineVersion": "4.5.4", "InboxOn": { "netcoreapp2.1": "4.1.0.0", "netcoreapp3.0": "4.2.0.0", @@ -4495,13 +4501,16 @@ "4.4.0", "4.5.0", "4.5.1", - "4.6.0" + "4.6.0", + "4.7.0", + "4.7.1" ], - "BaselineVersion": "5.0.0", + "BaselineVersion": "4.7.1", "InboxOn": { "netcoreapp2.0": "4.0.3.0", "netcoreapp2.1": "4.0.4.0", "netcoreapp3.0": "4.0.5.0", + "netstandard2.1": "4.0.5.0", "net5.0": "5.0.0.0", "monoandroid10": "Any", "monotouch10": "Any", @@ -4518,7 +4527,7 @@ "4.0.3.0": "4.4.0", "4.0.4.0": "4.5.0", "4.0.5.0": "4.6.0", - "5.0.0.0": "5.0.0" + "4.0.6.0": "4.7.0" } }, "System.Reflection.Emit": { @@ -5551,12 +5560,11 @@ "4.3.0", "4.3.1" ], - "BaselineVersion": "4.3.0", + "BaselineVersion": "4.3.1", "InboxOn": { "netcoreapp2.0": "4.3.0.0", "netcoreapp2.1": "4.3.1.0", "net5.0": "5.0.0.0", - "net461": "4.2.0.0", "netstandard2.0": "4.2.0.0", "monoandroid10": "Any", "monotouch10": "Any", @@ -6505,9 +6513,10 @@ "4.5.0", "4.5.1", "4.5.2", - "4.5.3" + "4.5.3", + "4.5.4" ], - "BaselineVersion": "4.5.2", + "BaselineVersion": "4.5.4", "InboxOn": { "netcoreapp2.0": "4.1.1.0", "netcoreapp2.1": "4.3.0.0", diff --git a/src/libraries/pkg/descriptions.json b/src/libraries/pkg/descriptions.json index 18b006d7b790..3b04891e233a 100644 --- a/src/libraries/pkg/descriptions.json +++ b/src/libraries/pkg/descriptions.json @@ -1497,13 +1497,6 @@ "System.Reflection.Context.CustomReflectionContext" ] }, - { - "Name": "System.Reflection.DispatchProxy", - "Description": "Provides a class to dynamically create proxy types that implement a specified interface and derive from a specified DispatchProxy type. Method invocations on the generated proxyinstance are dispatched to that DispatchProxy base type.", - "CommonTypes": [ - "System.Reflection.DispatchProxy" - ] - }, { "Name": "System.Reflection.Emit", "Description": "Provides classes that allow a compiler or tool to emit metadata and optionally generate a PE file on disk. The primary clients of these classes are script engines and compilers.", diff --git a/src/libraries/pkg/test/frameworkSettings/net/settings.targets b/src/libraries/pkg/test/frameworkSettings/net/settings.targets index 7c3d7c543e83..e4e8ff23d685 100644 --- a/src/libraries/pkg/test/frameworkSettings/net/settings.targets +++ b/src/libraries/pkg/test/frameworkSettings/net/settings.targets @@ -1,8 +1,8 @@ - - + true true + true @@ -16,6 +16,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libraries/pkg/test/frameworkSettings/netcoreapp3.0/settings.targets b/src/libraries/pkg/test/frameworkSettings/netcoreapp3.0/settings.targets index 26049f49cd7a..1aa65488bec5 100644 --- a/src/libraries/pkg/test/frameworkSettings/netcoreapp3.0/settings.targets +++ b/src/libraries/pkg/test/frameworkSettings/netcoreapp3.0/settings.targets @@ -1,8 +1,5 @@ - - - diff --git a/src/libraries/pkg/test/packageSettings/Microsoft.XmlSerializer.Generator/net/disableNetstandardTest.targets b/src/libraries/pkg/test/packageSettings/Microsoft.XmlSerializer.Generator/net/disableNetstandardTest.targets new file mode 100644 index 000000000000..8b493f6d4b60 --- /dev/null +++ b/src/libraries/pkg/test/packageSettings/Microsoft.XmlSerializer.Generator/net/disableNetstandardTest.targets @@ -0,0 +1,7 @@ + + + + true + false + + \ No newline at end of file diff --git a/src/libraries/pkg/test/packageSettings/System.Utf8String.Experimental/net/DisableVerifyClosure.targets b/src/libraries/pkg/test/packageSettings/System.Utf8String.Experimental/net/DisableVerifyClosure.targets new file mode 100644 index 000000000000..a5776c439144 --- /dev/null +++ b/src/libraries/pkg/test/packageSettings/System.Utf8String.Experimental/net/DisableVerifyClosure.targets @@ -0,0 +1,7 @@ + + + + false + + \ No newline at end of file diff --git a/src/libraries/pkg/test/packageTest.targets b/src/libraries/pkg/test/packageTest.targets index 2196f4a0d496..4aa0b3ee83d3 100644 --- a/src/libraries/pkg/test/packageTest.targets +++ b/src/libraries/pkg/test/packageTest.targets @@ -69,7 +69,7 @@ + Condition="'$(ShouldVerifyClosure)' == 'true' and '$(RuntimeIdentifier)' != '' and '$(SkipVerifyClosureForRuntime)' != 'true'"> <_runClosureFileNames Include="@(ReferenceCopyLocalPaths->'%(FileName)')"> %(Identity) @@ -99,9 +99,16 @@ IgnoredTypes="@(IgnoredTypes)" /> + + + + <_testDependsOn> LogBeginTest; + VerifyNotDependsOnNetStandard; VerifyReferenceClosure; VerifyReferenceTypes; VerifyRuntimeClosure; diff --git a/src/libraries/pkg/test/test.msbuild b/src/libraries/pkg/test/test.msbuild index 60114db02ab3..6d0a6a47c6d1 100644 --- a/src/libraries/pkg/test/test.msbuild +++ b/src/libraries/pkg/test/test.msbuild @@ -1,6 +1,6 @@ - + @@ -11,8 +11,8 @@ - - + + diff --git a/src/libraries/pkg/test/testPackages.proj b/src/libraries/pkg/test/testPackages.proj index ea3cb98e3a7d..a624abf7878b 100644 --- a/src/libraries/pkg/test/testPackages.proj +++ b/src/libraries/pkg/test/testPackages.proj @@ -2,13 +2,13 @@ - + - - + + @@ -180,10 +180,10 @@ "$(TestDotNetPath)" $(TestRestoreCommand) restore $(TestRestoreCommand) --packages "$(TestPackageDir)" - $(TestRestoreCommand) /p:LocalPackagesPath=$(PackageOutputPath) + $(TestRestoreCommand) /p:LocalPackagesPath=$(ArtifactsPackagesDir) $(TestRestoreCommand) /nr:false $(TestRestoreCommand) /warnaserror - $(TestRestoreCommand) /p:TestPackages=$(TestPackages) + $(TestRestoreCommand) /p:PackagesToTest=$(PackagesToTest) @@ -200,7 +200,7 @@ $(TestBuildCommand) /t:Test $(TestBuildCommand) /nr:false $(TestBuildCommand) /warnaserror - $(TestBuildCommand) /p:TestPackages=$(TestPackages) + $(TestBuildCommand) /p:PackagesToTest=$(PackagesToTest) diff --git a/src/libraries/pretest.proj b/src/libraries/pretest.proj index 1ba9c7312464..23a4041ff30a 100644 --- a/src/libraries/pretest.proj +++ b/src/libraries/pretest.proj @@ -87,11 +87,9 @@ <_refPackLibFile Include="$(MicrosoftNetCoreAppRefPackRefDir)*.*"> ref/$(NetCoreAppCurrent) - true <_runtimePackLibFiles Include="$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)*.*"> runtimes/$(PackageRID)/lib/$(NetCoreAppCurrent) - true <_runtimePackNativeFiles Include="$(MicrosoftNetCoreAppRuntimePackNativeDir)*.*"> runtimes/$(PackageRID)/native @@ -106,6 +104,20 @@ + + + <_refPackLibFile> + true + + <_runtimePackLibFiles> + true + + <_runtimePackNativeFiles> + true + + + true - $(TestArchiveRuntimeRoot)test-runtime-$(BuildSettings).zip - $(TestArchiveRuntimeRoot)packages-testPayload-$(Configuration).zip + $(TestArchiveRuntimeRoot)test-runtime-$(BuildSettings).zip + $(TestArchiveRuntimeRoot)packages-testPayload-$(Configuration).zip @@ -144,7 +144,7 @@ + Condition="'$(TestPackages)' != 'true' and '$(TargetsMobile)' != 'true'"> diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index 8bfdd662a9f2..f5b2ab2489aa 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -34,7 +34,7 @@ - true + true @@ -56,7 +56,7 @@ $(WaitForWorkItemCompletion) - + true sdk @@ -70,20 +70,20 @@ innerloop test/functional/cli/$(TestScope)/ - test/functional/packaging/ + test/functional/packaging/ true - + - + dotnet msbuild %HELIX_CORRELATION_PAYLOAD%\test.msbuild $(HelixCommand) /warnaserror $(HelixCommand) /p:PackageTestProjectsDir=%HELIX_WORKITEM_PAYLOAD% @@ -91,7 +91,7 @@ $(HelixCommand) /p:LocalPackagesPath="%HELIX_CORRELATION_PAYLOAD%\packages\" - + @@ -183,7 +183,7 @@ - - + + diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 29a5714bb803..b11eb01f25d8 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -8,8 +8,8 @@ $(ArtifactsBinDir)\*.Tests\**\coverage.opencover.xml $(ArtifactsDir)coverage true - true + false false @@ -22,83 +22,51 @@ - - - - - - - + + + - - - - - + - - - + - - - - - + - - - - - - - - - - - - - - - - - - + + Condition="'$(TestAssemblies)' == 'true'" /> - - - + Condition="'$(TestPackages)' == 'true'" /> + Exclude="@(ProjectExclusions)" + Condition="'$(TestTrimming)' == 'true'" /> + DependsOnTargets="GenerateCoverageReport" + Condition="'$(TestAssemblies)' == 'true' and + '$(Coverage)' == 'true'" /> diff --git a/src/mono/cmake/config.h.in b/src/mono/cmake/config.h.in index e89b59c5f710..8f013c5f0c67 100644 --- a/src/mono/cmake/config.h.in +++ b/src/mono/cmake/config.h.in @@ -210,6 +210,9 @@ /* Use static zlib */ #cmakedefine HAVE_STATIC_ZLIB 1 +/* Use static ICU */ +#cmakedefine STATIC_ICU 1 + /* Use OS-provided zlib */ #cmakedefine HAVE_SYS_ZLIB 1 diff --git a/src/mono/configure.ac b/src/mono/configure.ac index 38f76cca8564..1b95d75f1323 100644 --- a/src/mono/configure.ac +++ b/src/mono/configure.ac @@ -950,16 +950,6 @@ if test x$with_core = xonly; then fi AM_CONDITIONAL(ENABLE_NETCORE, test x$with_core = xonly) -if test x$with_core = xonly; then - if test -f $srcdir/mono/eventpipe/ep.h; then - enable_perftracing=yes - fi - if test x$enable_perftracing = xyes; then - AC_DEFINE(ENABLE_PERFTRACING,1,[Enables support for eventpipe library]) - fi -fi -AM_CONDITIONAL(ENABLE_PERFTRACING, test x$enable_perftracing = xyes) - # # A sanity check to catch cases where the package was unpacked # with an ancient tar program (Solaris) @@ -1312,6 +1302,12 @@ AC_ARG_WITH(spectre-mitigation, [ --with-spectre-mitigation=yes,no AC_ARG_WITH(spectre-indirect-branch-choice, [ --with-spectre-indirect-branch-choice=keep,thunk,inline,extern Convert indirect branches to the specified kind of thunk (defaults to inline)], [], [with_spectre_indirect_branch_choice=inline]) AC_ARG_WITH(spectre-function-return-choice, [ --with-spectre-function-return-choice=keep,thunk,inline,extern Convert function return instructions to the specified kind of thunk (defaults to inline)], [], [with_spectre_function_return_choice=inline]) +AC_ARG_WITH(static_icu, [ --with-static-icu=yes|no Integrate ICU statically into the runtime (defaults to no)],[ + if test x$with_static_icu = xyes ; then + AC_DEFINE(STATIC_ICU,1,[Integrate ICU statically into the runtime.]) + fi +], [with_static_icu=no]) + dnl dnl Spectre compiler mitigation flag checks dnl @@ -1700,6 +1696,7 @@ AM_CONDITIONAL(INSTALL_MONOTOUCH, [test "x$with_monotouch" != "xno"]) AM_CONDITIONAL(INSTALL_MONOTOUCH_WATCH, [test "x$with_monotouch_watch" != "xno"]) AM_CONDITIONAL(INSTALL_MONOTOUCH_TV, [test "x$with_monotouch_tv" != "xno"]) AM_CONDITIONAL(BITCODE, test "x$with_bitcode" = "xyes") +AM_CONDITIONAL(STATIC_ICU, test "x$with_static_icu" = "xyes") AM_CONDITIONAL(INSTALL_XAMMAC, [test "x$with_xammac" != "xno"]) AM_CONDITIONAL(INSTALL_TESTING_AOT_FULL_INTERP, [test "x$with_testing_aot_full_interp" != "xno"]) AM_CONDITIONAL(INSTALL_TESTING_AOT_HYBRID, [test "x$with_testing_aot_hybrid" != "xno"]) @@ -1788,7 +1785,7 @@ AM_CONDITIONAL(ENABLE_STATIC_GCC_LIBS, test "x$enable_static_gcc_libs" = "xyes") AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems. LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, appdomains, verifier, dllmap, reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, interpreter, simd, soft_debug, perfcounters, normalization, desktop_loader, shared_perfcounters, remoting, - security, lldb, mdb, assert_messages, config, cfgdir_config, cleanup, sgen_marksweep_conc, sgen_split_nursery, sgen_gc_bridge, sgen_debug_helpers, sockets, gac, threads, processes.], + security, lldb, mdb, assert_messages, config, cfgdir_config, cleanup, sgen_marksweep_conc, sgen_split_nursery, sgen_gc_bridge, sgen_debug_helpers, sockets, gac, threads, processes, eventpipe.], [ for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do eval "mono_feature_disable_$feature='yes'" @@ -1984,7 +1981,6 @@ if test "x$mono_feature_disable_sgen_marksweep_conc" = "xyes"; then AC_MSG_NOTICE([Disabled concurrent gc support in SGEN.]) fi - if test "x$mono_feature_disable_sgen_split_nursery" = "xyes"; then AC_DEFINE(DISABLE_SGEN_SPLIT_NURSERY, 1, [Disable minor=split support in SGEN.]) AC_MSG_NOTICE([Disabled minor=split support in SGEN.]) @@ -2025,6 +2021,22 @@ if test "x$mono_feature_disable_processes" = "xyes"; then AC_MSG_NOTICE([Disabled process support]) fi +if test "x$mono_feature_disable_eventpipe" = "xyes"; then + AC_DEFINE(DISABLE_EVENTPIPE, 1, [Disable EventPipe support]) + AC_MSG_NOTICE([Disabled EventPipe support]) + enable_perftracing=no +fi + +if test x$enable_perftracing = x -a x$with_core = xonly; then + if test -f $srcdir/mono/eventpipe/ep.h; then + enable_perftracing=yes + fi +fi +if test x$enable_perftracing = xyes; then + AC_DEFINE(ENABLE_PERFTRACING,1,[Enables support for eventpipe library]) +fi +AM_CONDITIONAL(ENABLE_PERFTRACING, test x$enable_perftracing = xyes) + AC_ARG_ENABLE(executables, [ --disable-executables disable the build of the runtime executables], enable_executables=$enableval, enable_executables=yes) AM_CONDITIONAL(DISABLE_EXECUTABLES, test x$enable_executables = xno) @@ -6768,8 +6780,10 @@ AC_SUBST(MONO_NATIVE_PLATFORM_TYPE_UNIFIED) # if test "x$enable_llvm_runtime" = "xyes"; then AC_SUBST(MONO_CXXLD, [$CXX]) + AC_SUBST(MONO_LIBTOOL_TAG, '--tag=CXX') else AC_SUBST(MONO_CXXLD, [$CC]) + AC_SUBST(MONO_LIBTOOL_TAG, '') fi ### Set -Werror options @@ -6840,7 +6854,10 @@ if test x$with_core = xonly; then fi if test x$have_shim_globalization = xyes || test x$cross_compiling = xyes; then ICU_SHIM_PATH=../../../libraries/Native/Unix/System.Globalization.Native - if test x$target_osx = xyes; then + if test x$target_wasm = xyes && test x$with_static_icu = xyes; then + ICU_CFLAGS="-DTARGET_UNIX -DU_DISABLE_RENAMING" + have_sys_icu=yes + elif test x$target_osx = xyes; then ORIG_CPPFLAGS=$CPPFLAGS # adding icu path to pkg_config_path PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig diff --git a/src/mono/mono.proj b/src/mono/mono.proj index d3290b58a7f9..08c5c1e70c5a 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -643,7 +643,8 @@ <_MonoConfigureParams Include="--disable-icall-tables"/> <_MonoConfigureParams Include="--disable-crash-reporting"/> <_MonoConfigureParams Include="--with-bitcode=yes"/> - <_MonoConfigureParams Include="--enable-minimal=ssa,com,jit,reflection_emit_save,portability,assembly_remapping,attach,verifier,full_messages,appdomains,shadowcopy,security,sgen_marksweep_conc,sgen_split_nursery,sgen_gc_bridge,logging,remoting,shared_perfcounters,sgen_debug_helpers,soft_debug,interpreter,assert_messages,cleanup,mdb,gac,threads,$(_MonoEnableMinimal)"/> + <_MonoConfigureParams Include="--with-static-icu=yes"/> + <_MonoConfigureParams Include="--enable-minimal=ssa,com,jit,reflection_emit_save,portability,assembly_remapping,attach,verifier,full_messages,appdomains,shadowcopy,security,sgen_marksweep_conc,sgen_split_nursery,sgen_gc_bridge,logging,remoting,shared_perfcounters,sgen_debug_helpers,soft_debug,interpreter,assert_messages,cleanup,mdb,gac,threads,eventpipe,$(_MonoEnableMinimal)"/> <_MonoCFLAGS Include="-fexceptions" /> <_MonoCFLAGS Include="-I$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)/runtimes/browser-wasm/native/include" /> <_MonoCXXFLAGS Include="-fexceptions" /> diff --git a/src/mono/mono/eventpipe/ep-config-internals.h b/src/mono/mono/eventpipe/ep-config-internals.h index f9a10077d677..672051148c16 100644 --- a/src/mono/mono/eventpipe/ep-config-internals.h +++ b/src/mono/mono/eventpipe/ep-config-internals.h @@ -30,6 +30,7 @@ config_create_provider ( EventPipeConfiguration *config, const ep_char8_t *provider_name, EventPipeCallback callback_func, + EventPipeCallbackDataFree callback_data_free_func, void *callback_data, EventPipeProviderCallbackDataQueue *provider_callback_data_queue); diff --git a/src/mono/mono/eventpipe/ep-config.c b/src/mono/mono/eventpipe/ep-config.c index fff638c0035c..d649317418ef 100644 --- a/src/mono/mono/eventpipe/ep-config.c +++ b/src/mono/mono/eventpipe/ep-config.c @@ -168,7 +168,7 @@ ep_config_init (EventPipeConfiguration *config) ep_requires_lock_not_held (); - config->config_provider = ep_create_provider (ep_config_get_default_provider_name_utf8 (), NULL, NULL); + config->config_provider = ep_create_provider (ep_config_get_default_provider_name_utf8 (), NULL, NULL, NULL); ep_raise_error_if_nok (config->config_provider != NULL); // Create the metadata event. @@ -225,6 +225,7 @@ ep_config_create_provider ( EventPipeConfiguration *config, const ep_char8_t *provider_name, EventPipeCallback callback_func, + EventPipeCallbackDataFree callback_data_free_func, void *callback_data, EventPipeProviderCallbackDataQueue *provider_callback_data_queue) { @@ -235,7 +236,7 @@ ep_config_create_provider ( EventPipeProvider *provider = NULL; EP_LOCK_ENTER (section1) - provider = config_create_provider (config, provider_name, callback_func, callback_data, provider_callback_data_queue); + provider = config_create_provider (config, provider_name, callback_func, callback_data_free_func, callback_data, provider_callback_data_queue); ep_raise_error_if_nok_holding_lock (provider != NULL, section1); EP_LOCK_EXIT (section1) @@ -448,6 +449,7 @@ config_create_provider ( EventPipeConfiguration *config, const ep_char8_t *provider_name, EventPipeCallback callback_func, + EventPipeCallbackDataFree callback_data_free_func, void *callback_data, EventPipeProviderCallbackDataQueue *provider_callback_data_queue) { @@ -456,7 +458,7 @@ config_create_provider ( ep_requires_lock_held (); - EventPipeProvider *provider = ep_provider_alloc (config, provider_name, callback_func, callback_data); + EventPipeProvider *provider = ep_provider_alloc (config, provider_name, callback_func, callback_data_free_func, callback_data); ep_raise_error_if_nok (provider != NULL); ep_raise_error_if_nok (config_register_provider (config, provider, provider_callback_data_queue) == true); diff --git a/src/mono/mono/eventpipe/ep-config.h b/src/mono/mono/eventpipe/ep-config.h index 5a70e1ae72f1..7a7fc89f5c01 100644 --- a/src/mono/mono/eventpipe/ep-config.h +++ b/src/mono/mono/eventpipe/ep-config.h @@ -80,6 +80,7 @@ ep_config_create_provider ( EventPipeConfiguration *config, const ep_char8_t *provider_name, EventPipeCallback callback_func, + EventPipeCallbackDataFree callback_data_free_func, void *callback_data, EventPipeProviderCallbackDataQueue *provider_callback_data_queue); diff --git a/src/mono/mono/eventpipe/ep-event-source.c b/src/mono/mono/eventpipe/ep-event-source.c index 1ef5a8ad01eb..e4fd95df9bc1 100644 --- a/src/mono/mono/eventpipe/ep-event-source.c +++ b/src/mono/mono/eventpipe/ep-event-source.c @@ -91,7 +91,7 @@ ep_event_source_init (EventPipeEventSource *event_source) EP_ASSERT (event_source != NULL); - event_source->provider = ep_create_provider (ep_provider_get_default_name_utf8 (), NULL, NULL); + event_source->provider = ep_create_provider (ep_provider_get_default_name_utf8 (), NULL, NULL, NULL); ep_raise_error_if_nok (event_source->provider != NULL); event_source->provider_name = ep_provider_get_default_name_utf8 (); diff --git a/src/mono/mono/eventpipe/ep-provider.c b/src/mono/mono/eventpipe/ep-provider.c index e299d99d61b9..819c414da416 100644 --- a/src/mono/mono/eventpipe/ep-provider.c +++ b/src/mono/mono/eventpipe/ep-provider.c @@ -168,6 +168,7 @@ ep_provider_alloc ( EventPipeConfiguration *config, const ep_char8_t *provider_name, EventPipeCallback callback_func, + EventPipeCallbackDataFree callback_data_free_func, void *callback_data) { EP_ASSERT (config != NULL); @@ -185,6 +186,7 @@ ep_provider_alloc ( instance->keywords = 0; instance->provider_level = EP_EVENT_LEVEL_CRITICAL; instance->callback_func = callback_func; + instance->callback_data_free_func = callback_data_free_func; instance->callback_data = callback_data; instance->config = config; instance->delete_deferred = false; @@ -204,6 +206,9 @@ ep_provider_free (EventPipeProvider * provider) { ep_return_void_if_nok (provider != NULL); + if (provider->callback_data_free_func) + provider->callback_data_free_func (provider->callback_func, provider->callback_data); + ep_rt_event_list_free (&provider->event_list, event_free_func); ep_rt_utf16_string_free (provider->provider_name_utf16); ep_rt_utf8_string_free (provider->provider_name); diff --git a/src/mono/mono/eventpipe/ep-provider.h b/src/mono/mono/eventpipe/ep-provider.h index b42984204b94..059e84e6cc75 100644 --- a/src/mono/mono/eventpipe/ep-provider.h +++ b/src/mono/mono/eventpipe/ep-provider.h @@ -32,8 +32,10 @@ struct _EventPipeProvider_Internal { // List of every event currently associated with the provider. // New events can be added on-the-fly. ep_rt_event_list_t event_list; - // The optional provider callback. + // The optional provider callback function. EventPipeCallback callback_func; + // The optional provider callback_data free callback function. + EventPipeCallbackDataFree callback_data_free_func; // The optional provider callback data pointer. void *callback_data; // The configuration object. @@ -96,6 +98,7 @@ ep_provider_alloc ( EventPipeConfiguration *config, const ep_char8_t *provider_name, EventPipeCallback callback_func, + EventPipeCallbackDataFree callback_data_free_func, void *callback_data); void diff --git a/src/mono/mono/eventpipe/ep-types.h b/src/mono/mono/eventpipe/ep-types.h index 6f56bd84ce1f..ed4570d60f27 100644 --- a/src/mono/mono/eventpipe/ep-types.h +++ b/src/mono/mono/eventpipe/ep-types.h @@ -177,7 +177,11 @@ typedef void (*EventPipeCallback)( uint64_t match_any_keywords, uint64_t match_all_keywords, EventFilterDescriptor *filter_data, - void *callback_context); + void *callback_data); + +typedef void (*EventPipeCallbackDataFree)( + EventPipeCallback callback, + void *callback_data); /* * EventFilterDescriptor. diff --git a/src/mono/mono/eventpipe/ep.c b/src/mono/mono/eventpipe/ep.c index 96a849ddb128..d95010db0615 100644 --- a/src/mono/mono/eventpipe/ep.c +++ b/src/mono/mono/eventpipe/ep.c @@ -1073,6 +1073,7 @@ EventPipeProvider * ep_create_provider ( const ep_char8_t *provider_name, EventPipeCallback callback_func, + EventPipeCallbackDataFree callback_data_free_func, void *callback_data) { ep_return_null_if_nok (provider_name != NULL); @@ -1085,7 +1086,7 @@ ep_create_provider ( EventPipeProviderCallbackDataQueue *provider_callback_data_queue = ep_provider_callback_data_queue_init (&data_queue); EP_LOCK_ENTER (section1) - provider = config_create_provider (ep_config_get (), provider_name, callback_func, callback_data, provider_callback_data_queue); + provider = config_create_provider (ep_config_get (), provider_name, callback_func, callback_data_free_func, callback_data, provider_callback_data_queue); ep_raise_error_if_nok_holding_lock (provider != NULL, section1); EP_LOCK_EXIT (section1) diff --git a/src/mono/mono/eventpipe/ep.h b/src/mono/mono/eventpipe/ep.h index 723e1eba9d73..6f9b2cb71b40 100644 --- a/src/mono/mono/eventpipe/ep.h +++ b/src/mono/mono/eventpipe/ep.h @@ -211,6 +211,7 @@ EventPipeProvider * ep_create_provider ( const ep_char8_t *provider_name, EventPipeCallback callback_func, + EventPipeCallbackDataFree callback_data_free_func, void *callback_data); void diff --git a/src/mono/mono/eventpipe/test/ep-buffer-manager-tests.c b/src/mono/mono/eventpipe/test/ep-buffer-manager-tests.c index 9f268b45cc72..f1bd7c24c43c 100644 --- a/src/mono/mono/eventpipe/test/ep-buffer-manager-tests.c +++ b/src/mono/mono/eventpipe/test/ep-buffer-manager-tests.c @@ -110,7 +110,7 @@ buffer_manager_init ( test_location = 3; - *provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL); + *provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL, NULL); ep_raise_error_if_nok (*provider != NULL); test_location = 4; diff --git a/src/mono/mono/eventpipe/test/ep-buffer-tests.c b/src/mono/mono/eventpipe/test/ep-buffer-tests.c index 726ccce36be3..4d1dd3ebb3ec 100644 --- a/src/mono/mono/eventpipe/test/ep-buffer-tests.c +++ b/src/mono/mono/eventpipe/test/ep-buffer-tests.c @@ -93,7 +93,7 @@ load_buffer_with_events_init ( test_location = 2; - *provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL); + *provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL, NULL); ep_raise_error_if_nok (*provider != NULL); test_location = 3; diff --git a/src/mono/mono/eventpipe/test/ep-fastserializer-tests.c b/src/mono/mono/eventpipe/test/ep-fastserializer-tests.c index 0762c0700b27..36153f664d37 100644 --- a/src/mono/mono/eventpipe/test/ep-fastserializer-tests.c +++ b/src/mono/mono/eventpipe/test/ep-fastserializer-tests.c @@ -76,7 +76,7 @@ test_fast_serializer_object_fast_serialize (void) test_location = 2; - provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL); + provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL, NULL); ep_raise_error_if_nok (provider != NULL); test_location = 3; diff --git a/src/mono/mono/eventpipe/test/ep-file-tests.c b/src/mono/mono/eventpipe/test/ep-file-tests.c index b3062fae641a..f04fd685ba1f 100644 --- a/src/mono/mono/eventpipe/test/ep-file-tests.c +++ b/src/mono/mono/eventpipe/test/ep-file-tests.c @@ -79,7 +79,7 @@ test_file_write_event (EventPipeSerializationFormat format, bool write_event, bo test_location = 2; if (write_event) { - provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL); + provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL, NULL); ep_raise_error_if_nok (provider != NULL); test_location = 3; diff --git a/src/mono/mono/eventpipe/test/ep-tests.c b/src/mono/mono/eventpipe/test/ep-tests.c index 08f52e2b7c20..3aeeb65ed698 100644 --- a/src/mono/mono/eventpipe/test/ep-tests.c +++ b/src/mono/mono/eventpipe/test/ep-tests.c @@ -33,7 +33,7 @@ test_create_delete_provider (void) RESULT result = NULL; uint32_t test_location = 0; - EventPipeProvider *test_provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL); + EventPipeProvider *test_provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL, NULL); if (!test_provider) { result = FAILED ("Failed to create provider %s, ep_create_provider returned NULL", TEST_PROVIDER_NAME); ep_raise_error (); @@ -59,7 +59,7 @@ test_stress_create_delete_provider (void) for (uint32_t i = 0; i < 1000; ++i) { char *provider_name = g_strdup_printf (TEST_PROVIDER_NAME "_%i", i); - test_providers [i] = ep_create_provider (provider_name, NULL, NULL); + test_providers [i] = ep_create_provider (provider_name, NULL, NULL, NULL); g_free (provider_name); if (!test_providers [i]) { @@ -87,7 +87,7 @@ test_get_provider (void) RESULT result = NULL; uint32_t test_location = 0; - EventPipeProvider *test_provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL); + EventPipeProvider *test_provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL, NULL); if (!test_provider) { result = FAILED ("Failed to create provider %s, ep_create_provider returned NULL", TEST_PROVIDER_NAME); ep_raise_error (); @@ -128,7 +128,7 @@ test_create_same_provider_twice (void) RESULT result = NULL; uint32_t test_location = 0; - EventPipeProvider *test_provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL); + EventPipeProvider *test_provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL, NULL); if (!test_provider) { result = FAILED ("Failed to create provider %s, ep_create_provider returned NULL", TEST_PROVIDER_NAME); ep_raise_error (); @@ -144,7 +144,7 @@ test_create_same_provider_twice (void) test_location = 2; - EventPipeProvider *test_provider2 = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL); + EventPipeProvider *test_provider2 = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL, NULL); if (test_provider2) { result = FAILED ("Creating an already existing provider %s, succeeded", TEST_PROVIDER_NAME); ep_raise_error (); @@ -523,7 +523,7 @@ test_create_delete_provider_with_callback (void) ep_start_streaming (session_id); - test_provider = ep_create_provider (TEST_PROVIDER_NAME, provider_callback, &provider_callback_data); + test_provider = ep_create_provider (TEST_PROVIDER_NAME, provider_callback, NULL, &provider_callback_data); ep_raise_error_if_nok (test_provider != NULL); test_location = 3; @@ -556,7 +556,7 @@ test_build_event_metadata (void) EventPipeEventInstance *ep_event_instance = NULL; EventPipeEventMetadataEvent *metadata_event = NULL; - provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL); + provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL, NULL); ep_raise_error_if_nok (provider != NULL); test_location = 1; @@ -652,7 +652,7 @@ test_session_write_event (void) test_location = 1; - provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL); + provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL, NULL); ep_raise_error_if_nok (provider != NULL); test_location = 2; @@ -705,7 +705,7 @@ test_session_write_event_seq_point (void) test_location = 1; - provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL); + provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL, NULL); ep_raise_error_if_nok (provider != NULL); test_location = 2; @@ -762,7 +762,7 @@ test_session_write_wait_get_next_event (void) test_location = 1; - provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL); + provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL, NULL); ep_raise_error_if_nok (provider != NULL); test_location = 2; @@ -827,7 +827,7 @@ test_session_write_get_next_event (void) test_location = 1; - provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL); + provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL, NULL); ep_raise_error_if_nok (provider != NULL); test_location = 2; @@ -904,7 +904,7 @@ test_session_write_suspend_event (void) test_location = 1; - provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL); + provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL, NULL); ep_raise_error_if_nok (provider != NULL); test_location = 2; @@ -966,7 +966,7 @@ test_write_event (void) test_location = 1; - provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL); + provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL, NULL); ep_raise_error_if_nok (provider != NULL); test_location = 2; @@ -1017,7 +1017,7 @@ test_write_get_next_event (void) test_location = 1; - provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL); + provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL, NULL); ep_raise_error_if_nok (provider != NULL); test_location = 2; @@ -1076,7 +1076,7 @@ test_write_wait_get_next_event (void) test_location = 1; - provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL); + provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL, NULL); ep_raise_error_if_nok (provider != NULL); test_location = 2; @@ -1153,7 +1153,7 @@ test_write_event_perf (void) test_location = 1; - provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL); + provider = ep_create_provider (TEST_PROVIDER_NAME, NULL, NULL, NULL); ep_raise_error_if_nok (provider != NULL); test_location = 2; diff --git a/src/mono/mono/metadata/Makefile.am b/src/mono/mono/metadata/Makefile.am index 8e6f520077df..06abdd51ab2b 100644 --- a/src/mono/mono/metadata/Makefile.am +++ b/src/mono/mono/metadata/Makefile.am @@ -154,12 +154,18 @@ nodist_libmonoruntime_shimglobalization_la_SOURCES = \ @ICU_SHIM_PATH@/pal_localeStringData.c \ @ICU_SHIM_PATH@/pal_normalization.c \ @ICU_SHIM_PATH@/pal_timeZoneInfo.c \ - @ICU_SHIM_PATH@/pal_icushim.c \ @ICU_SHIM_PATH@/entrypoints.c libmonoruntime_shimglobalization_la_CFLAGS = @ICU_CFLAGS@ -I$(top_srcdir)/../libraries/Native/Unix/System.Globalization.Native/ -I$(top_srcdir)/../libraries/Native/Unix/Common/ -endif -endif + +if STATIC_ICU +nodist_libmonoruntime_shimglobalization_la_SOURCES += @ICU_SHIM_PATH@/pal_icushim_static.c +else +nodist_libmonoruntime_shimglobalization_la_SOURCES += @ICU_SHIM_PATH@/pal_icushim.c +endif # STATIC_ICU + +endif # HAVE_SYS_ICU +endif # ENABLE_NETCORE if !ENABLE_NETCORE culture_libraries = ../culture/libmono-culture.la @@ -498,7 +504,7 @@ libmonoruntimeinclude_HEADERS = \ sgen-bridge.h \ threads.h \ tokentype.h \ - verify.h + verify.h if !ENABLE_MSVC_ONLY diff --git a/src/mono/mono/metadata/class-init.c b/src/mono/mono/metadata/class-init.c index 13d682a68457..69a4e1014d59 100644 --- a/src/mono/mono/metadata/class-init.c +++ b/src/mono/mono/metadata/class-init.c @@ -1008,8 +1008,6 @@ mono_class_create_bounded_array (MonoClass *eclass, guint32 rank, gboolean bound char *name; MonoImageSet* image_set; - g_assert (rank <= 255); - if (rank > 1) /* bounded only matters for one-dimensional arrays */ bounded = FALSE; @@ -1077,15 +1075,16 @@ mono_class_create_bounded_array (MonoClass *eclass, guint32 rank, gboolean bound klass->class_kind = MONO_CLASS_ARRAY; nsize = strlen (eclass->name); - name = (char *)g_malloc (nsize + 2 + rank + 1); + int maxrank = MIN (rank, 32); + name = (char *)g_malloc (nsize + 2 + maxrank + 1); memcpy (name, eclass->name, nsize); name [nsize] = '['; - if (rank > 1) - memset (name + nsize + 1, ',', rank - 1); + if (maxrank > 1) + memset (name + nsize + 1, ',', maxrank - 1); if (bounded) - name [nsize + rank] = '*'; - name [nsize + rank + bounded] = ']'; - name [nsize + rank + bounded + 1] = 0; + name [nsize + maxrank] = '*'; + name [nsize + maxrank + bounded] = ']'; + name [nsize + maxrank + bounded + 1] = 0; klass->name = image_set ? mono_image_set_strdup (image_set, name) : mono_image_strdup (image, name); g_free (name); diff --git a/src/mono/mono/metadata/class.c b/src/mono/mono/metadata/class.c index 766876bb0e6a..bfd02a8eb736 100644 --- a/src/mono/mono/metadata/class.c +++ b/src/mono/mono/metadata/class.c @@ -372,8 +372,12 @@ mono_type_get_name_recurse (MonoType *type, GString *str, gboolean is_recursed, g_string_append_c (str, '['); if (rank == 1) g_string_append_c (str, '*'); - for (i = 1; i < rank; i++) - g_string_append_c (str, ','); + else if (rank > 64) + // Only taken in an error path, runtime will not load arrays of more than 32 dimensions + g_string_append_printf (str, "%d", rank); + else + for (i = 1; i < rank; i++) + g_string_append_c (str, ','); g_string_append_c (str, ']'); mono_type_name_check_byref (type, str); diff --git a/src/mono/mono/metadata/exception.h b/src/mono/mono/metadata/exception.h index 721dd493ae04..155c23c7e774 100644 --- a/src/mono/mono/metadata/exception.h +++ b/src/mono/mono/metadata/exception.h @@ -106,8 +106,7 @@ mono_get_exception_argument_null (const char *arg); MONO_API MonoException * mono_get_exception_argument (const char *arg, const char *msg); -MONO_API MONO_RT_EXTERNAL_ONLY -MonoException * +MONO_API MonoException * mono_get_exception_argument_out_of_range (const char *arg); MONO_API MONO_RT_EXTERNAL_ONLY diff --git a/src/mono/mono/metadata/icall-eventpipe.c b/src/mono/mono/metadata/icall-eventpipe.c index 66c6eb12e6f2..4222ffb72e80 100644 --- a/src/mono/mono/metadata/icall-eventpipe.c +++ b/src/mono/mono/metadata/icall-eventpipe.c @@ -5,7 +5,7 @@ #ifdef ENABLE_NETCORE #include -#ifdef ENABLE_PERFTRACING +#if defined(ENABLE_PERFTRACING) && !defined(DISABLE_EVENTPIPE) #include #include #include @@ -172,6 +172,16 @@ mono_eventpipe_fini (void) ep_rt_mono_initialized = FALSE; } +static +void +delegate_callback_data_free_func ( + EventPipeCallback callback_func, + void *callback_data) +{ + if (callback_data) + mono_gchandle_free_internal ((MonoGCHandle)callback_data); +} + static void delegate_callback_func ( @@ -193,7 +203,8 @@ delegate_callback_func ( EVENT_FILTER_DESCRIPTOR* filterData, void* callbackContext);*/ - MonoObject *delegate_object = (MonoObject *)callback_context; + MonoGCHandle delegate_object_handle = (MonoGCHandle)callback_context; + MonoObject *delegate_object = delegate_object_handle ? mono_gchandle_get_target_internal (delegate_object_handle) : NULL; if (delegate_object) { void *params [7]; params [0] = (void *)source_id; @@ -216,7 +227,7 @@ ves_icall_System_Diagnostics_Tracing_EventPipeInternal_CreateProvider ( MonoError *error) { EventPipeProvider *provider = NULL; - MonoObject *delegate_object = NULL; + void *callback_data = NULL; if (MONO_HANDLE_IS_NULL (provider_name)) { mono_error_set_argument_null (error, "providerName", ""); @@ -224,11 +235,11 @@ ves_icall_System_Diagnostics_Tracing_EventPipeInternal_CreateProvider ( } if (!MONO_HANDLE_IS_NULL (callback_func)) - delegate_object = MONO_HANDLE_RAW (MONO_HANDLE_CAST (MonoObject, callback_func)); + callback_data = (void *)mono_gchandle_new_weakref_internal (MONO_HANDLE_RAW (MONO_HANDLE_CAST (MonoObject, callback_func)), FALSE); char *provider_name_utf8 = mono_string_handle_to_utf8 (provider_name, error); if (is_ok (error) && provider_name_utf8) { - provider = ep_create_provider (provider_name_utf8, delegate_callback_func, delegate_object); + provider = ep_create_provider (provider_name_utf8, delegate_callback_func, delegate_callback_data_free_func, callback_data); } g_free (provider_name_utf8); diff --git a/src/mono/mono/mini/Makefile.am.in b/src/mono/mono/mini/Makefile.am.in index a8e9891def5b..38e1c4e69519 100755 --- a/src/mono/mono/mini/Makefile.am.in +++ b/src/mono/mono/mini/Makefile.am.in @@ -427,6 +427,8 @@ interp_sources = \ interp/interp.h \ interp/interp-internals.h \ interp/interp.c \ + interp/interp-intrins.h \ + interp/interp-intrins.c \ interp/mintops.h \ interp/mintops.def \ interp/mintops.c \ @@ -766,6 +768,7 @@ libmonosgen_2_0_la_CFLAGS = $(mono_sgen_CFLAGS) @CXX_ADD_CFLAGS@ libmonosgen_2_0_la_LIBADD = libmini.la $(interp_libs_with_mini) $(dbg_libs_with_mini) $(sgen_libs) $(LIBMONO_DTRACE_OBJECT) $(LLVMMONOF) libmonosgen_2_0_la_LDFLAGS = $(libmonoldflags) $(monobin_platform_ldflags) $(CCLDFLAGS) +libmonosgen_2_0_la_LIBTOOLFLAGS = $(MONO_LIBTOOL_TAG) noinst_LIBRARIES += libmaintest.a diff --git a/src/mono/mono/mini/interp/interp-intrins.c b/src/mono/mono/mini/interp/interp-intrins.c new file mode 100644 index 000000000000..b4093225dd28 --- /dev/null +++ b/src/mono/mono/mini/interp/interp-intrins.c @@ -0,0 +1,140 @@ +/* + * Intrinsics for libraries methods that are heavily used in interpreter relevant + * scenarios and where compiling these methods with the interpreter would have + * heavy performance impact. + */ + +#include "interp-intrins.h" + +#include +#include + +static guint32 +rotate_left (guint32 value, int offset) +{ + return (value << offset) | (value >> (32 - offset)); +} + +void +interp_intrins_marvin_block (guint32 *pp0, guint32 *pp1) +{ + // Marvin.Block + guint32 p0 = *pp0; + guint32 p1 = *pp1; + + p1 ^= p0; + p0 = rotate_left (p0, 20); + + p0 += p1; + p1 = rotate_left (p1, 9); + + p1 ^= p0; + p0 = rotate_left (p0, 27); + + p0 += p1; + p1 = rotate_left (p1, 19); + + *pp0 = p0; + *pp1 = p1; +} + +guint32 +interp_intrins_ascii_chars_to_uppercase (guint32 value) +{ + // Utf16Utility.ConvertAllAsciiCharsInUInt32ToUppercase + guint32 lowerIndicator = value + 0x00800080 - 0x00610061; + guint32 upperIndicator = value + 0x00800080 - 0x007B007B; + guint32 combinedIndicator = (lowerIndicator ^ upperIndicator); + guint32 mask = (combinedIndicator & 0x00800080) >> 2; + + return value ^ mask; +} + +int +interp_intrins_ordinal_ignore_case_ascii (guint32 valueA, guint32 valueB) +{ + // Utf16Utility.UInt32OrdinalIgnoreCaseAscii + guint32 differentBits = valueA ^ valueB; + guint32 lowerIndicator = valueA + 0x01000100 - 0x00410041; + guint32 upperIndicator = (valueA | 0x00200020u) + 0x00800080 - 0x007B007B; + guint32 combinedIndicator = lowerIndicator | upperIndicator; + return (((combinedIndicator >> 2) | ~0x00200020) & differentBits) == 0; +} + +int +interp_intrins_64ordinal_ignore_case_ascii (guint64 valueA, guint64 valueB) +{ + // Utf16Utility.UInt64OrdinalIgnoreCaseAscii + guint64 lowerIndicator = valueA + 0x0080008000800080l - 0x0041004100410041l; + guint64 upperIndicator = (valueA | 0x0020002000200020l) + 0x0100010001000100l - 0x007B007B007B007Bl; + guint64 combinedIndicator = (0x0080008000800080l & lowerIndicator & upperIndicator) >> 2; + return (valueA | combinedIndicator) == (valueB | combinedIndicator); +} + +static int +interp_intrins_count_digits (guint32 value) +{ + int digits = 1; + if (value >= 100000) { + value /= 100000; + digits += 5; + } + if (value < 10) { + // no-op + } else if (value < 100) { + digits++; + } else if (value < 1000) { + digits += 2; + } else if (value < 10000) { + digits += 3; + } else { + digits += 4; + } + return digits; +} + +static guint32 +interp_intrins_math_divrem (guint32 a, guint32 b, guint32 *result) +{ + guint32 div = a / b; + *result = a - (div * b); + return div; +} + +MonoString* +interp_intrins_u32_to_decstr (guint32 value, MonoArray *cache, MonoVTable *vtable) +{ + // Number.UInt32ToDecStr + int bufferLength = interp_intrins_count_digits (value); + + if (bufferLength == 1) + return mono_array_get_fast (cache, MonoString*, value); + + int size = (G_STRUCT_OFFSET (MonoString, chars) + (((size_t)bufferLength + 1) * 2)); + MonoString* result = mono_gc_alloc_string (vtable, size, bufferLength); + mono_unichar2 *buffer = &result->chars [0]; + mono_unichar2 *p = buffer + bufferLength; + do { + guint32 remainder; + value = interp_intrins_math_divrem (value, 10, &remainder); + *(--p) = (mono_unichar2)(remainder + '0'); + } while (value != 0); + return result; +} + +mono_u +interp_intrins_widen_ascii_to_utf16 (guint8 *pAsciiBuffer, mono_unichar2 *pUtf16Buffer, mono_u elementCount) +{ + // ASCIIUtility.WidenAsciiToUtf16 + mono_u currentOffset = 0; + + while (currentOffset < elementCount) { + guint16 asciiData = pAsciiBuffer [currentOffset]; + if ((asciiData & 0x80) != 0) + return currentOffset; + + pUtf16Buffer [currentOffset] = (mono_unichar2)asciiData; + currentOffset++; + } + return currentOffset; +} diff --git a/src/mono/mono/mini/interp/interp-intrins.h b/src/mono/mono/mini/interp/interp-intrins.h new file mode 100644 index 000000000000..2be852f33152 --- /dev/null +++ b/src/mono/mono/mini/interp/interp-intrins.h @@ -0,0 +1,27 @@ +#ifndef __MONO_MINI_INTERP_INTRINSICS_H__ +#define __MONO_MINI_INTERP_INTRINSICS_H__ + +#include +#include + +#include "interp-internals.h" + +void +interp_intrins_marvin_block (guint32 *pp0, guint32 *pp1); + +guint32 +interp_intrins_ascii_chars_to_uppercase (guint32 val); + +int +interp_intrins_ordinal_ignore_case_ascii (guint32 valueA, guint32 valueB); + +int +interp_intrins_64ordinal_ignore_case_ascii (guint64 valueA, guint64 valueB); + +MonoString* +interp_intrins_u32_to_decstr (guint32 value, MonoArray *cache, MonoVTable *vtable); + +mono_u +interp_intrins_widen_ascii_to_utf16 (guint8 *pAsciiBuffer, mono_unichar2 *pUtf16Buffer, mono_u elementCount); + +#endif /* __MONO_MINI_INTERP_INTRINSICS_H__ */ diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index c81ad63df876..d107b8d1b541 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -63,6 +63,7 @@ #include "interp.h" #include "interp-internals.h" #include "mintops.h" +#include "interp-intrins.h" #include #include @@ -1912,12 +1913,10 @@ interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject context->stack_pointer = (guchar*)sp; if (context->has_resume_state) { - // This can happen on wasm !? - MonoException *thrown_exc = (MonoException*) mono_gchandle_get_target_internal (context->exc_gchandle); - if (exc) - *exc = (MonoObject*)thrown_exc; - else - mono_error_set_exception_instance (error, thrown_exc); + /* + * This can happen on wasm where native frames cannot be skipped during EH. + * EH processing will continue when control returns to the interpreter. + */ return NULL; } return (MonoObject*)result.data.p; @@ -2975,6 +2974,16 @@ interp_create_method_pointer (MonoMethod *method, gboolean compile, MonoError *e imethod->jit_entry = addr; return addr; } + +#ifdef ENABLE_NETCORE + /* + * The runtime expects a function pointer unique to method and + * the native caller expects a function pointer with the + * right signature, so fail right away. + */ + mono_error_set_platform_not_supported (error, "No native to managed transitions on this platform."); + return NULL; +#endif } #endif return (gpointer)interp_no_native_to_managed; @@ -5260,6 +5269,23 @@ interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClauseArgs ip++; MINT_IN_BREAK; } + MINT_IN_CASE(MINT_INTRINS_SPAN_CTOR) { + gpointer ptr = sp [-2].data.p; + int len = sp [-1].data.i; + if (len < 0) + THROW_EX (mono_get_exception_argument_out_of_range ("length"), ip); + *(gpointer*)vt_sp = ptr; + *(gint32*)((gpointer*)vt_sp + 1) = len; + sp [-2].data.p = vt_sp; +#if SIZEOF_VOID_P == 8 + vt_sp += ALIGN_TO (12, MINT_VT_ALIGNMENT); +#else + vt_sp += ALIGN_TO (8, MINT_VT_ALIGNMENT); +#endif + sp--; + ip++; + MINT_IN_BREAK; + } MINT_IN_CASE(MINT_INTRINS_BYREFERENCE_GET_VALUE) { gpointer *byreference_this = (gpointer*)sp [-1].data.p; sp [-1].data.p = *byreference_this; @@ -5281,6 +5307,42 @@ interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClauseArgs ++ip; MINT_IN_BREAK; } + MINT_IN_CASE(MINT_INTRINS_MARVIN_BLOCK) { + sp -= 2; + interp_intrins_marvin_block ((guint32*)sp [0].data.p, (guint32*)sp [1].data.p); + ++ip; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_INTRINS_ASCII_CHARS_TO_UPPERCASE) { + sp [-1].data.i = interp_intrins_ascii_chars_to_uppercase ((guint32)sp [-1].data.i); + ++ip; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_INTRINS_ORDINAL_IGNORE_CASE_ASCII) { + sp--; + sp [-1].data.i = interp_intrins_ordinal_ignore_case_ascii ((guint32)sp [-1].data.i, (guint32)sp [0].data.i); + ++ip; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_INTRINS_64ORDINAL_IGNORE_CASE_ASCII) { + sp--; + sp [-1].data.i = interp_intrins_64ordinal_ignore_case_ascii ((guint64)sp [-1].data.l, (guint64)sp [0].data.l); + ++ip; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_INTRINS_U32_TO_DECSTR) { + MonoArray **cache_addr = (MonoArray**)frame->imethod->data_items [ip [1]]; + MonoVTable *string_vtable = (MonoVTable*)frame->imethod->data_items [ip [2]]; + sp [-1].data.o = (MonoObject*)interp_intrins_u32_to_decstr ((guint32)sp [-1].data.i, *cache_addr, string_vtable); + ip += 3; + MINT_IN_BREAK; + } + MINT_IN_CASE(MINT_INTRINS_WIDEN_ASCII_TO_UTF16) { + sp -= 2; + sp [-1].data.nati = interp_intrins_widen_ascii_to_utf16 ((guint8*)sp [-1].data.p, (mono_unichar2*)sp [0].data.p, sp [1].data.nati); + ip++; + MINT_IN_BREAK; + } MINT_IN_CASE(MINT_INTRINS_UNSAFE_BYTE_OFFSET) { sp -= 2; sp [0].data.nati = (guint8*)sp [1].data.p - (guint8*)sp [0].data.p; diff --git a/src/mono/mono/mini/interp/mintops.def b/src/mono/mono/mini/interp/mintops.def index b31168807223..488fc86dded3 100644 --- a/src/mono/mono/mini/interp/mintops.def +++ b/src/mono/mono/mini/interp/mintops.def @@ -786,9 +786,16 @@ OPDEF(MINT_PROF_COVERAGE_STORE, "prof_coverage_store", 5, Pop0, Push0, MintOpLon OPDEF(MINT_INTRINS_ENUM_HASFLAG, "intrins_enum_hasflag", 2, Pop2, Push1, MintOpClassToken) OPDEF(MINT_INTRINS_GET_HASHCODE, "intrins_get_hashcode", 1, Pop1, Push1, MintOpNoArgs) OPDEF(MINT_INTRINS_GET_TYPE, "intrins_get_type", 1, Pop1, Push1, MintOpNoArgs) -OPDEF(MINT_INTRINS_BYREFERENCE_CTOR, "intrins_byreference_ctor", 1, Pop1, Push1, MintOpClassToken) +OPDEF(MINT_INTRINS_BYREFERENCE_CTOR, "intrins_byreference_ctor", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_INTRINS_SPAN_CTOR, "intrins_span_ctor", 1, Pop2, Push1, MintOpNoArgs) OPDEF(MINT_INTRINS_BYREFERENCE_GET_VALUE, "intrins_byreference_get_value", 1, Pop1, Push1, MintOpNoArgs) OPDEF(MINT_INTRINS_UNSAFE_ADD_BYTE_OFFSET, "intrins_unsafe_add_byte_offset", 1, Pop2, Push1, MintOpNoArgs) OPDEF(MINT_INTRINS_UNSAFE_BYTE_OFFSET, "intrins_unsafe_byte_offset", 1, Pop2, Push1, MintOpNoArgs) OPDEF(MINT_INTRINS_RUNTIMEHELPERS_OBJECT_HAS_COMPONENT_SIZE, "intrins_runtimehelpers_object_has_component_size", 1, Pop1, Push1, MintOpNoArgs) OPDEF(MINT_INTRINS_CLEAR_WITH_REFERENCES, "intrin_clear_with_references", 1, Pop2, Push0, MintOpNoArgs) +OPDEF(MINT_INTRINS_MARVIN_BLOCK, "intrins_marvin_block", 1, Pop2, Push0, MintOpNoArgs) +OPDEF(MINT_INTRINS_ASCII_CHARS_TO_UPPERCASE, "intrins_ascii_chars_to_uppercase", 1, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_INTRINS_ORDINAL_IGNORE_CASE_ASCII, "intrins_ordinal_ignore_case_ascii", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_INTRINS_64ORDINAL_IGNORE_CASE_ASCII, "intrins_64ordinal_ignore_case_ascii", 1, Pop2, Push1, MintOpNoArgs) +OPDEF(MINT_INTRINS_U32_TO_DECSTR, "intrins_u32_to_decstr", 3, Pop1, Push1, MintOpNoArgs) +OPDEF(MINT_INTRINS_WIDEN_ASCII_TO_UTF16, "intrins_widen_ascii_to_utf16", 1, Pop3, Push1, MintOpNoArgs) diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index 351812fdbd9a..f0a333d04dcf 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -1502,6 +1502,40 @@ interp_handle_intrinsics (TransformData *td, MonoMethod *target_method, MonoClas } else if (in_corlib && !strcmp (klass_name_space, "System") && !strcmp (klass_name, "ByReference`1")) { g_assert (!strcmp (tm, "get_Value")); *op = MINT_INTRINS_BYREFERENCE_GET_VALUE; + } else if (in_corlib && !strcmp (klass_name_space, "System") && !strcmp (klass_name, "Marvin")) { + if (!strcmp (tm, "Block")) + *op = MINT_INTRINS_MARVIN_BLOCK; + } else if (in_corlib && !strcmp (klass_name_space, "System.Text.Unicode") && !strcmp (klass_name, "Utf16Utility")) { + if (!strcmp (tm, "ConvertAllAsciiCharsInUInt32ToUppercase")) + *op = MINT_INTRINS_ASCII_CHARS_TO_UPPERCASE; + else if (!strcmp (tm, "UInt32OrdinalIgnoreCaseAscii")) + *op = MINT_INTRINS_ORDINAL_IGNORE_CASE_ASCII; + else if (!strcmp (tm, "UInt64OrdinalIgnoreCaseAscii")) + *op = MINT_INTRINS_64ORDINAL_IGNORE_CASE_ASCII; + } else if (in_corlib && !strcmp (klass_name_space, "System.Text") && !strcmp (klass_name, "ASCIIUtility")) { + if (!strcmp (tm, "WidenAsciiToUtf16")) + *op = MINT_INTRINS_WIDEN_ASCII_TO_UTF16; + } else if (in_corlib && !strcmp (klass_name_space, "System") && !strcmp (klass_name, "Number")) { + if (!strcmp (tm, "UInt32ToDecStr") && csignature->param_count == 1) { + ERROR_DECL(error); + MonoVTable *vtable = mono_class_vtable_checked (td->rtm->domain, target_method->klass, error); + if (!is_ok (error)) { + mono_error_cleanup (error); + return FALSE; + } + /* Don't use intrinsic if cctor not yet run */ + if (!vtable->initialized) + return FALSE; + /* The cache is the first static field. Update this if bcl code changes */ + MonoClassField *field = m_class_get_fields (target_method->klass); + g_assert (!strcmp (field->name, "s_singleDigitStringCache")); + interp_add_ins (td, MINT_INTRINS_U32_TO_DECSTR); + td->last_ins->data [0] = get_data_item_index (td, (char*)mono_vtable_get_static_field_data (vtable) + field->offset); + td->last_ins->data [1] = get_data_item_index (td, mono_class_vtable_checked (td->rtm->domain, mono_defaults.string_class, error)); + SET_TYPE (td->sp - 1, STACK_TYPE_O, mono_defaults.string_class); + td->ip += 5; + return TRUE; + } } else if (in_corlib && !strcmp (klass_name_space, "System") && (!strcmp (klass_name, "Math") || !strcmp (klass_name, "MathF"))) { gboolean is_float = strcmp (klass_name, "MathF") == 0; @@ -3028,6 +3062,20 @@ mono_test_interp_method_compute_offsets (TransformData *td, InterpMethod *imetho interp_method_compute_offsets (td, imethod, signature, header, error); } +static gboolean +type_has_references (MonoType *type) +{ + if (MONO_TYPE_IS_REFERENCE (type)) + return TRUE; + if (MONO_TYPE_ISSTRUCT (type)) { + MonoClass *klass = mono_class_from_mono_type_internal (type); + if (!m_class_is_inited (klass)) + mono_class_init_internal (klass); + return m_class_has_references (klass); + } + return FALSE; +} + /* Return false is failure to init basic blocks due to being in inline method */ static gboolean init_bb_start (TransformData *td, MonoMethodHeader *header, gboolean inlining) @@ -4695,6 +4743,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, PUSH_TYPE (td, stack_type [mint_type (m_class_get_byval_arg (klass))], klass); } else { + gboolean can_inline = TRUE; if (m_class_get_parent (klass) == mono_defaults.array_class) { interp_add_ins (td, MINT_NEWOBJ_ARRAY); td->last_ins->data [0] = get_data_item_index (td, m->klass); @@ -4709,6 +4758,14 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, /* public ByReference(ref T value) */ g_assert (csignature->hasthis && csignature->param_count == 1); interp_add_ins (td, MINT_INTRINS_BYREFERENCE_CTOR); + } else if (m_class_get_image (klass) == mono_defaults.corlib && + (!strcmp (m_class_get_name (m->klass), "Span`1") || + !strcmp (m_class_get_name (m->klass), "ReadOnlySpan`1")) && + csignature->param_count == 2 && + csignature->params [0]->type == MONO_TYPE_PTR && + !type_has_references (mono_method_get_context (m)->class_inst->type_argv [0])) { + /* ctor frequently used with ReadOnlySpan over static arrays */ + interp_add_ins (td, MINT_INTRINS_SPAN_CTOR); } else if (klass != mono_defaults.string_class && !mono_class_is_marshalbyref (klass) && !mono_class_has_finalizer (klass) && @@ -4766,6 +4823,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, move_stack (td, (td->sp - td->stack) - csignature->param_count, -2); // Set the method to be executed as part of newobj instruction newobj_fast->data [0] = get_data_item_index (td, mono_interp_get_imethod (domain, m, error)); + can_inline = FALSE; } else { // Runtime (interp_exec_method_full in interp.c) inserts // extra stack to hold this and return value, before call. @@ -4775,8 +4833,10 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, td->last_ins->data [0] = get_data_item_index (td, mono_interp_get_imethod (domain, m, error)); } goto_if_nok (error, exit); - /* The constructor was not inlined, abort inlining of current method */ - INLINE_FAILURE; + if (!can_inline) { + /* The constructor was not inlined, abort inlining of current method */ + INLINE_FAILURE; + } td->sp -= csignature->param_count; if (mint_type (m_class_get_byval_arg (klass)) == MINT_TYPE_VT) { @@ -4793,7 +4853,8 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, } } if ((vt_stack_used != 0 || vt_res_size != 0) && - td->last_ins->opcode != MINT_INTRINS_BYREFERENCE_CTOR) { + td->last_ins->opcode != MINT_INTRINS_BYREFERENCE_CTOR && + td->last_ins->opcode != MINT_INTRINS_SPAN_CTOR) { /* FIXME Remove this once vtsp and sp are unified */ interp_add_ins (td, MINT_VTRESULT); td->last_ins->data [0] = vt_res_size; diff --git a/src/mono/mono/mini/llvm-jit.cpp b/src/mono/mono/mini/llvm-jit.cpp index bd31c13dd31c..1e896419f0b4 100644 --- a/src/mono/mono/mini/llvm-jit.cpp +++ b/src/mono/mono/mini/llvm-jit.cpp @@ -457,7 +457,7 @@ init_passes_and_options () // FIXME: find optimal mono specific order of passes // see https://llvm.org/docs/Frontend/PerformanceTips.html#pass-ordering // the following order is based on a stripped version of "OPT -O2" - const char *default_opts = " -simplifycfg -sroa -lower-expect -instcombine -jump-threading -loop-rotate -licm -simplifycfg -lcssa -loop-idiom -indvars -loop-deletion -gvn -memcpyopt -sccp -bdce -instcombine -dse -simplifycfg -enable-implicit-null-checks -sroa -instcombine" NO_CALL_FRAME_OPT; + const char *default_opts = " -simplifycfg -sroa -lower-expect -instcombine -sroa -jump-threading -loop-rotate -licm -simplifycfg -lcssa -loop-idiom -indvars -loop-deletion -gvn -memcpyopt -sccp -bdce -instcombine -dse -simplifycfg -enable-implicit-null-checks -sroa -instcombine" NO_CALL_FRAME_OPT; const char *opts = g_getenv ("MONO_LLVM_OPT"); if (opts == NULL) opts = default_opts; diff --git a/src/mono/mono/mini/mini-llvm-cpp.cpp b/src/mono/mono/mini/mini-llvm-cpp.cpp index e9ef87822229..dd9138ef6c28 100644 --- a/src/mono/mono/mini/mini-llvm-cpp.cpp +++ b/src/mono/mono/mini/mini-llvm-cpp.cpp @@ -520,7 +520,9 @@ mono_llvm_di_create_function (void *di_builder, void *cu, LLVMValueRef func, con di_file = builder->createFile (file, dir); type = builder->createSubroutineType (builder->getOrCreateTypeArray (ArrayRef ())); #if LLVM_API_VERSION >= 900 - di_func = builder->createFunction (di_file, name, mangled_name, di_file, line, type, 0); + di_func = builder->createFunction ( + di_file, name, mangled_name, di_file, line, type, 0, + DINode::FlagZero, DISubprogram::SPFlagDefinition | DISubprogram::SPFlagLocalToUnit); #else di_func = builder->createFunction (di_file, name, mangled_name, di_file, line, type, true, true, 0); #endif diff --git a/src/mono/mono/mini/mini-runtime.c b/src/mono/mono/mini/mini-runtime.c index 94a7292b1736..c180d303d4d2 100644 --- a/src/mono/mono/mini/mini-runtime.c +++ b/src/mono/mono/mini/mini-runtime.c @@ -4540,7 +4540,7 @@ mini_init (const char *filename, const char *runtime_version) else domain = mono_init_from_assembly (filename, filename); -#ifdef ENABLE_PERFTRACING +#if defined(ENABLE_PERFTRACING) && !defined(DISABLE_EVENTPIPE) ep_init (); #endif @@ -4987,7 +4987,7 @@ mini_cleanup (MonoDomain *domain) jit_stats_cleanup (); mono_jit_dump_cleanup (); mini_get_interp_callbacks ()->cleanup (); -#ifdef ENABLE_PERFTRACING +#if defined(ENABLE_PERFTRACING) && !defined(DISABLE_EVENTPIPE) ep_shutdown (); #endif } diff --git a/src/mono/mono/mini/simd-intrinsics-netcore.c b/src/mono/mono/mini/simd-intrinsics-netcore.c index 688c3620af0d..a93b334fe4ab 100644 --- a/src/mono/mono/mini/simd-intrinsics-netcore.c +++ b/src/mono/mono/mini/simd-intrinsics-netcore.c @@ -373,9 +373,10 @@ static guint16 vector_t_methods [] = { SN_LessThanOrEqual, SN_Max, SN_Min, - SN_get_AllOnes, + SN_get_AllBitsSet, SN_get_Count, SN_get_Item, + SN_get_One, SN_get_Zero, SN_op_Addition, SN_op_BitwiseAnd, @@ -398,6 +399,9 @@ emit_sys_numerics_vector_t (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSig int size, len, id; gboolean is_unsigned; + static const float r4_one = 1.0f; + static const double r8_one = 1.0; + id = lookup_intrins (vector_t_methods, sizeof (vector_t_methods), cmethod); if (id == -1) return NULL; @@ -427,7 +431,33 @@ emit_sys_numerics_vector_t (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSig case SN_get_Zero: g_assert (fsig->param_count == 0 && mono_metadata_type_equal (fsig->ret, type)); return emit_simd_ins (cfg, klass, OP_XZERO, -1, -1); - case SN_get_AllOnes: { + case SN_get_One: { + g_assert (fsig->param_count == 0 && mono_metadata_type_equal (fsig->ret, type)); + MonoInst *one = NULL; + int expand_opcode = type_to_expand_op (etype); + MONO_INST_NEW (cfg, one, -1); + switch (expand_opcode) { + case OP_EXPAND_R4: + one->opcode = OP_R4CONST; + one->type = STACK_R4; + one->inst_p0 = (void *) &r4_one; + break; + case OP_EXPAND_R8: + one->opcode = OP_R8CONST; + one->type = STACK_R8; + one->inst_p0 = (void *) &r8_one; + break; + default: + one->opcode = OP_ICONST; + one->type = STACK_I4; + one->inst_c0 = 1; + break; + } + one->dreg = alloc_dreg (cfg, one->type); + MONO_ADD_INS (cfg->cbb, one); + return emit_simd_ins (cfg, klass, expand_opcode, one->dreg, -1); + } + case SN_get_AllBitsSet: { /* Compare a zero vector with itself */ ins = emit_simd_ins (cfg, klass, OP_XZERO, -1, -1); return emit_xcompare (cfg, klass, etype->type, ins, ins); diff --git a/src/mono/mono/mini/simd-methods-netcore.h b/src/mono/mono/mini/simd-methods-netcore.h index fceba001c083..6ea5b9c4a217 100644 --- a/src/mono/mono/mini/simd-methods-netcore.h +++ b/src/mono/mono/mini/simd-methods-netcore.h @@ -14,7 +14,7 @@ METHOD(LeadingZeroCount) METHOD(get_Count) METHOD(get_IsHardwareAccelerated) METHOD(get_IsSupported) -METHOD(get_AllOnes) +METHOD(get_AllBitsSet) METHOD(get_Item) METHOD(get_One) METHOD(get_Zero) diff --git a/src/mono/mono/mini/wasm_m2n_invoke.g.h b/src/mono/mono/mini/wasm_m2n_invoke.g.h index 9ff51af01d8c..715070c03fd2 100644 --- a/src/mono/mono/mini/wasm_m2n_invoke.g.h +++ b/src/mono/mono/mini/wasm_m2n_invoke.g.h @@ -1527,6 +1527,104 @@ wasm_invoke_viiiif (void *target_func, InterpMethodArguments *margs) } +static void +wasm_invoke_iffffiii (void *target_func, InterpMethodArguments *margs) +{ + typedef int (*T)(float arg_0, float arg_1, float arg_2, float arg_3, int arg_4, int arg_5, int arg_6); + T func = (T)target_func; + int res = func (*(float*)&margs->fargs [FIDX (0)], *(float*)&margs->fargs [FIDX (1)], *(float*)&margs->fargs [FIDX (2)], *(float*)&margs->fargs [FIDX (3)], (int)(gssize)margs->iargs [0], (int)(gssize)margs->iargs [1], (int)(gssize)margs->iargs [2]); + *(int*)margs->retval = res; + +} + +static void +wasm_invoke_iffiii (void *target_func, InterpMethodArguments *margs) +{ + typedef int (*T)(float arg_0, float arg_1, int arg_2, int arg_3, int arg_4); + T func = (T)target_func; + int res = func (*(float*)&margs->fargs [FIDX (0)], *(float*)&margs->fargs [FIDX (1)], (int)(gssize)margs->iargs [0], (int)(gssize)margs->iargs [1], (int)(gssize)margs->iargs [2]); + *(int*)margs->retval = res; + +} + +static void +wasm_invoke_viiiiffii (void *target_func, InterpMethodArguments *margs) +{ + typedef void (*T)(int arg_0, int arg_1, int arg_2, int arg_3, float arg_4, float arg_5, int arg_6, int arg_7); + T func = (T)target_func; + func ((int)(gssize)margs->iargs [0], (int)(gssize)margs->iargs [1], (int)(gssize)margs->iargs [2], (int)(gssize)margs->iargs [3], *(float*)&margs->fargs [FIDX (0)], *(float*)&margs->fargs [FIDX (1)], (int)(gssize)margs->iargs [4], (int)(gssize)margs->iargs [5]); + +} + +static void +wasm_invoke_iiiliiii (void *target_func, InterpMethodArguments *margs) +{ + typedef int (*T)(int arg_0, int arg_1, gint64 arg_2, int arg_3, int arg_4, int arg_5, int arg_6); + T func = (T)target_func; + int res = func ((int)(gssize)margs->iargs [0], (int)(gssize)margs->iargs [1], get_long_arg (margs, 2), (int)(gssize)margs->iargs [4], (int)(gssize)margs->iargs [5], (int)(gssize)margs->iargs [6], (int)(gssize)margs->iargs [7]); + *(int*)margs->retval = res; + +} + +static void +wasm_invoke_iiilli (void *target_func, InterpMethodArguments *margs) +{ + typedef int (*T)(int arg_0, int arg_1, gint64 arg_2, gint64 arg_3, int arg_4); + T func = (T)target_func; + int res = func ((int)(gssize)margs->iargs [0], (int)(gssize)margs->iargs [1], get_long_arg (margs, 2), get_long_arg (margs, 4), (int)(gssize)margs->iargs [6]); + *(int*)margs->retval = res; + +} + +static void +wasm_invoke_il (void *target_func, InterpMethodArguments *margs) +{ + typedef int (*T)(gint64 arg_0); + T func = (T)target_func; + int res = func (get_long_arg (margs, 0)); + *(int*)margs->retval = res; + +} + +static void +wasm_invoke_iff (void *target_func, InterpMethodArguments *margs) +{ + typedef int (*T)(float arg_0, float arg_1); + T func = (T)target_func; + int res = func (*(float*)&margs->fargs [FIDX (0)], *(float*)&margs->fargs [FIDX (1)]); + *(int*)margs->retval = res; + +} + +static void +wasm_invoke_ifff (void *target_func, InterpMethodArguments *margs) +{ + typedef int (*T)(float arg_0, float arg_1, float arg_2); + T func = (T)target_func; + int res = func (*(float*)&margs->fargs [FIDX (0)], *(float*)&margs->fargs [FIDX (1)], *(float*)&margs->fargs [FIDX (2)]); + *(int*)margs->retval = res; + +} + +static void +wasm_invoke_iffff (void *target_func, InterpMethodArguments *margs) +{ + typedef int (*T)(float arg_0, float arg_1, float arg_2, float arg_3); + T func = (T)target_func; + int res = func (*(float*)&margs->fargs [FIDX (0)], *(float*)&margs->fargs [FIDX (1)], *(float*)&margs->fargs [FIDX (2)], *(float*)&margs->fargs [FIDX (3)]); + *(int*)margs->retval = res; + +} + +static void +wasm_invoke_vlii (void *target_func, InterpMethodArguments *margs) +{ + typedef void (*T)(gint64 arg_0, int arg_1, int arg_2); + T func = (T)target_func; + func (get_long_arg (margs, 0), (int)(gssize)margs->iargs [2], (int)(gssize)margs->iargs [3]); + +} + static const char* interp_to_native_signatures [] = { "DD", "DDD", @@ -1550,12 +1648,17 @@ static const char* interp_to_native_signatures [] = { "ID", "IDIII", "IF", +"IFF", +"IFFF", +"IFFFF", "IFFFFFFI", +"IFFFFIII", "IFFFFIIII", "IFFI", "IFFIF", "IFFIFI", "IFFII", +"IFFIII", "IFI", "IFIII", "II", @@ -1616,12 +1719,15 @@ static const char* interp_to_native_signatures [] = { "IIIIIIIIIIIII", "IIIIIIIIIIIIII", "IIIL", +"IIILIIII", +"IIILLI", "IIL", "IILI", "IILIIII", "IILIIIL", "IILLI", "IILLLI", +"IL", "ILI", "L", "LI", @@ -1671,6 +1777,7 @@ static const char* interp_to_native_signatures [] = { "VIIIFIII", "VIIII", "VIIIIF", +"VIIIIFFII", "VIIIII", "VIIIIII", "VIIIIIII", @@ -1686,6 +1793,7 @@ static const char* interp_to_native_signatures [] = { "VIL", "VILLI", "VL", +"VLII", }; static void* interp_to_native_invokes [] = { wasm_invoke_dd, @@ -1710,12 +1818,17 @@ wasm_invoke_i, wasm_invoke_id, wasm_invoke_idiii, wasm_invoke_if, +wasm_invoke_iff, +wasm_invoke_ifff, +wasm_invoke_iffff, wasm_invoke_iffffffi, +wasm_invoke_iffffiii, wasm_invoke_iffffiiii, wasm_invoke_iffi, wasm_invoke_iffif, wasm_invoke_iffifi, wasm_invoke_iffii, +wasm_invoke_iffiii, wasm_invoke_ifi, wasm_invoke_ifiii, wasm_invoke_ii, @@ -1776,12 +1889,15 @@ wasm_invoke_iiiiiiiiiiii, wasm_invoke_iiiiiiiiiiiii, wasm_invoke_iiiiiiiiiiiiii, wasm_invoke_iiil, +wasm_invoke_iiiliiii, +wasm_invoke_iiilli, wasm_invoke_iil, wasm_invoke_iili, wasm_invoke_iiliiii, wasm_invoke_iiliiil, wasm_invoke_iilli, wasm_invoke_iillli, +wasm_invoke_il, wasm_invoke_ili, wasm_invoke_l, wasm_invoke_li, @@ -1831,6 +1947,7 @@ wasm_invoke_viiifii, wasm_invoke_viiifiii, wasm_invoke_viiii, wasm_invoke_viiiif, +wasm_invoke_viiiiffii, wasm_invoke_viiiii, wasm_invoke_viiiiii, wasm_invoke_viiiiiii, @@ -1846,4 +1963,5 @@ wasm_invoke_viil, wasm_invoke_vil, wasm_invoke_villi, wasm_invoke_vl, +wasm_invoke_vlii, }; diff --git a/src/mono/msbuild/aot-compile.proj b/src/mono/msbuild/aot-compile.proj new file mode 100644 index 000000000000..2bceabf0c576 --- /dev/null +++ b/src/mono/msbuild/aot-compile.proj @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/mono/msvc/libmini-interp.targets b/src/mono/msvc/libmini-interp.targets index 31ef8c03a231..0bfddcb1809b 100644 --- a/src/mono/msvc/libmini-interp.targets +++ b/src/mono/msvc/libmini-interp.targets @@ -8,6 +8,8 @@ + + diff --git a/src/mono/msvc/libmini-interp.targets.filters b/src/mono/msvc/libmini-interp.targets.filters index 267a6baaaf91..09114683ecea 100644 --- a/src/mono/msvc/libmini-interp.targets.filters +++ b/src/mono/msvc/libmini-interp.targets.filters @@ -13,6 +13,12 @@ Source Files$(MonoMiniFilterSubFolder)\interp + + Header Files$(MonoMiniFilterSubFolder)\interp + + + Source Files$(MonoMiniFilterSubFolder)\interp + Header Files$(MonoMiniFilterSubFolder)\interp diff --git a/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj index 2eb2ec324e1f..95e1e72845ad 100644 --- a/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -123,7 +123,7 @@ true true true - true + true true @@ -152,6 +152,9 @@ + + @@ -160,6 +163,7 @@ + @@ -194,7 +198,6 @@ - diff --git a/src/mono/netcore/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.wasm.xml b/src/mono/netcore/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.wasm.xml new file mode 100644 index 000000000000..9e409ddc89e2 --- /dev/null +++ b/src/mono/netcore/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.wasm.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mono/netcore/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.wasm.xml b/src/mono/netcore/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.wasm.xml index f0304dd46316..4ee64149df2f 100644 --- a/src/mono/netcore/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.wasm.xml +++ b/src/mono/netcore/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.wasm.xml @@ -9,5 +9,8 @@ + + + diff --git a/src/mono/netcore/System.Private.CoreLib/src/Mono/MonoPInvokeCallbackAttribute.cs b/src/mono/netcore/System.Private.CoreLib/src/Mono/MonoPInvokeCallbackAttribute.cs new file mode 100644 index 000000000000..dbdc8fdead84 --- /dev/null +++ b/src/mono/netcore/System.Private.CoreLib/src/Mono/MonoPInvokeCallbackAttribute.cs @@ -0,0 +1,10 @@ +using System; + +namespace Mono +{ + [AttributeUsage(AttributeTargets.Method)] + internal sealed class MonoPInvokeCallbackAttribute : Attribute + { + public MonoPInvokeCallbackAttribute(Type type) {} + } +} diff --git a/src/mono/netcore/System.Private.CoreLib/src/System/Enum.Mono.cs b/src/mono/netcore/System.Private.CoreLib/src/System/Enum.Mono.cs index a0715c5f9339..3e342b73b6c9 100644 --- a/src/mono/netcore/System.Private.CoreLib/src/System/Enum.Mono.cs +++ b/src/mono/netcore/System.Private.CoreLib/src/System/Enum.Mono.cs @@ -8,89 +8,20 @@ namespace System { public partial class Enum { - internal sealed class EnumInfo - { - public readonly bool HasFlagsAttribute; - public readonly ulong[] Values; - public readonly string[] Names; - - // Each entry contains a list of sorted pair of enum field names and values, sorted by values - public EnumInfo(bool hasFlagsAttribute, ulong[] values, string[] names) - { - HasFlagsAttribute = hasFlagsAttribute; - Values = values; - Names = names; - } - } - - [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern bool InternalHasFlag(Enum flags); - - [Intrinsic] - public bool HasFlag(Enum flag) - { - if (flag is null) - throw new ArgumentNullException(nameof(flag)); - if (!this.GetType().IsEquivalentTo(flag.GetType())) - throw new ArgumentException(SR.Format(SR.Argument_EnumTypeDoesNotMatch, flag.GetType(), this.GetType())); - - return InternalHasFlag(flag); - } - - public static string? GetName(Type enumType, object value) - { - if (enumType is null) - throw new ArgumentNullException(nameof(enumType)); - - return enumType.GetEnumName(value); - } - - public static string[] GetNames(Type enumType) - { - if (enumType is null) - throw new ArgumentNullException(nameof(enumType)); - - return enumType.GetEnumNames(); - } - - public static Type GetUnderlyingType(Type enumType) - { - if (enumType is null) - throw new ArgumentNullException(nameof(enumType)); - - return enumType.GetEnumUnderlyingType(); - } - - public static Array GetValues(Type enumType) - { - if (enumType is null) - throw new ArgumentNullException(nameof(enumType)); - - return enumType.GetEnumValues(); - } - - public static bool IsDefined(Type enumType, object value) - { - if (enumType is null) - throw new ArgumentNullException(nameof(enumType)); + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern bool GetEnumValuesAndNames(RuntimeType enumType, out ulong[] values, out string[] names); - return enumType.IsEnumDefined(value); - } + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern object InternalBoxEnum(RuntimeType enumType, long value); - internal static ulong[] InternalGetValues(RuntimeType enumType) - { - // Get all of the values - return GetEnumInfo(enumType, false).Values; - } + [MethodImpl(MethodImplOptions.InternalCall)] + private extern CorElementType InternalGetCorElementType(); - internal static string[] InternalGetNames(RuntimeType enumType) - { - // Get all of the names - return GetEnumInfo(enumType, true).Names; - } + [MethodImpl(MethodImplOptions.InternalCall)] + internal static extern RuntimeType InternalGetUnderlyingType(RuntimeType enumType); - [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static extern bool GetEnumValuesAndNames(RuntimeType enumType, out ulong[] values, out string[] names); + [MethodImpl(MethodImplOptions.InternalCall)] + private extern bool InternalHasFlag(Enum flags); private static EnumInfo GetEnumInfo(RuntimeType enumType, bool getNames = true) { @@ -108,25 +39,5 @@ private static EnumInfo GetEnumInfo(RuntimeType enumType, bool getNames = true) return entry; } - - [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static extern object InternalBoxEnum(RuntimeType enumType, long value); - - [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern CorElementType InternalGetCorElementType(); - - [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal static extern RuntimeType InternalGetUnderlyingType(RuntimeType enumType); - - private static RuntimeType ValidateRuntimeType(Type enumType) - { - if (enumType is null) - throw new ArgumentNullException(nameof(enumType)); - if (!enumType.IsEnum) - throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType)); - if (!(enumType is RuntimeType rtType)) - throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType)); - return rtType; - } } } diff --git a/src/mono/netcore/System.Private.CoreLib/src/System/Internal.cs b/src/mono/netcore/System.Private.CoreLib/src/System/Internal.cs deleted file mode 100644 index 5c13161b4eb7..000000000000 --- a/src/mono/netcore/System.Private.CoreLib/src/System/Internal.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** This file exists to contain miscellaneous module-level attributes -** and other miscellaneous stuff. -** -** -** -===========================================================*/ - -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: CLSCompliant(true)] -[assembly: ComVisible(false)] - -[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.AssemblyDirectory | DllImportSearchPath.System32)] - -[assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")] diff --git a/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs b/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs index 6a72a6e4735c..af61aab2ee98 100644 --- a/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs +++ b/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs @@ -136,6 +136,7 @@ internal static ParameterInfo GetReturnParameterInfo(RuntimeMethodInfo method) } } +#region Sync with _MonoReflectionMethod in object-internals.h [StructLayout(LayoutKind.Sequential)] internal class RuntimeMethodInfo : MethodInfo { @@ -144,6 +145,8 @@ internal class RuntimeMethodInfo : MethodInfo private string? name; private Type? reftype; #pragma warning restore 649 +#endregion + private string? toString; internal BindingFlags BindingFlags { @@ -194,9 +197,28 @@ public override Delegate CreateDelegate(Type delegateType, object? target) return Delegate.CreateDelegate(delegateType, target, this); } + // copied from CoreCLR's RuntimeMethodInfo public override string ToString() { - return ReturnType.FormatTypeName() + " " + FormatNameAndSig(); + if (toString == null) + { + var sbName = new ValueStringBuilder(MethodNameBufferSize); + + sbName.Append(ReturnType.FormatTypeName()); + sbName.Append(' '); + sbName.Append(Name); + + if (IsGenericMethod) + sbName.Append(RuntimeMethodHandle.ConstructInstantiation(this, TypeNameFormatFlags.FormatBasic)); + + sbName.Append('('); + AppendParameters(ref sbName, GetParameterTypes(), CallingConvention); + sbName.Append(')'); + + toString = sbName.ToString(); + } + + return toString; } internal RuntimeModule GetRuntimeModule() @@ -746,7 +768,7 @@ public override IList GetCustomAttributesData() public sealed override bool HasSameMetadataDefinitionAs(MemberInfo other) => HasSameMetadataDefinitionAsCore(other); } - +#region Sync with _MonoReflectionMethod in object-internals.h [StructLayout(LayoutKind.Sequential)] internal class RuntimeConstructorInfo : ConstructorInfo { @@ -755,6 +777,8 @@ internal class RuntimeConstructorInfo : ConstructorInfo private string? name; private Type? reftype; #pragma warning restore 649 +#endregion + private string? toString; public override Module Module { @@ -968,16 +992,26 @@ public override MethodBody GetMethodBody() return RuntimeMethodInfo.GetMethodBody(mhandle); } + // copied from CoreCLR's RuntimeConstructorInfo public override string ToString() { - StringBuilder sbName = new StringBuilder(Name); - sbName.Append("Void "); + if (toString == null) + { + var sbName = new ValueStringBuilder(MethodNameBufferSize); - sbName.Append('('); - RuntimeParameterInfo.FormatParameters(sbName, GetParametersNoCopy(), CallingConvention); - sbName.Append(')'); + // "Void" really doesn't make sense here. But we'll keep it for compat reasons. + sbName.Append("Void "); - return sbName.ToString(); + sbName.Append(Name); + + sbName.Append('('); + AppendParameters(ref sbName, GetParameterTypes(), CallingConvention); + sbName.Append(')'); + + toString = sbName.ToString(); + } + + return toString; } public override IList GetCustomAttributesData() diff --git a/src/mono/netcore/System.Private.CoreLib/src/System/RuntimeType.Mono.cs b/src/mono/netcore/System.Private.CoreLib/src/System/RuntimeType.Mono.cs index 12c3dee7378d..c665878637c3 100644 --- a/src/mono/netcore/System.Private.CoreLib/src/System/RuntimeType.Mono.cs +++ b/src/mono/netcore/System.Private.CoreLib/src/System/RuntimeType.Mono.cs @@ -2002,7 +2002,7 @@ internal override FieldInfo GetField(FieldInfo fromNoninstanciated) Type? type = Enum.GetUnderlyingType(this); if (type == value.GetType()) return value; - object? res = IsConvertibleToPrimitiveType(value, this); + object? res = IsConvertibleToPrimitiveType(value, type); if (res != null) return res; } @@ -2197,8 +2197,9 @@ public override Type MakeArrayType() public override Type MakeArrayType(int rank) { - if (rank < 1 || rank > 255) + if (rank < 1) throw new IndexOutOfRangeException(); + return make_array_type(rank); } diff --git a/src/mono/wasm/.editorconfig b/src/mono/wasm/.editorconfig new file mode 100755 index 000000000000..82b51b609cd8 --- /dev/null +++ b/src/mono/wasm/.editorconfig @@ -0,0 +1,13 @@ +# editorconfig.org + +# top-most EditorConfig file +root = false + +# Default settings: +# A newline ending every file +# Use 4 spaces as indentation +[*] +insert_final_newline = true +indent_style = tabs +indent_size = 4 +trim_trailing_whitespace = true \ No newline at end of file diff --git a/src/mono/wasm/Makefile b/src/mono/wasm/Makefile index 23f96d649836..2562217a9354 100644 --- a/src/mono/wasm/Makefile +++ b/src/mono/wasm/Makefile @@ -17,7 +17,7 @@ NATIVE_DIR?=$(OBJDIR)/native/net5.0-Browser-$(CONFIG)-wasm BUILDS_BIN_DIR?=$(BINDIR)/native/net5.0-Browser-$(CONFIG)-wasm ICU_LIBDIR?= -all: build-native timezone-data +all: build-native timezone-data icu-data # # EMSCRIPTEN SETUP @@ -54,7 +54,8 @@ MONO_LIBS = \ ${NATIVE_DIR}/System.Native/libSystem.Native.a \ ${NATIVE_DIR}/System.IO.Compression.Native/libSystem.IO.Compression.Native.a \ $(ICU_LIBDIR)/libicuuc.a \ - $(ICU_LIBDIR)/libicui18n.a + $(ICU_LIBDIR)/libicui18n.a \ + $(ICU_LIBDIR)/libicudata.a EMCC_FLAGS=--profiling-funcs -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s BINARYEN=1 -s ALIASING_FUNCTION_POINTERS=0 -s NO_EXIT_RUNTIME=1 -s "EXTRA_EXPORTED_RUNTIME_METHODS=['ccall', 'FS_createPath', 'FS_createDataFile', 'cwrap', 'setValue', 'getValue', 'UTF8ToString', 'UTF8ArrayToString', 'addFunction']" -s "EXPORTED_FUNCTIONS=['_putchar']" --source-map-base http://example.com -emit-llvm -s FORCE_FILESYSTEM=1 -s USE_ZLIB=1 EMCC_DEBUG_FLAGS =-g -Os -s ASSERTIONS=1 -DENABLE_NETCORE=1 -DDEBUG=1 @@ -114,6 +115,9 @@ clean: timezone-data: cp runtime/dotnet.timezones.blat $(BUILDS_BIN_DIR) +icu-data: + cp $(ICU_LIBDIR)/icudt.dat $(BUILDS_BIN_DIR) + runtime: EMSDK_PATH=$(TOP)/src/mono/wasm/emsdk $(TOP)/build.sh --subset mono --arch wasm --os Browser -c $(CONFIG) /p:ContinueOnError=false /p:StopOnFirstFailure=true diff --git a/src/mono/wasm/runtime-test.js b/src/mono/wasm/runtime-test.js index dfbd2bca32b0..b63c8fc6ca3e 100644 --- a/src/mono/wasm/runtime-test.js +++ b/src/mono/wasm/runtime-test.js @@ -170,37 +170,6 @@ var Module = { MONO.mono_wasm_setenv (variable, setenv [variable]); } - // Read and write files to virtual file system listed in mono-config - if (typeof config.files_to_map != 'undefined') { - Module.print("Mapping test support files listed in config.files_to_map to VFS"); - const files_to_map = config.files_to_map; - try { - for (var i = 0; i < files_to_map.length; i++) - { - if (typeof files_to_map[i].directory != 'undefined') - { - var directory = files_to_map[i].directory == '' ? '/' : files_to_map[i].directory; - if (directory != '/') { - Module['FS_createPath']('/', directory, true, true); - } - - const files = files_to_map[i].files; - for (var j = 0; j < files.length; j++) - { - var fullPath = directory != '/' ? directory + '/' + files[j] : files[j]; - var content = new Uint8Array (read ("supportFiles/" + fullPath, 'binary')); - writeContentToFile(content, fullPath); - } - } - } - } - catch (err) { - Module.printErr(err); - Module.printErr(err.stack); - test_exit(1); - } - } - if (!enable_gc) { Module.ccall ('mono_wasm_enable_on_demand_gc', 'void', ['number'], [0]); } @@ -224,43 +193,51 @@ var Module = { MONO.mono_wasm_load_data (zonedata, "/usr/share/zoneinfo"); } - MONO.mono_load_runtime_and_bcl ( - config.vfs_prefix, - config.deploy_prefix, - config.enable_debugging, - config.assembly_list, - function () { - App.init (); - }, - function (asset) - { - // for testing purposes add BCL assets to VFS until we special case File.Open - // to identify when an assembly from the BCL is being open and resolve it correctly. - var content = new Uint8Array (read (asset, 'binary')); - var path = asset.substr(config.deploy_prefix.length); - writeContentToFile(content, path); - - if (typeof window != 'undefined') { + + config.loaded_cb = function () { + App.init (); + }; + config.fetch_file_cb = function (asset) { + // console.log("fetch_file_cb('" + asset + "')"); + // for testing purposes add BCL assets to VFS until we special case File.Open + // to identify when an assembly from the BCL is being open and resolve it correctly. + /* + var content = new Uint8Array (read (asset, 'binary')); + var path = asset.substr(config.deploy_prefix.length); + writeContentToFile(content, path); + */ + + if (typeof window != 'undefined') { return fetch (asset, { credentials: 'same-origin' }); - } else { + } else { // The default mono_load_runtime_and_bcl defaults to using - // fetch to load the assets. It also provides a way to set a + // fetch to load the assets. It also provides a way to set a // fetch promise callback. // Here we wrap the file read in a promise and fake a fetch response // structure. - return new Promise((resolve, reject) => { - var response = { ok: true, url: asset, - arrayBuffer: function() { - return new Promise((resolve2, reject2) => { - resolve2(content); - } - )} + return new Promise ((resolve, reject) => { + var bytes = null, error = null; + try { + bytes = read (asset, 'binary'); + } catch (exc) { + error = exc; + } + var response = { ok: (bytes && !error), url: asset, + arrayBuffer: function () { + return new Promise ((resolve2, reject2) => { + if (error) + reject2 (error); + else + resolve2 (new Uint8Array (bytes)); + } + )} } - resolve(response) - }) - } + resolve (response); + }) } - ); + }; + + MONO.mono_load_runtime_and_bcl_args (config); }, }; @@ -388,4 +365,7 @@ var App = { fail_exec ("Unhanded argument: " + args [0]); } }, -}; + call_test_method: function (method_name, args) { + return BINDING.call_static_method("[System.Runtime.InteropServices.JavaScript.Tests]System.Runtime.InteropServices.JavaScript.Tests.HelperMarshal:" + method_name, args); + } +}; \ No newline at end of file diff --git a/src/mono/wasm/runtime/binding_support.js b/src/mono/wasm/runtime/binding_support.js index 184e84d9d206..bdef5f6ac5dc 100644 --- a/src/mono/wasm/runtime/binding_support.js +++ b/src/mono/wasm/runtime/binding_support.js @@ -761,6 +761,8 @@ var BindingSupportLib = { }, resolve_method_fqn: function (fqn) { + this.bindings_lazy_init (); + var assembly = fqn.substring(fqn.indexOf ("[") + 1, fqn.indexOf ("]")).trim(); fqn = fqn.substring (fqn.indexOf ("]") + 1).trim(); diff --git a/src/mono/wasm/runtime/driver.c b/src/mono/wasm/runtime/driver.c index 4643790337dc..e4456ee6b595 100644 --- a/src/mono/wasm/runtime/driver.c +++ b/src/mono/wasm/runtime/driver.c @@ -343,7 +343,7 @@ void mono_initialize_internals () } EMSCRIPTEN_KEEPALIVE void -mono_wasm_load_runtime (const char *managed_path, int enable_debugging) +mono_wasm_load_runtime (const char *unused, int enable_debugging) { const char *interp_opts = ""; @@ -355,9 +355,6 @@ mono_wasm_load_runtime (const char *managed_path, int enable_debugging) // corlib assemblies. monoeg_g_setenv ("COMPlus_DebugWriteToStdErr", "1", 0); #endif -#ifdef ENABLE_NETCORE - monoeg_g_setenv ("DOTNET_SYSTEM_GLOBALIZATION_INVARIANT", "1", 0); -#endif mini_parse_debug_option ("top-runtime-invoke-unhandled"); diff --git a/src/mono/wasm/runtime/library_mono.js b/src/mono/wasm/runtime/library_mono.js index 672eeffed1d8..e137e8940a0c 100644 --- a/src/mono/wasm/runtime/library_mono.js +++ b/src/mono/wasm/runtime/library_mono.js @@ -25,6 +25,11 @@ var MonoSupportLib = { export_functions: function (module) { module ["pump_message"] = MONO.pump_message; module ["mono_load_runtime_and_bcl"] = MONO.mono_load_runtime_and_bcl; + module ["mono_load_runtime_and_bcl_args"] = MONO.mono_load_runtime_and_bcl_args; + module ["mono_wasm_load_bytes_into_heap"] = MONO.mono_wasm_load_bytes_into_heap; + module ["mono_wasm_load_icu_data"] = MONO.mono_wasm_load_icu_data; + module ["mono_wasm_globalization_init"] = MONO.mono_wasm_globalization_init; + module ["mono_wasm_get_loaded_files"] = MONO.mono_wasm_get_loaded_files; }, mono_text_decoder: undefined, @@ -44,11 +49,11 @@ var MonoSupportLib = { decode: function (start, end, save) { if (!MONO.mono_text_decoder) { MONO.mono_text_decoder = typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-16le') : undefined; - } + } var str = ""; if (MONO.mono_text_decoder) { - // When threading is enabled, TextDecoder does not accept a view of a + // When threading is enabled, TextDecoder does not accept a view of a // SharedArrayBuffer, we must make a copy of the array first. var subArray = typeof SharedArrayBuffer !== 'undefined' && Module.HEAPU8.buffer instanceof SharedArrayBuffer ? Module.HEAPU8.slice(start, end) @@ -148,9 +153,8 @@ var MonoSupportLib = { var numBytes = var_list.length * Int32Array.BYTES_PER_ELEMENT; var ptr = Module._malloc(numBytes); var heapBytes = new Int32Array(Module.HEAP32.buffer, ptr, numBytes); - for (let i=0; i 0) + ? virtualName.substr(0, lastSlash) + : null; + var fileName = (lastSlash > 0) + ? virtualName.substr(lastSlash + 1) + : virtualName; + if (fileName.startsWith("/")) + fileName = fileName.substr(1); + + if (parentDirectory) { + if (ctx.tracing) + console.log ("MONO_WASM: Creating directory '" + parentDirectory + "'"); + + var pathRet = ctx.createPath( + "/", parentDirectory, true, true // fixme: should canWrite be false? + ); + } else { + parentDirectory = "/"; } + + if (ctx.tracing) + console.log ("MONO_WASM: Creating file '" + fileName + "' in directory '" + parentDirectory + "'"); + + var fileRet = ctx.createDataFile ( + parentDirectory, fileName, + bytes, true /* canRead */, true /* canWrite */, true /* canOwn */ + ); + + break; + + default: + throw new Error ("Unrecognized asset behavior:", asset.behavior, "for asset", asset.name); + } + + if (asset.behavior === "assembly") + ctx.mono_wasm_add_assembly (virtualName, offset, bytes.length); + else if (asset.behavior === "icu") { + if (this.mono_wasm_load_icu_data (offset)) + ctx.num_icu_assets_loaded_successfully += 1; + else + console.error ("Error loading ICU asset", asset.name); + } + }, + + // deprecated + mono_load_runtime_and_bcl: function ( + unused_vfs_prefix, deploy_prefix, enable_debugging, file_list, loaded_cb, fetch_file_cb + ) { + var args = { + fetch_file_cb: fetch_file_cb, + loaded_cb: loaded_cb, + enable_debugging: enable_debugging, + assembly_root: deploy_prefix, + assets: [] + }; + + for (var i = 0; i < file_list.length; i++) { + var file_name = file_list[i]; + var behavior; + if (file_name === "icudt.dat") + behavior = "icu"; + else // if (file_name.endsWith (".pdb") || file_name.endsWith (".dll")) + behavior = "assembly"; + + args.assets.push ({ + name: file_name, + behavior: behavior + }); + } + + return this.mono_load_runtime_and_bcl_args (args); + }, + + // Initializes the runtime and loads assemblies, debug information, and other files. + // @args is a dictionary-style Object with the following properties: + // assembly_root: (required) the subfolder containing managed assemblies and pdbs + // enable_debugging: (required) + // assets: (required) a list of assets to load along with the runtime. each asset + // is a dictionary-style Object with the following properties: + // name: (required) the name of the asset, including extension. + // behavior: (required) determines how the asset will be handled once loaded: + // "heap": store asset into the native heap + // "assembly": load asset as a managed assembly (or debugging information) + // "icu": load asset as an ICU data archive + // "vfs": load asset into the virtual filesystem (for fopen, File.Open, etc) + // load_remote: (optional) if true, an attempt will be made to load the asset + // from each location in @args.remote_sources. + // virtual_path: (optional) if specified, overrides the path of the asset in + // the virtual filesystem and similar data structures once loaded. + // is_optional: (optional) if true, any failure to load this asset will be ignored. + // loaded_cb: (required) a function () invoked when loading has completed. + // fetch_file_cb: (optional) a function (string) invoked to fetch a given file. + // If no callback is provided a default implementation appropriate for the current + // environment will be selected (readFileSync in node, fetch elsewhere). + // If no default implementation is available this call will fail. + // remote_sources: (optional) additional search locations for assets. + // sources will be checked in sequential order until the asset is found. + // the string "./" indicates to load from the application directory (as with the + // files in assembly_list), and a fully-qualified URL like "https://example.com/" indicates + // that asset loads can be attempted from a remote server. Sources must end with a "/". + // environment_variables: (optional) dictionary-style Object containing environment variables + // runtime_options: (optional) array of runtime options as strings + // aot_profiler_options: (optional) dictionary-style Object. see the comments for + // mono_wasm_init_aot_profiler. If omitted, aot profiler will not be initialized. + // coverage_profiler_options: (optional) dictionary-style Object. see the comments for + // mono_wasm_init_coverage_profiler. If omitted, coverage profiler will not be initialized. + // globalization_mode: (optional) configures the runtime's globalization mode: + // "icu": load ICU globalization data from any runtime assets with behavior "icu". + // "invariant": operate in invariant globalization mode. + // "auto" (default): if "icu" behavior assets are present, use ICU, otherwise invariant. + // diagnostic_tracing: (optional) enables diagnostic log messages during startup + mono_load_runtime_and_bcl_args: function (args) { + try { + return this._load_assets_and_runtime (args); + } catch (exc) { + console.error ("error in mono_load_runtime_and_bcl_args:", exc); + throw exc; + } + }, + + // @bytes must be a typed array. space is allocated for it in the native heap + // and it is copied to that location. returns the address of the allocation. + mono_wasm_load_bytes_into_heap: function (bytes) { + var memoryOffset = Module._malloc (bytes.length); + var heapBytes = new Uint8Array (Module.HEAPU8.buffer, memoryOffset, bytes.length); + heapBytes.set (bytes); + return memoryOffset; + }, + + num_icu_assets_loaded_successfully: 0, + + // @offset must be the address of an ICU data archive in the native heap. + // returns true on success. + mono_wasm_load_icu_data: function (offset) { + var fn = Module.cwrap ('mono_wasm_load_icu_data', 'number', ['number']); + var ok = (fn (offset)) === 1; + if (ok) + this.num_icu_assets_loaded_successfully++; + return ok; + }, + + _finalize_startup: function (args, ctx) { + MONO.loaded_assets = ctx.loaded_assets; + MONO.loaded_files = ctx.loaded_files; + if (ctx.tracing) { + console.log ("MONO_WASM: loaded_assets: " + JSON.stringify(ctx.loaded_assets)); + console.log ("MONO_WASM: loaded_files: " + JSON.stringify(ctx.loaded_files)); + } + + var load_runtime = Module.cwrap ('mono_wasm_load_runtime', null, ['string', 'number']); + + console.log ("MONO_WASM: Initializing mono runtime"); + + this.mono_wasm_globalization_init (args.globalization_mode); + + if (ENVIRONMENT_IS_SHELL || ENVIRONMENT_IS_NODE) { + try { + load_runtime ("unused", args.enable_debugging); + } catch (ex) { + print ("MONO_WASM: load_runtime () failed: " + ex); + var err = new Error(); + print ("MONO_WASM: Stacktrace: \n"); + print (err.stack); + + var wasm_exit = Module.cwrap ('mono_wasm_exit', null, ['number']); + wasm_exit (1); } + } else { + load_runtime ("unused", args.enable_debugging); } - file_list.forEach (function(file_name) { - - var fetch_promise = fetch_file_cb (locateFile(deploy_prefix + "/" + file_name)); + MONO.mono_wasm_runtime_ready (); + args.loaded_cb (); + }, + + _load_assets_and_runtime: function (args) { + if (args.assembly_list) + throw new Error ("Invalid args (assembly_list was replaced by assets)"); + if (args.runtime_assets) + throw new Error ("Invalid args (runtime_assets was replaced by assets)"); + if (args.runtime_asset_sources) + throw new Error ("Invalid args (runtime_asset_sources was replaced by remote_sources)"); + if (!args.loaded_cb) + throw new Error ("loaded_cb not provided"); + + var ctx = { + tracing: args.diagnostic_tracing || false, + pending_count: args.assets.length, + mono_wasm_add_assembly: Module.cwrap ('mono_wasm_add_assembly', null, ['string', 'number', 'number']), + loaded_assets: Object.create (null), + // dlls and pdbs, used by blazor and the debugger + loaded_files: [], + createPath: Module['FS_createPath'], + createDataFile: Module['FS_createDataFile'] + }; + + if (ctx.tracing) + console.log ("mono_wasm_load_runtime_with_args", JSON.stringify(args)); + + this._apply_configuration_from_args (args); + + var fetch_file_cb = this._get_fetch_file_cb_from_args (args); - fetch_promise.then (function (response) { + var onPendingRequestComplete = function () { + --ctx.pending_count; + + if (ctx.pending_count === 0) { + try { + MONO._finalize_startup (args, ctx); + } catch (exc) { + console.error ("Unhandled exception in _finalize_startup", exc); + throw exc; + } + } + }; + + var processFetchResponseBuffer = function (asset, url, blob) { + try { + MONO._handle_loaded_asset (ctx, asset, url, blob); + } catch (exc) { + console.error ("Unhandled exception in processFetchResponseBuffer", exc); + throw exc; + } finally { + onPendingRequestComplete (); + } + }; + + args.assets.forEach (function (asset) { + var attemptNextSource; + var sourceIndex = 0; + var sourcesList = asset.load_remote ? args.remote_sources : [""]; + + var handleFetchResponse = function (response) { if (!response.ok) { - // If it's a 404 on a .pdb, we don't want to block the app from starting up. - // We'll just skip that file and continue (though the 404 is logged in the console). - if (response.status === 404 && file_name.match(/\.pdb$/) && MONO.mono_wasm_ignore_pdb_load_errors) { - --pending; - throw "MONO-WASM: Skipping failed load for .pdb file: '" + file_name + "'"; - } - else { - throw "MONO_WASM: Failed to load file: '" + file_name + "'"; + try { + attemptNextSource (); + return; + } catch (exc) { + console.error ("MONO_WASM: Unhandled exception in handleFetchResponse attemptNextSource for asset", asset.name, exc); + throw exc; } } - else { - loaded_files.push (response.url); - return response ['arrayBuffer'] (); + + try { + var bufferPromise = response ['arrayBuffer'] (); + bufferPromise.then (processFetchResponseBuffer.bind (this, asset, response.url)); + } catch (exc) { + console.error ("MONO_WASM: Unhandled exception in handleFetchResponse for asset", asset.name, exc); + attemptNextSource (); } - }).then (function (blob) { - var asm = new Uint8Array (blob); - var memory = Module._malloc(asm.length); - var heapBytes = new Uint8Array(Module.HEAPU8.buffer, memory, asm.length); - heapBytes.set (asm); - mono_wasm_add_assembly (file_name, memory, asm.length); - - //console.log ("MONO_WASM: Loaded: " + file_name); - --pending; - if (pending == 0) { - MONO.loaded_files = loaded_files; - var load_runtime = Module.cwrap ('mono_wasm_load_runtime', null, ['string', 'number']); - - console.log ("MONO_WASM: Initializing mono runtime"); - if (ENVIRONMENT_IS_SHELL || ENVIRONMENT_IS_NODE) { - try { - load_runtime (vfs_prefix, enable_debugging); - } catch (ex) { - print ("MONO_WASM: load_runtime () failed: " + ex); - var err = new Error(); - print ("MONO_WASM: Stacktrace: \n"); - print (err.stack); - - var wasm_exit = Module.cwrap ('mono_wasm_exit', null, ['number']); - wasm_exit (1); + }; + + attemptNextSource = function () { + if (sourceIndex >= sourcesList.length) { + var msg = "MONO_WASM: Failed to load " + asset.name; + try { + var isOk = asset.is_optional || + (asset.name.match (/\.pdb$/) && MONO.mono_wasm_ignore_pdb_load_errors); + + if (isOk) + console.log (msg); + else { + console.error (msg); + throw new Error (msg); } + } finally { + onPendingRequestComplete (); + } + } + + var sourcePrefix = sourcesList[sourceIndex]; + sourceIndex++; + + // HACK: Special-case because MSBuild doesn't allow "" as an attribute + if (sourcePrefix === "./") + sourcePrefix = ""; + + var attemptUrl; + if (sourcePrefix.trim() === "") { + if (asset.behavior === "assembly") + attemptUrl = locateFile (args.assembly_root + "/" + asset.name); + else + attemptUrl = asset.name; + } else { + attemptUrl = sourcePrefix + asset.name; + } + + try { + if (asset.name === attemptUrl) { + if (ctx.tracing) + console.log ("Attempting to fetch '" + attemptUrl + "'"); } else { - load_runtime (vfs_prefix, enable_debugging); + if (ctx.tracing) + console.log ("Attempting to fetch '" + attemptUrl + "' for", asset.name); } - MONO.mono_wasm_runtime_ready (); - loaded_cb (); + var fetch_promise = fetch_file_cb (attemptUrl); + fetch_promise.then (handleFetchResponse); + } catch (exc) { + console.error ("MONO_WASM: Error fetching " + attemptUrl, exc); + attemptNextSource (); } - }); + }; + + attemptNextSource (); }); }, + // Performs setup for globalization. + // @globalization_mode is one of "icu", "invariant", or "auto". + // "auto" will use "icu" if any ICU data archives have been loaded, + // otherwise "invariant". + mono_wasm_globalization_init: function (globalization_mode) { + var invariantMode = false; + + if (globalization_mode === "invariant") + invariantMode = true; + + if (!invariantMode) { + if (this.num_icu_assets_loaded_successfully > 0) { + console.log ("MONO_WASM: ICU data archive(s) loaded, disabling invariant mode"); + } else if (globalization_mode !== "icu") { + console.log ("MONO_WASM: ICU data archive(s) not loaded, using invariant globalization mode"); + invariantMode = true; + } else { + var msg = "invariant globalization mode is inactive and no ICU data archives were loaded"; + console.error ("MONO_WASM: ERROR: " + msg); + throw new Error (msg); + } + } + + if (invariantMode) + this.mono_wasm_setenv ("DOTNET_SYSTEM_GLOBALIZATION_INVARIANT", "1"); + }, + + // Used by the debugger to enumerate loaded dlls and pdbs mono_wasm_get_loaded_files: function() { - console.log(">>>mono_wasm_get_loaded_files"); - return this.loaded_files; + return MONO.loaded_files; }, - + + mono_wasm_get_loaded_asset_table: function() { + return MONO.loaded_assets; + }, + mono_wasm_clear_all_breakpoints: function() { if (!this.mono_clear_bps) this.mono_clear_bps = Module.cwrap ('mono_wasm_clear_all_breakpoints', null); this.mono_clear_bps (); }, - + mono_wasm_add_null_var: function(className) { fixed_class_name = MONO._mono_csharp_fixup_class_name(Module.UTF8ToString (className)); @@ -807,7 +1129,7 @@ var MonoSupportLib = { if (m!= null) { if (m.length > 2) folders.add(m.slice(0,m.length-1).join('/')); folders.add(m[0]); - } + } }); folders.forEach(folder => { Module['FS_createPath'](prefix, folder, true, true); diff --git a/src/mono/wasm/wasm.targets b/src/mono/wasm/wasm.targets index 1a1a6d80f211..520dd9c7d7b2 100644 --- a/src/mono/wasm/wasm.targets +++ b/src/mono/wasm/wasm.targets @@ -17,11 +17,9 @@ - - diff --git a/src/tests/Interop/LayoutClass/LayoutClassNative.cpp b/src/tests/Interop/LayoutClass/LayoutClassNative.cpp index e7980b745daa..0bf0af967f06 100644 --- a/src/tests/Interop/LayoutClass/LayoutClassNative.cpp +++ b/src/tests/Interop/LayoutClass/LayoutClassNative.cpp @@ -8,21 +8,21 @@ typedef void *voidPtr; struct SeqClass { - int a; + int a; bool b; char* str; }; struct ExpClass { - int a; - int extra; //padding needs to be added here as we have added 8 byte offset. - union - { - int i; - BOOL b; - double d; - } udata; + int a; + int padding; //padding needs to be added here as we have added 8 byte offset. + union + { + int i; + BOOL b; + double d; + } udata; }; struct BlittableClass @@ -36,43 +36,55 @@ struct NestedLayoutClass }; extern "C" -DLL_EXPORT BOOL STDMETHODCALLTYPE SimpleSeqLayoutClassByRef(SeqClass *p) +DLL_EXPORT BOOL STDMETHODCALLTYPE SimpleSeqLayoutClassByRef(SeqClass* p) { if((p->a != 0) || (p->b) || strcmp(p->str, "before") != 0) { - printf("\np->a=%d, p->b=%s, p->str=%s", p->a, p->b ? "true" : "false", p->str); + printf("FAIL: p->a=%d, p->b=%s, p->str=%s\n", p->a, p->b ? "true" : "false", p->str); + return FALSE; + } + return TRUE; +} + +extern "C" +DLL_EXPORT BOOL STDMETHODCALLTYPE SimpleExpLayoutClassByRef(ExpClass* p) +{ + if((p->a != 0) || (p->udata.i != 10)) + { + printf("FAIL: p->a=%d, p->udata.i=%d\n",p->a,p->udata.i); return FALSE; } return TRUE; } extern "C" -DLL_EXPORT BOOL STDMETHODCALLTYPE SimpleBlittableSeqLayoutClassByRef(BlittableClass *p) +DLL_EXPORT BOOL STDMETHODCALLTYPE SimpleBlittableSeqLayoutClassByRef(BlittableClass* p) { if(p->a != 10) { - printf("\np->a=%d", p->a); + printf("FAIL: p->a=%d\n", p->a); return FALSE; } return TRUE; } extern "C" -DLL_EXPORT BOOL STDMETHODCALLTYPE SimpleExpLayoutClassByRef(ExpClass *p) +DLL_EXPORT BOOL STDMETHODCALLTYPE SimpleBlittableSeqLayoutClassByOutAttr(BlittableClass* p) { - if((p->a != 0) || (p->udata.i != 10)) - { - printf("\np->a=%d, p->udata.i=%d\n",p->a,p->udata.i); - return FALSE; - } - return TRUE; + if(!SimpleBlittableSeqLayoutClassByRef(p)) + return FALSE; + + p->a++; + return TRUE; } -extern "C" DLL_EXPORT BOOL STDMETHODCALLTYPE SimpleNestedLayoutClassByValue(NestedLayoutClass v) +extern "C" +DLL_EXPORT BOOL STDMETHODCALLTYPE SimpleNestedLayoutClassByValue(NestedLayoutClass v) { return SimpleSeqLayoutClassByRef(&v.str); } -extern "C" DLL_EXPORT void __cdecl Invalid(...) +extern "C" +DLL_EXPORT void __cdecl Invalid(...) { } diff --git a/src/tests/Interop/LayoutClass/LayoutClassTest.cs b/src/tests/Interop/LayoutClass/LayoutClassTest.cs index 63b52deb3ef4..32ecfcb3548f 100644 --- a/src/tests/Interop/LayoutClass/LayoutClassTest.cs +++ b/src/tests/Interop/LayoutClass/LayoutClassTest.cs @@ -18,7 +18,7 @@ public SeqClass(int _a, bool _b, string _str) { a = _a; b = _b; - str = String.Concat(_str, ""); + str = string.Concat(_str, ""); } } @@ -58,7 +58,7 @@ public ExpClass(DialogResult t, bool bnum) c = 0; b = bnum; } - } + } public enum DialogResult { @@ -67,7 +67,6 @@ public enum DialogResult Cancel = 2 } - [StructLayout(LayoutKind.Sequential)] public class Blittable { @@ -84,7 +83,6 @@ public struct NestedLayout public SeqClass value; } - [StructLayout(LayoutKind.Sequential)] public class RecursiveTestClass { @@ -105,155 +103,91 @@ class StructureTests private static extern bool SimpleExpLayoutClassByRef(ExpClass p); [DllImport("LayoutClassNative")] - private static extern bool SimpleNestedLayoutClassByValue(NestedLayout p); + private static extern bool SimpleBlittableSeqLayoutClassByRef(Blittable p); [DllImport("LayoutClassNative")] - private static extern bool SimpleBlittableSeqLayoutClassByRef(Blittable p); + private static extern bool SimpleBlittableSeqLayoutClassByOutAttr([Out] Blittable p); + + [DllImport("LayoutClassNative")] + private static extern bool SimpleNestedLayoutClassByValue(NestedLayout p); [DllImport("LayoutClassNative", EntryPoint = "Invalid")] private static extern void RecursiveNativeLayoutInvalid(RecursiveTestStruct str); - public static bool SequentialClass() + public static void SequentialClass() { - string s = "before"; - bool retval = true; - SeqClass p = new SeqClass(0, false, s); - - TestFramework.BeginScenario("Test #1 Pass a sequential layout class."); - - try - { - retval = SimpleSeqLayoutClassByRef(p); - - if (retval == false) - { - TestFramework.LogError("01", "PInvokeTests->SequentialClass : Unexpected error occured on unmanaged side"); - return false; - } - } - catch (Exception e) - { - TestFramework.LogError("04", "Unexpected exception: " + e.ToString()); - retval = false; - } + Console.WriteLine($"Running {nameof(SequentialClass)}..."); - return retval; + string s = "before"; + var p = new SeqClass(0, false, s); + Assert.IsTrue(SimpleSeqLayoutClassByRef(p)); } - public static bool ExplicitClass() + public static void ExplicitClass() { - ExpClass p; - bool retval = false; - - TestFramework.BeginScenario("Test #2 Pass an explicit layout class."); - - try - { - p = new ExpClass(DialogResult.None, 10); - retval = SimpleExpLayoutClassByRef(p); - - if (retval == false) - { - TestFramework.LogError("01", "PInvokeTests->ExplicitClass : Unexpected error occured on unmanaged side"); - return false; - } + Console.WriteLine($"Running {nameof(ExplicitClass)}..."); - } - catch (Exception e) - { - TestFramework.LogError("03", "Unexpected exception: " + e.ToString()); - retval = false; - } - - return retval; + var p = new ExpClass(DialogResult.None, 10); + Assert.IsTrue(SimpleExpLayoutClassByRef(p)); } - public static bool BlittableClass() + public static void BlittableClass() { - bool retval = true; - Blittable p = new Blittable(10); + Console.WriteLine($"Running {nameof(BlittableClass)}..."); - TestFramework.BeginScenario("Test #3 Pass a blittable sequential layout class."); - - try - { - retval = SimpleBlittableSeqLayoutClassByRef(p); + Blittable p = new Blittable(10); + Assert.IsTrue(SimpleBlittableSeqLayoutClassByRef(p)); + } - if (retval == false) - { - TestFramework.LogError("01", "PInvokeTests->Blittable : Unexpected error occured on unmanaged side"); - return false; - } - } - catch (Exception e) - { - TestFramework.LogError("04", "Unexpected exception: " + e.ToString()); - retval = false; - } + public static void BlittableClassByOutAttr() + { + Console.WriteLine($"Running {nameof(BlittableClassByOutAttr)}..."); - return retval; + int a = 10; + int expected = a + 1; + Blittable p = new Blittable(a); + Assert.IsTrue(SimpleBlittableSeqLayoutClassByOutAttr(p)); + Assert.AreEqual(expected, p.a); } - - public static bool NestedLayoutClass() + + public static void NestedLayoutClass() { + Console.WriteLine($"Running {nameof(NestedLayoutClass)}..."); + string s = "before"; - bool retval = true; - SeqClass p = new SeqClass(0, false, s); - NestedLayout target = new NestedLayout + var p = new SeqClass(0, false, s); + var target = new NestedLayout { value = p }; + Assert.IsTrue(SimpleNestedLayoutClassByValue(target)); + } - TestFramework.BeginScenario("Test #4 Nested sequential layout class in a structure."); - - try - { - retval = SimpleNestedLayoutClassByValue(target); - - if (retval == false) - { - TestFramework.LogError("01", "PInvokeTests->NestedLayoutClass : Unexpected error occured on unmanaged side"); - return false; - } - } - catch (Exception e) - { - TestFramework.LogError("04", "Unexpected exception: " + e.ToString()); - retval = false; - } + public static void RecursiveNativeLayout() + { + Console.WriteLine($"Running {nameof(RecursiveNativeLayout)}..."); - return retval; + Assert.Throws(() => RecursiveNativeLayoutInvalid(new RecursiveTestStruct())); } - public static bool RecursiveNativeLayout() + public static int Main(string[] argv) { - TestFramework.BeginScenario("Test #5 Structure with field of nested layout class with field of containing structure."); - try { - RecursiveNativeLayoutInvalid(new RecursiveTestStruct()); + SequentialClass(); + ExplicitClass(); + BlittableClass(); + BlittableClassByOutAttr(); + NestedLayoutClass(); + RecursiveNativeLayout(); } - catch (TypeLoadException) + catch (Exception e) { - return true; + Console.WriteLine($"Test Failure: {e}"); + return 101; } - return false; + return 100; } - - public static int Main(string[] argv) - { - bool retVal = true; - - retVal = retVal && SequentialClass(); - retVal = retVal && ExplicitClass(); - retVal = retVal && BlittableClass(); - retVal = retVal && NestedLayoutClass(); - retVal = retVal && RecursiveNativeLayout(); - - return (retVal ? 100 : 101); - } - - } } diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part1_r.csproj b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part1_r.csproj index db6e55f6e101..8f551beaefa2 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part1_r.csproj +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part1_r.csproj @@ -181,6 +181,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -218,52 +264,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part1_ro.csproj b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part1_ro.csproj index a5f23bed092a..4941c87b8d58 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part1_ro.csproj +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part1_ro.csproj @@ -181,6 +181,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -218,52 +264,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part2_r.csproj b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part2_r.csproj index 479e102a6768..57b35cfad4f1 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part2_r.csproj +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part2_r.csproj @@ -8,6 +8,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part2_ro.csproj b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part2_ro.csproj index aa5842329cc6..fd6c1b8a634a 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part2_ro.csproj +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AdvSimd.Arm64_Part2_ro.csproj @@ -8,6 +8,52 @@ True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/Program.AdvSimd.Arm64_Part1.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/Program.AdvSimd.Arm64_Part1.cs index 514782f28c0e..194a1238d81c 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/Program.AdvSimd.Arm64_Part1.cs +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/Program.AdvSimd.Arm64_Part1.cs @@ -184,6 +184,52 @@ static Program() ["Sqrt.Vector64.Single"] = Sqrt_Vector64_Single, ["Sqrt.Vector128.Double"] = Sqrt_Vector128_Double, ["Sqrt.Vector128.Single"] = Sqrt_Vector128_Single, + ["StorePair.Vector64.Byte"] = StorePair_Vector64_Byte, + ["StorePair.Vector64.Double"] = StorePair_Vector64_Double, + ["StorePair.Vector64.Int16"] = StorePair_Vector64_Int16, + ["StorePair.Vector64.Int32"] = StorePair_Vector64_Int32, + ["StorePair.Vector64.Int64"] = StorePair_Vector64_Int64, + ["StorePair.Vector64.SByte"] = StorePair_Vector64_SByte, + ["StorePair.Vector64.Single"] = StorePair_Vector64_Single, + ["StorePair.Vector64.UInt16"] = StorePair_Vector64_UInt16, + ["StorePair.Vector64.UInt32"] = StorePair_Vector64_UInt32, + ["StorePair.Vector64.UInt64"] = StorePair_Vector64_UInt64, + ["StorePair.Vector128.Byte"] = StorePair_Vector128_Byte, + ["StorePair.Vector128.Double"] = StorePair_Vector128_Double, + ["StorePair.Vector128.Int16"] = StorePair_Vector128_Int16, + ["StorePair.Vector128.Int32"] = StorePair_Vector128_Int32, + ["StorePair.Vector128.Int64"] = StorePair_Vector128_Int64, + ["StorePair.Vector128.SByte"] = StorePair_Vector128_SByte, + ["StorePair.Vector128.Single"] = StorePair_Vector128_Single, + ["StorePair.Vector128.UInt16"] = StorePair_Vector128_UInt16, + ["StorePair.Vector128.UInt32"] = StorePair_Vector128_UInt32, + ["StorePair.Vector128.UInt64"] = StorePair_Vector128_UInt64, + ["StorePairScalar.Vector64.Int32"] = StorePairScalar_Vector64_Int32, + ["StorePairScalar.Vector64.Single"] = StorePairScalar_Vector64_Single, + ["StorePairScalar.Vector64.UInt32"] = StorePairScalar_Vector64_UInt32, + ["StorePairScalarNonTemporal.Vector64.Int32"] = StorePairScalarNonTemporal_Vector64_Int32, + ["StorePairScalarNonTemporal.Vector64.Single"] = StorePairScalarNonTemporal_Vector64_Single, + ["StorePairScalarNonTemporal.Vector64.UInt32"] = StorePairScalarNonTemporal_Vector64_UInt32, + ["StorePairNonTemporal.Vector64.Byte"] = StorePairNonTemporal_Vector64_Byte, + ["StorePairNonTemporal.Vector64.Double"] = StorePairNonTemporal_Vector64_Double, + ["StorePairNonTemporal.Vector64.Int16"] = StorePairNonTemporal_Vector64_Int16, + ["StorePairNonTemporal.Vector64.Int32"] = StorePairNonTemporal_Vector64_Int32, + ["StorePairNonTemporal.Vector64.Int64"] = StorePairNonTemporal_Vector64_Int64, + ["StorePairNonTemporal.Vector64.SByte"] = StorePairNonTemporal_Vector64_SByte, + ["StorePairNonTemporal.Vector64.Single"] = StorePairNonTemporal_Vector64_Single, + ["StorePairNonTemporal.Vector64.UInt16"] = StorePairNonTemporal_Vector64_UInt16, + ["StorePairNonTemporal.Vector64.UInt32"] = StorePairNonTemporal_Vector64_UInt32, + ["StorePairNonTemporal.Vector64.UInt64"] = StorePairNonTemporal_Vector64_UInt64, + ["StorePairNonTemporal.Vector128.Byte"] = StorePairNonTemporal_Vector128_Byte, + ["StorePairNonTemporal.Vector128.Double"] = StorePairNonTemporal_Vector128_Double, + ["StorePairNonTemporal.Vector128.Int16"] = StorePairNonTemporal_Vector128_Int16, + ["StorePairNonTemporal.Vector128.Int32"] = StorePairNonTemporal_Vector128_Int32, + ["StorePairNonTemporal.Vector128.Int64"] = StorePairNonTemporal_Vector128_Int64, + ["StorePairNonTemporal.Vector128.SByte"] = StorePairNonTemporal_Vector128_SByte, + ["StorePairNonTemporal.Vector128.Single"] = StorePairNonTemporal_Vector128_Single, + ["StorePairNonTemporal.Vector128.UInt16"] = StorePairNonTemporal_Vector128_UInt16, + ["StorePairNonTemporal.Vector128.UInt32"] = StorePairNonTemporal_Vector128_UInt32, + ["StorePairNonTemporal.Vector128.UInt64"] = StorePairNonTemporal_Vector128_UInt64, ["Subtract.Vector128.Double"] = Subtract_Vector128_Double, ["SubtractSaturateScalar.Vector64.Byte"] = SubtractSaturateScalar_Vector64_Byte, ["SubtractSaturateScalar.Vector64.Int16"] = SubtractSaturateScalar_Vector64_Int16, @@ -221,52 +267,6 @@ static Program() ["TransposeOdd.Vector128.Int32"] = TransposeOdd_Vector128_Int32, ["TransposeOdd.Vector128.Int64"] = TransposeOdd_Vector128_Int64, ["TransposeOdd.Vector128.SByte"] = TransposeOdd_Vector128_SByte, - ["TransposeOdd.Vector128.Single"] = TransposeOdd_Vector128_Single, - ["TransposeOdd.Vector128.UInt16"] = TransposeOdd_Vector128_UInt16, - ["TransposeOdd.Vector128.UInt32"] = TransposeOdd_Vector128_UInt32, - ["TransposeOdd.Vector128.UInt64"] = TransposeOdd_Vector128_UInt64, - ["VectorTableLookup.Vector128.Byte"] = VectorTableLookup_Vector128_Byte, - ["VectorTableLookup.Vector128.SByte"] = VectorTableLookup_Vector128_SByte, - ["VectorTableLookupExtension.Vector128.Byte"] = VectorTableLookupExtension_Vector128_Byte, - ["VectorTableLookupExtension.Vector128.SByte"] = VectorTableLookupExtension_Vector128_SByte, - ["UnzipEven.Vector64.Byte"] = UnzipEven_Vector64_Byte, - ["UnzipEven.Vector64.Int16"] = UnzipEven_Vector64_Int16, - ["UnzipEven.Vector64.Int32"] = UnzipEven_Vector64_Int32, - ["UnzipEven.Vector64.SByte"] = UnzipEven_Vector64_SByte, - ["UnzipEven.Vector64.Single"] = UnzipEven_Vector64_Single, - ["UnzipEven.Vector64.UInt16"] = UnzipEven_Vector64_UInt16, - ["UnzipEven.Vector64.UInt32"] = UnzipEven_Vector64_UInt32, - ["UnzipEven.Vector128.Byte"] = UnzipEven_Vector128_Byte, - ["UnzipEven.Vector128.Double"] = UnzipEven_Vector128_Double, - ["UnzipEven.Vector128.Int16"] = UnzipEven_Vector128_Int16, - ["UnzipEven.Vector128.Int32"] = UnzipEven_Vector128_Int32, - ["UnzipEven.Vector128.Int64"] = UnzipEven_Vector128_Int64, - ["UnzipEven.Vector128.SByte"] = UnzipEven_Vector128_SByte, - ["UnzipEven.Vector128.Single"] = UnzipEven_Vector128_Single, - ["UnzipEven.Vector128.UInt16"] = UnzipEven_Vector128_UInt16, - ["UnzipEven.Vector128.UInt32"] = UnzipEven_Vector128_UInt32, - ["UnzipEven.Vector128.UInt64"] = UnzipEven_Vector128_UInt64, - ["UnzipOdd.Vector64.Byte"] = UnzipOdd_Vector64_Byte, - ["UnzipOdd.Vector64.Int16"] = UnzipOdd_Vector64_Int16, - ["UnzipOdd.Vector64.Int32"] = UnzipOdd_Vector64_Int32, - ["UnzipOdd.Vector64.SByte"] = UnzipOdd_Vector64_SByte, - ["UnzipOdd.Vector64.Single"] = UnzipOdd_Vector64_Single, - ["UnzipOdd.Vector64.UInt16"] = UnzipOdd_Vector64_UInt16, - ["UnzipOdd.Vector64.UInt32"] = UnzipOdd_Vector64_UInt32, - ["UnzipOdd.Vector128.Byte"] = UnzipOdd_Vector128_Byte, - ["UnzipOdd.Vector128.Double"] = UnzipOdd_Vector128_Double, - ["UnzipOdd.Vector128.Int16"] = UnzipOdd_Vector128_Int16, - ["UnzipOdd.Vector128.Int32"] = UnzipOdd_Vector128_Int32, - ["UnzipOdd.Vector128.Int64"] = UnzipOdd_Vector128_Int64, - ["UnzipOdd.Vector128.SByte"] = UnzipOdd_Vector128_SByte, - ["UnzipOdd.Vector128.Single"] = UnzipOdd_Vector128_Single, - ["UnzipOdd.Vector128.UInt16"] = UnzipOdd_Vector128_UInt16, - ["UnzipOdd.Vector128.UInt32"] = UnzipOdd_Vector128_UInt32, - ["UnzipOdd.Vector128.UInt64"] = UnzipOdd_Vector128_UInt64, - ["ZipHigh.Vector64.Byte"] = ZipHigh_Vector64_Byte, - ["ZipHigh.Vector64.Int16"] = ZipHigh_Vector64_Int16, - ["ZipHigh.Vector64.Int32"] = ZipHigh_Vector64_Int32, - ["ZipHigh.Vector64.SByte"] = ZipHigh_Vector64_SByte, }; } } diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/Program.AdvSimd.Arm64_Part2.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/Program.AdvSimd.Arm64_Part2.cs index a1796b105574..934d1df2c4ed 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/Program.AdvSimd.Arm64_Part2.cs +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/Program.AdvSimd.Arm64_Part2.cs @@ -11,6 +11,52 @@ public static partial class Program static Program() { TestList = new Dictionary() { + ["TransposeOdd.Vector128.Single"] = TransposeOdd_Vector128_Single, + ["TransposeOdd.Vector128.UInt16"] = TransposeOdd_Vector128_UInt16, + ["TransposeOdd.Vector128.UInt32"] = TransposeOdd_Vector128_UInt32, + ["TransposeOdd.Vector128.UInt64"] = TransposeOdd_Vector128_UInt64, + ["VectorTableLookup.Vector128.Byte"] = VectorTableLookup_Vector128_Byte, + ["VectorTableLookup.Vector128.SByte"] = VectorTableLookup_Vector128_SByte, + ["VectorTableLookupExtension.Vector128.Byte"] = VectorTableLookupExtension_Vector128_Byte, + ["VectorTableLookupExtension.Vector128.SByte"] = VectorTableLookupExtension_Vector128_SByte, + ["UnzipEven.Vector64.Byte"] = UnzipEven_Vector64_Byte, + ["UnzipEven.Vector64.Int16"] = UnzipEven_Vector64_Int16, + ["UnzipEven.Vector64.Int32"] = UnzipEven_Vector64_Int32, + ["UnzipEven.Vector64.SByte"] = UnzipEven_Vector64_SByte, + ["UnzipEven.Vector64.Single"] = UnzipEven_Vector64_Single, + ["UnzipEven.Vector64.UInt16"] = UnzipEven_Vector64_UInt16, + ["UnzipEven.Vector64.UInt32"] = UnzipEven_Vector64_UInt32, + ["UnzipEven.Vector128.Byte"] = UnzipEven_Vector128_Byte, + ["UnzipEven.Vector128.Double"] = UnzipEven_Vector128_Double, + ["UnzipEven.Vector128.Int16"] = UnzipEven_Vector128_Int16, + ["UnzipEven.Vector128.Int32"] = UnzipEven_Vector128_Int32, + ["UnzipEven.Vector128.Int64"] = UnzipEven_Vector128_Int64, + ["UnzipEven.Vector128.SByte"] = UnzipEven_Vector128_SByte, + ["UnzipEven.Vector128.Single"] = UnzipEven_Vector128_Single, + ["UnzipEven.Vector128.UInt16"] = UnzipEven_Vector128_UInt16, + ["UnzipEven.Vector128.UInt32"] = UnzipEven_Vector128_UInt32, + ["UnzipEven.Vector128.UInt64"] = UnzipEven_Vector128_UInt64, + ["UnzipOdd.Vector64.Byte"] = UnzipOdd_Vector64_Byte, + ["UnzipOdd.Vector64.Int16"] = UnzipOdd_Vector64_Int16, + ["UnzipOdd.Vector64.Int32"] = UnzipOdd_Vector64_Int32, + ["UnzipOdd.Vector64.SByte"] = UnzipOdd_Vector64_SByte, + ["UnzipOdd.Vector64.Single"] = UnzipOdd_Vector64_Single, + ["UnzipOdd.Vector64.UInt16"] = UnzipOdd_Vector64_UInt16, + ["UnzipOdd.Vector64.UInt32"] = UnzipOdd_Vector64_UInt32, + ["UnzipOdd.Vector128.Byte"] = UnzipOdd_Vector128_Byte, + ["UnzipOdd.Vector128.Double"] = UnzipOdd_Vector128_Double, + ["UnzipOdd.Vector128.Int16"] = UnzipOdd_Vector128_Int16, + ["UnzipOdd.Vector128.Int32"] = UnzipOdd_Vector128_Int32, + ["UnzipOdd.Vector128.Int64"] = UnzipOdd_Vector128_Int64, + ["UnzipOdd.Vector128.SByte"] = UnzipOdd_Vector128_SByte, + ["UnzipOdd.Vector128.Single"] = UnzipOdd_Vector128_Single, + ["UnzipOdd.Vector128.UInt16"] = UnzipOdd_Vector128_UInt16, + ["UnzipOdd.Vector128.UInt32"] = UnzipOdd_Vector128_UInt32, + ["UnzipOdd.Vector128.UInt64"] = UnzipOdd_Vector128_UInt64, + ["ZipHigh.Vector64.Byte"] = ZipHigh_Vector64_Byte, + ["ZipHigh.Vector64.Int16"] = ZipHigh_Vector64_Int16, + ["ZipHigh.Vector64.Int32"] = ZipHigh_Vector64_Int32, + ["ZipHigh.Vector64.SByte"] = ZipHigh_Vector64_SByte, ["ZipHigh.Vector64.Single"] = ZipHigh_Vector64_Single, ["ZipHigh.Vector64.UInt16"] = ZipHigh_Vector64_UInt16, ["ZipHigh.Vector64.UInt32"] = ZipHigh_Vector64_UInt32, diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.Byte.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.Byte.cs new file mode 100644 index 000000000000..8e3dbfa86819 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.Byte.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector128_Byte() + { + var test = new StoreBinaryOpTest__StorePair_Vector128_Byte(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector128_Byte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector128_Byte testClass) + { + AdvSimd.Arm64.StorePair((Byte*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector128_Byte testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Byte*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((Byte*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector128_Byte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector128_Byte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (Byte*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Byte*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Byte*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Byte*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Byte*)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((Byte*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Byte*)(pClsVar1)), + AdvSimd.LoadVector128((Byte*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((Byte*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((Byte*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_Byte(); + AdvSimd.Arm64.StorePair((Byte*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_Byte(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Byte*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((Byte*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Byte*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((Byte*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Byte*)(&test._fld1)), + AdvSimd.LoadVector128((Byte*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] firstOp, Byte[] secondOp, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.Double.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.Double.cs new file mode 100644 index 000000000000..8a8d681f2187 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.Double.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector128_Double() + { + var test = new StoreBinaryOpTest__StorePair_Vector128_Double(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector128_Double + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector128_Double testClass) + { + AdvSimd.Arm64.StorePair((Double*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector128_Double testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Double*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((Double*)(pFld1)), + AdvSimd.LoadVector128((Double*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector128_Double() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector128_Double() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (Double*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Double*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Double*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Double*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Double*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Double*)), + AdvSimd.LoadVector128((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Double*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((Double*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Double*)(pClsVar1)), + AdvSimd.LoadVector128((Double*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((Double*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Double*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Double*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((Double*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_Double(); + AdvSimd.Arm64.StorePair((Double*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_Double(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Double*)(pFld1)), + AdvSimd.LoadVector128((Double*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((Double*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Double*)(pFld1)), + AdvSimd.LoadVector128((Double*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((Double*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Double*)(&test._fld1)), + AdvSimd.LoadVector128((Double*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] secondOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(Helpers.Concat(firstOp, secondOp, i)) != BitConverter.DoubleToInt64Bits(result[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.Int16.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.Int16.cs new file mode 100644 index 000000000000..c6fd5daa667d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.Int16.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector128_Int16() + { + var test = new StoreBinaryOpTest__StorePair_Vector128_Int16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector128_Int16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector128_Int16 testClass) + { + AdvSimd.Arm64.StorePair((Int16*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector128_Int16 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Int16*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector128_Int16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector128_Int16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (Int16*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Int16*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int16*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Int16*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int16*)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((Int16*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int16*)(pClsVar1)), + AdvSimd.LoadVector128((Int16*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((Int16*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((Int16*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_Int16(); + AdvSimd.Arm64.StorePair((Int16*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_Int16(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((Int16*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((Int16*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int16*)(&test._fld1)), + AdvSimd.LoadVector128((Int16*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.Int32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.Int32.cs new file mode 100644 index 000000000000..a3382c3aff9c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.Int32.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector128_Int32() + { + var test = new StoreBinaryOpTest__StorePair_Vector128_Int32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector128_Int32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector128_Int32 testClass) + { + AdvSimd.Arm64.StorePair((Int32*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector128_Int32 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Int32*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector128_Int32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector128_Int32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (Int32*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Int32*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int32*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Int32*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int32*)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((Int32*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int32*)(pClsVar1)), + AdvSimd.LoadVector128((Int32*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((Int32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((Int32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_Int32(); + AdvSimd.Arm64.StorePair((Int32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_Int32(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((Int32*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((Int32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int32*)(&test._fld1)), + AdvSimd.LoadVector128((Int32*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.Int64.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.Int64.cs new file mode 100644 index 000000000000..901581076bd5 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.Int64.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector128_Int64() + { + var test = new StoreBinaryOpTest__StorePair_Vector128_Int64(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector128_Int64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector128_Int64 testClass) + { + AdvSimd.Arm64.StorePair((Int64*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector128_Int64 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Int64*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int64*)(pFld1)), + AdvSimd.LoadVector128((Int64*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector128_Int64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector128_Int64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (Int64*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int64*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int64*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Int64*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int64*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Int64*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int64*)), + AdvSimd.LoadVector128((Int64*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int64*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((Int64*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int64*)(pClsVar1)), + AdvSimd.LoadVector128((Int64*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((Int64*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int64*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int64*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((Int64*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_Int64(); + AdvSimd.Arm64.StorePair((Int64*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_Int64(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int64*)(pFld1)), + AdvSimd.LoadVector128((Int64*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((Int64*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int64*)(pFld1)), + AdvSimd.LoadVector128((Int64*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((Int64*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int64*)(&test._fld1)), + AdvSimd.LoadVector128((Int64*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] firstOp, Int64[] secondOp, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.SByte.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.SByte.cs new file mode 100644 index 000000000000..bd1cfc56b3ef --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.SByte.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector128_SByte() + { + var test = new StoreBinaryOpTest__StorePair_Vector128_SByte(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector128_SByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector128_SByte testClass) + { + AdvSimd.Arm64.StorePair((SByte*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector128_SByte testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (SByte*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((SByte*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector128_SByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector128_SByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (SByte*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(SByte*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(SByte*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(SByte*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(SByte*)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((SByte*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((SByte*)(pClsVar1)), + AdvSimd.LoadVector128((SByte*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((SByte*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((SByte*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_SByte(); + AdvSimd.Arm64.StorePair((SByte*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_SByte(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((SByte*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((SByte*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((SByte*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((SByte*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((SByte*)(&test._fld1)), + AdvSimd.LoadVector128((SByte*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] firstOp, SByte[] secondOp, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.Single.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.Single.cs new file mode 100644 index 000000000000..10e9b70c3d1a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.Single.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector128_Single() + { + var test = new StoreBinaryOpTest__StorePair_Vector128_Single(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector128_Single + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector128_Single testClass) + { + AdvSimd.Arm64.StorePair((Single*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector128_Single testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Single*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((Single*)(pFld1)), + AdvSimd.LoadVector128((Single*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector128_Single() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector128_Single() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (Single*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Single*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Single*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Single*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Single*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Single*)), + AdvSimd.LoadVector128((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Single*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((Single*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Single*)(pClsVar1)), + AdvSimd.LoadVector128((Single*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((Single*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Single*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Single*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((Single*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_Single(); + AdvSimd.Arm64.StorePair((Single*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_Single(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Single*)(pFld1)), + AdvSimd.LoadVector128((Single*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((Single*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Single*)(pFld1)), + AdvSimd.LoadVector128((Single*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((Single*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Single*)(&test._fld1)), + AdvSimd.LoadVector128((Single*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] secondOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(Helpers.Concat(firstOp, secondOp, i)) != BitConverter.SingleToInt32Bits(result[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.UInt16.cs new file mode 100644 index 000000000000..70132b8cc91f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.UInt16.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector128_UInt16() + { + var test = new StoreBinaryOpTest__StorePair_Vector128_UInt16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector128_UInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector128_UInt16 testClass) + { + AdvSimd.Arm64.StorePair((UInt16*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector128_UInt16 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (UInt16*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt16*)(pFld1)), + AdvSimd.LoadVector128((UInt16*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector128_UInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector128_UInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (UInt16*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(UInt16*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt16*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(UInt16*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt16*)), + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((UInt16*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt16*)(pClsVar1)), + AdvSimd.LoadVector128((UInt16*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((UInt16*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((UInt16*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_UInt16(); + AdvSimd.Arm64.StorePair((UInt16*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_UInt16(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt16*)(pFld1)), + AdvSimd.LoadVector128((UInt16*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((UInt16*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt16*)(pFld1)), + AdvSimd.LoadVector128((UInt16*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((UInt16*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt16*)(&test._fld1)), + AdvSimd.LoadVector128((UInt16*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] firstOp, UInt16[] secondOp, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.UInt32.cs new file mode 100644 index 000000000000..bdae2d0305e8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.UInt32.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector128_UInt32() + { + var test = new StoreBinaryOpTest__StorePair_Vector128_UInt32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector128_UInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector128_UInt32 testClass) + { + AdvSimd.Arm64.StorePair((UInt32*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector128_UInt32 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (UInt32*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((UInt32*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector128_UInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector128_UInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (UInt32*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(UInt32*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt32*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(UInt32*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt32*)), + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((UInt32*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt32*)(pClsVar1)), + AdvSimd.LoadVector128((UInt32*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((UInt32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((UInt32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_UInt32(); + AdvSimd.Arm64.StorePair((UInt32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_UInt32(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((UInt32*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((UInt32*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((UInt32*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((UInt32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt32*)(&test._fld1)), + AdvSimd.LoadVector128((UInt32*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt32[] secondOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.UInt64.cs new file mode 100644 index 000000000000..882f82feb3b9 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector128.UInt64.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector128_UInt64() + { + var test = new StoreBinaryOpTest__StorePair_Vector128_UInt64(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector128_UInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector128_UInt64 testClass) + { + AdvSimd.Arm64.StorePair((UInt64*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector128_UInt64 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (UInt64*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt64*)(pFld1)), + AdvSimd.LoadVector128((UInt64*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector128_UInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector128_UInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (UInt64*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(UInt64*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt64*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(UInt64*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt64*)), + AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((UInt64*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt64*)(pClsVar1)), + AdvSimd.LoadVector128((UInt64*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((UInt64*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((UInt64*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_UInt64(); + AdvSimd.Arm64.StorePair((UInt64*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector128_UInt64(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt64*)(pFld1)), + AdvSimd.LoadVector128((UInt64*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((UInt64*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt64*)(pFld1)), + AdvSimd.LoadVector128((UInt64*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((UInt64*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt64*)(&test._fld1)), + AdvSimd.LoadVector128((UInt64*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] firstOp, UInt64[] secondOp, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.Byte.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.Byte.cs new file mode 100644 index 000000000000..2d8fec08f2ff --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.Byte.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector64_Byte() + { + var test = new StoreBinaryOpTest__StorePair_Vector64_Byte(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector64_Byte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector64_Byte testClass) + { + AdvSimd.Arm64.StorePair((Byte*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector64_Byte testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Byte*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((Byte*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector64_Byte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector64_Byte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (Byte*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Byte*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Byte*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Byte*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Byte*)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((Byte*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Byte*)(pClsVar1)), + AdvSimd.LoadVector64((Byte*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((Byte*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((Byte*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_Byte(); + AdvSimd.Arm64.StorePair((Byte*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_Byte(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Byte*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((Byte*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Byte*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((Byte*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Byte*)(&test._fld1)), + AdvSimd.LoadVector64((Byte*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] firstOp, Byte[] secondOp, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.Double.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.Double.cs new file mode 100644 index 000000000000..23c70cd6c4f0 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.Double.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector64_Double() + { + var test = new StoreBinaryOpTest__StorePair_Vector64_Double(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector64_Double + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector64_Double testClass) + { + AdvSimd.Arm64.StorePair((Double*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector64_Double testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Double*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((Double*)(pFld1)), + AdvSimd.LoadVector64((Double*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector64_Double() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector64_Double() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (Double*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Double*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Double*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Double*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Double*)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((Double*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Double*)(pClsVar1)), + AdvSimd.LoadVector64((Double*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((Double*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Double*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Double*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((Double*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_Double(); + AdvSimd.Arm64.StorePair((Double*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_Double(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Double*)(pFld1)), + AdvSimd.LoadVector64((Double*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((Double*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Double*)(pFld1)), + AdvSimd.LoadVector64((Double*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((Double*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Double*)(&test._fld1)), + AdvSimd.LoadVector64((Double*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] secondOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(Helpers.Concat(firstOp, secondOp, i)) != BitConverter.DoubleToInt64Bits(result[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.Int16.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.Int16.cs new file mode 100644 index 000000000000..a7b9eda6fd24 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.Int16.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector64_Int16() + { + var test = new StoreBinaryOpTest__StorePair_Vector64_Int16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector64_Int16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector64_Int16 testClass) + { + AdvSimd.Arm64.StorePair((Int16*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector64_Int16 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Int16*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector64_Int16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector64_Int16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (Int16*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Int16*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int16*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Int16*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int16*)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((Int16*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int16*)(pClsVar1)), + AdvSimd.LoadVector64((Int16*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((Int16*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((Int16*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_Int16(); + AdvSimd.Arm64.StorePair((Int16*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_Int16(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((Int16*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((Int16*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int16*)(&test._fld1)), + AdvSimd.LoadVector64((Int16*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.Int32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.Int32.cs new file mode 100644 index 000000000000..81e6e67576b1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.Int32.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector64_Int32() + { + var test = new StoreBinaryOpTest__StorePair_Vector64_Int32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector64_Int32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector64_Int32 testClass) + { + AdvSimd.Arm64.StorePair((Int32*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector64_Int32 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Int32*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector64_Int32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector64_Int32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (Int32*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Int32*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int32*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Int32*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int32*)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((Int32*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((Int32*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((Int32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((Int32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_Int32(); + AdvSimd.Arm64.StorePair((Int32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_Int32(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((Int32*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((Int32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((Int32*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.Int64.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.Int64.cs new file mode 100644 index 000000000000..a3bb85a816d3 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.Int64.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector64_Int64() + { + var test = new StoreBinaryOpTest__StorePair_Vector64_Int64(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector64_Int64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector64_Int64 testClass) + { + AdvSimd.Arm64.StorePair((Int64*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector64_Int64 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Int64*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int64*)(pFld1)), + AdvSimd.LoadVector64((Int64*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector64_Int64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector64_Int64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (Int64*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int64*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int64*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Int64*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int64*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Int64*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int64*)), + AdvSimd.LoadVector64((Int64*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int64*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((Int64*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int64*)(pClsVar1)), + AdvSimd.LoadVector64((Int64*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((Int64*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int64*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int64*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((Int64*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_Int64(); + AdvSimd.Arm64.StorePair((Int64*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_Int64(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int64*)(pFld1)), + AdvSimd.LoadVector64((Int64*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((Int64*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int64*)(pFld1)), + AdvSimd.LoadVector64((Int64*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((Int64*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int64*)(&test._fld1)), + AdvSimd.LoadVector64((Int64*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] firstOp, Int64[] secondOp, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.SByte.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.SByte.cs new file mode 100644 index 000000000000..fc58781cf678 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.SByte.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector64_SByte() + { + var test = new StoreBinaryOpTest__StorePair_Vector64_SByte(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector64_SByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector64_SByte testClass) + { + AdvSimd.Arm64.StorePair((SByte*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector64_SByte testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (SByte*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((SByte*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector64_SByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector64_SByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (SByte*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(SByte*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(SByte*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(SByte*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(SByte*)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((SByte*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((SByte*)(pClsVar1)), + AdvSimd.LoadVector64((SByte*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((SByte*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((SByte*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_SByte(); + AdvSimd.Arm64.StorePair((SByte*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_SByte(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((SByte*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((SByte*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((SByte*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((SByte*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((SByte*)(&test._fld1)), + AdvSimd.LoadVector64((SByte*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] firstOp, SByte[] secondOp, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.Single.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.Single.cs new file mode 100644 index 000000000000..48f0c727992c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.Single.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector64_Single() + { + var test = new StoreBinaryOpTest__StorePair_Vector64_Single(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector64_Single + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector64_Single testClass) + { + AdvSimd.Arm64.StorePair((Single*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector64_Single testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Single*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector64_Single() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector64_Single() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (Single*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Single*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Single*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(Single*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Single*)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((Single*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(pClsVar1)), + AdvSimd.LoadVector64((Single*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((Single*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((Single*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_Single(); + AdvSimd.Arm64.StorePair((Single*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_Single(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((Single*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((Single*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(&test._fld1)), + AdvSimd.LoadVector64((Single*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] secondOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(Helpers.Concat(firstOp, secondOp, i)) != BitConverter.SingleToInt32Bits(result[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.UInt16.cs new file mode 100644 index 000000000000..4ee15cb657ba --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.UInt16.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector64_UInt16() + { + var test = new StoreBinaryOpTest__StorePair_Vector64_UInt16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector64_UInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector64_UInt16 testClass) + { + AdvSimd.Arm64.StorePair((UInt16*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector64_UInt16 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (UInt16*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt16*)(pFld1)), + AdvSimd.LoadVector64((UInt16*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector64_UInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector64_UInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (UInt16*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(UInt16*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt16*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(UInt16*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt16*)), + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((UInt16*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt16*)(pClsVar1)), + AdvSimd.LoadVector64((UInt16*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((UInt16*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((UInt16*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_UInt16(); + AdvSimd.Arm64.StorePair((UInt16*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_UInt16(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt16*)(pFld1)), + AdvSimd.LoadVector64((UInt16*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((UInt16*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt16*)(pFld1)), + AdvSimd.LoadVector64((UInt16*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((UInt16*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt16*)(&test._fld1)), + AdvSimd.LoadVector64((UInt16*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] firstOp, UInt16[] secondOp, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.UInt32.cs new file mode 100644 index 000000000000..53b5c7f75868 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.UInt32.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector64_UInt32() + { + var test = new StoreBinaryOpTest__StorePair_Vector64_UInt32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector64_UInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector64_UInt32 testClass) + { + AdvSimd.Arm64.StorePair((UInt32*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector64_UInt32 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (UInt32*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((UInt32*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector64_UInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector64_UInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (UInt32*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(UInt32*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt32*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(UInt32*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt32*)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((UInt32*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(pClsVar1)), + AdvSimd.LoadVector64((UInt32*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((UInt32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((UInt32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_UInt32(); + AdvSimd.Arm64.StorePair((UInt32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_UInt32(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((UInt32*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((UInt32*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((UInt32*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((UInt32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(&test._fld1)), + AdvSimd.LoadVector64((UInt32*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt32[] secondOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.UInt64.cs new file mode 100644 index 000000000000..968e83d83055 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePair.Vector64.UInt64.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePair_Vector64_UInt64() + { + var test = new StoreBinaryOpTest__StorePair_Vector64_UInt64(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePair_Vector64_UInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePair_Vector64_UInt64 testClass) + { + AdvSimd.Arm64.StorePair((UInt64*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePair_Vector64_UInt64 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (UInt64*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt64*)(pFld1)), + AdvSimd.LoadVector64((UInt64*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePair_Vector64_UInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePair_Vector64_UInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePair( + (UInt64*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePair( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt64*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt64*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(UInt64*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt64*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePair), new Type[] { typeof(UInt64*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt64*)), + AdvSimd.LoadVector64((UInt64*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt64*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePair((UInt64*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePair( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt64*)(pClsVar1)), + AdvSimd.LoadVector64((UInt64*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePair((UInt64*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((UInt64*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((UInt64*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePair((UInt64*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_UInt64(); + AdvSimd.Arm64.StorePair((UInt64*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePair_Vector64_UInt64(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePair( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt64*)(pFld1)), + AdvSimd.LoadVector64((UInt64*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePair((UInt64*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePair( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt64*)(pFld1)), + AdvSimd.LoadVector64((UInt64*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair((UInt64*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePair( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt64*)(&test._fld1)), + AdvSimd.LoadVector64((UInt64*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] firstOp, UInt64[] secondOp, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePair)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.Byte.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.Byte.cs new file mode 100644 index 000000000000..e628e9a515f5 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.Byte.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector128_Byte() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_Byte(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector128_Byte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector128_Byte testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((Byte*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector128_Byte testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Byte*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((Byte*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector128_Byte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector128_Byte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Byte*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Byte*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Byte*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Byte*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Byte*)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Byte*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Byte*)(pClsVar1)), + AdvSimd.LoadVector128((Byte*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((Byte*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((Byte*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_Byte(); + AdvSimd.Arm64.StorePairNonTemporal((Byte*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_Byte(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Byte*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Byte*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Byte*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((Byte*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Byte*)(&test._fld1)), + AdvSimd.LoadVector128((Byte*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] firstOp, Byte[] secondOp, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.Double.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.Double.cs new file mode 100644 index 000000000000..b48139fc7fa2 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.Double.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector128_Double() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_Double(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector128_Double + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector128_Double testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((Double*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector128_Double testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Double*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((Double*)(pFld1)), + AdvSimd.LoadVector128((Double*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector128_Double() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector128_Double() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Double*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Double*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Double*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Double*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Double*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Double*)), + AdvSimd.LoadVector128((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Double*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Double*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Double*)(pClsVar1)), + AdvSimd.LoadVector128((Double*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((Double*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Double*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Double*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((Double*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_Double(); + AdvSimd.Arm64.StorePairNonTemporal((Double*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_Double(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Double*)(pFld1)), + AdvSimd.LoadVector128((Double*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Double*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Double*)(pFld1)), + AdvSimd.LoadVector128((Double*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((Double*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Double*)(&test._fld1)), + AdvSimd.LoadVector128((Double*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] secondOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(Helpers.Concat(firstOp, secondOp, i)) != BitConverter.DoubleToInt64Bits(result[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.Int16.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.Int16.cs new file mode 100644 index 000000000000..c7b2c0badb82 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.Int16.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector128_Int16() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int16 testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((Int16*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int16 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int16*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Int16*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Int16*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int16*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Int16*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int16*)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Int16*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int16*)(pClsVar1)), + AdvSimd.LoadVector128((Int16*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((Int16*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((Int16*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int16(); + AdvSimd.Arm64.StorePairNonTemporal((Int16*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int16(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Int16*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((Int16*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int16*)(&test._fld1)), + AdvSimd.LoadVector128((Int16*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.Int32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.Int32.cs new file mode 100644 index 000000000000..0cd6ec63e8b8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.Int32.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector128_Int32() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int32 testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((Int32*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int32 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int32*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Int32*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Int32*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int32*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Int32*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int32*)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Int32*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int32*)(pClsVar1)), + AdvSimd.LoadVector128((Int32*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((Int32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((Int32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int32(); + AdvSimd.Arm64.StorePairNonTemporal((Int32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int32(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Int32*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((Int32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int32*)(&test._fld1)), + AdvSimd.LoadVector128((Int32*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.Int64.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.Int64.cs new file mode 100644 index 000000000000..ae075f36cbe6 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.Int64.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector128_Int64() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int64(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int64 testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((Int64*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int64 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int64*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int64*)(pFld1)), + AdvSimd.LoadVector128((Int64*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Int64*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int64*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int64*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Int64*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int64*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Int64*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int64*)), + AdvSimd.LoadVector128((Int64*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int64*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Int64*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int64*)(pClsVar1)), + AdvSimd.LoadVector128((Int64*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((Int64*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int64*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int64*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((Int64*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int64(); + AdvSimd.Arm64.StorePairNonTemporal((Int64*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_Int64(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int64*)(pFld1)), + AdvSimd.LoadVector128((Int64*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Int64*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int64*)(pFld1)), + AdvSimd.LoadVector128((Int64*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((Int64*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Int64*)(&test._fld1)), + AdvSimd.LoadVector128((Int64*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] firstOp, Int64[] secondOp, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.SByte.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.SByte.cs new file mode 100644 index 000000000000..c636fca036ef --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.SByte.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector128_SByte() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_SByte(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector128_SByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector128_SByte testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((SByte*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector128_SByte testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (SByte*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((SByte*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector128_SByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector128_SByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (SByte*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(SByte*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(SByte*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(SByte*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(SByte*)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((SByte*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((SByte*)(pClsVar1)), + AdvSimd.LoadVector128((SByte*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((SByte*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((SByte*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_SByte(); + AdvSimd.Arm64.StorePairNonTemporal((SByte*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_SByte(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((SByte*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((SByte*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((SByte*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((SByte*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((SByte*)(&test._fld1)), + AdvSimd.LoadVector128((SByte*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] firstOp, SByte[] secondOp, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.Single.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.Single.cs new file mode 100644 index 000000000000..371827360189 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.Single.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector128_Single() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_Single(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector128_Single + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector128_Single testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((Single*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector128_Single testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Single*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((Single*)(pFld1)), + AdvSimd.LoadVector128((Single*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector128_Single() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector128_Single() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Single*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Single*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Single*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Single*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Single*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Single*)), + AdvSimd.LoadVector128((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Single*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Single*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Single*)(pClsVar1)), + AdvSimd.LoadVector128((Single*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((Single*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Single*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Single*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((Single*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_Single(); + AdvSimd.Arm64.StorePairNonTemporal((Single*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_Single(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Single*)(pFld1)), + AdvSimd.LoadVector128((Single*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Single*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Single*)(pFld1)), + AdvSimd.LoadVector128((Single*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((Single*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((Single*)(&test._fld1)), + AdvSimd.LoadVector128((Single*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] secondOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(Helpers.Concat(firstOp, secondOp, i)) != BitConverter.SingleToInt32Bits(result[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.UInt16.cs new file mode 100644 index 000000000000..926fb5ef0648 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.UInt16.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector128_UInt16() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt16 testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((UInt16*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt16 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt16*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt16*)(pFld1)), + AdvSimd.LoadVector128((UInt16*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (UInt16*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(UInt16*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt16*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(UInt16*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt16*)), + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((UInt16*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt16*)(pClsVar1)), + AdvSimd.LoadVector128((UInt16*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((UInt16*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((UInt16*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt16(); + AdvSimd.Arm64.StorePairNonTemporal((UInt16*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt16(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt16*)(pFld1)), + AdvSimd.LoadVector128((UInt16*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((UInt16*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt16*)(pFld1)), + AdvSimd.LoadVector128((UInt16*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((UInt16*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt16*)(&test._fld1)), + AdvSimd.LoadVector128((UInt16*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] firstOp, UInt16[] secondOp, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.UInt32.cs new file mode 100644 index 000000000000..eef6e6da367c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.UInt32.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector128_UInt32() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt32 testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((UInt32*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt32 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt32*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((UInt32*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (UInt32*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(UInt32*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt32*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(UInt32*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt32*)), + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((UInt32*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt32*)(pClsVar1)), + AdvSimd.LoadVector128((UInt32*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((UInt32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((UInt32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt32(); + AdvSimd.Arm64.StorePairNonTemporal((UInt32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt32(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((UInt32*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((UInt32*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((UInt32*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((UInt32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt32*)(&test._fld1)), + AdvSimd.LoadVector128((UInt32*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt32[] secondOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.UInt64.cs new file mode 100644 index 000000000000..da66dcaa04ef --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector128.UInt64.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector128_UInt64() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt64(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt64 testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((UInt64*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt64 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt64*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt64*)(pFld1)), + AdvSimd.LoadVector128((UInt64*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 32; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + + private Vector128 _fld1; + private Vector128 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (UInt64*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(UInt64*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt64*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(UInt64*), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt64*)), + AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((UInt64*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt64*)(pClsVar1)), + AdvSimd.LoadVector128((UInt64*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((UInt64*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((UInt64*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt64(); + AdvSimd.Arm64.StorePairNonTemporal((UInt64*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector128_UInt64(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt64*)(pFld1)), + AdvSimd.LoadVector128((UInt64*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((UInt64*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt64*)(pFld1)), + AdvSimd.LoadVector128((UInt64*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((UInt64*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector128((UInt64*)(&test._fld1)), + AdvSimd.LoadVector128((UInt64*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] firstOp, UInt64[] secondOp, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.Byte.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.Byte.cs new file mode 100644 index 000000000000..71d0fc5d5fde --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.Byte.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector64_Byte() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_Byte(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector64_Byte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector64_Byte testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((Byte*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector64_Byte testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Byte*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((Byte*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Byte[] _data1 = new Byte[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector64_Byte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector64_Byte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Byte*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Byte*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Byte*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Byte*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Byte*)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Byte*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Byte*)(pClsVar1)), + AdvSimd.LoadVector64((Byte*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((Byte*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((Byte*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_Byte(); + AdvSimd.Arm64.StorePairNonTemporal((Byte*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_Byte(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Byte*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Byte*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Byte*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((Byte*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (Byte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Byte*)(&test._fld1)), + AdvSimd.LoadVector64((Byte*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Byte[] inArray1 = new Byte[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] outArray = new Byte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Byte[] firstOp, Byte[] secondOp, Byte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.Double.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.Double.cs new file mode 100644 index 000000000000..a6f22636344e --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.Double.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector64_Double() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_Double(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector64_Double + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Double[] inArray1, Double[] inArray2, Double[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector64_Double testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((Double*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector64_Double testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Double*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((Double*)(pFld1)), + AdvSimd.LoadVector64((Double*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Double); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Double[] _data1 = new Double[Op1ElementCount]; + private static Double[] _data2 = new Double[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector64_Double() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector64_Double() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); } + _dataTable = new DataTable(_data1, _data2, new Double[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Double*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Double*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Double*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Double*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Double*)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Double*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Double*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Double*)(pClsVar1)), + AdvSimd.LoadVector64((Double*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((Double*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Double*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Double*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((Double*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_Double(); + AdvSimd.Arm64.StorePairNonTemporal((Double*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_Double(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Double*)(pFld1)), + AdvSimd.LoadVector64((Double*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Double*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Double*)(pFld1)), + AdvSimd.LoadVector64((Double*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((Double*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (Double*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Double*)(&test._fld1)), + AdvSimd.LoadVector64((Double*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Double[] inArray1 = new Double[Op1ElementCount]; + Double[] inArray2 = new Double[Op2ElementCount]; + Double[] outArray = new Double[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Double[] firstOp, Double[] secondOp, Double[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (BitConverter.DoubleToInt64Bits(Helpers.Concat(firstOp, secondOp, i)) != BitConverter.DoubleToInt64Bits(result[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.Int16.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.Int16.cs new file mode 100644 index 000000000000..87e082198cda --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.Int16.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector64_Int16() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int16 testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((Int16*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int16 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int16*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Int16*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Int16*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int16*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Int16*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int16*)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Int16*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int16*)(pClsVar1)), + AdvSimd.LoadVector64((Int16*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((Int16*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((Int16*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int16(); + AdvSimd.Arm64.StorePairNonTemporal((Int16*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int16(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Int16*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((Int16*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (Int16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int16*)(&test._fld1)), + AdvSimd.LoadVector64((Int16*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.Int32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.Int32.cs new file mode 100644 index 000000000000..b05d4d97d8d5 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.Int32.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector64_Int32() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int32 testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((Int32*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int32 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int32*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Int32*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Int32*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int32*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Int32*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int32*)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Int32*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((Int32*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((Int32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((Int32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int32(); + AdvSimd.Arm64.StorePairNonTemporal((Int32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int32(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Int32*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((Int32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((Int32*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.Int64.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.Int64.cs new file mode 100644 index 000000000000..dcdea64979cd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.Int64.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector64_Int64() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int64(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int64[] inArray1, Int64[] inArray2, Int64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int64 testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((Int64*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int64 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int64*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int64*)(pFld1)), + AdvSimd.LoadVector64((Int64*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int64); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Int64[] _data1 = new Int64[Op1ElementCount]; + private static Int64[] _data2 = new Int64[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); } + _dataTable = new DataTable(_data1, _data2, new Int64[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Int64*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int64*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int64*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Int64*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int64*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Int64*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int64*)), + AdvSimd.LoadVector64((Int64*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int64*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Int64*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int64*)(pClsVar1)), + AdvSimd.LoadVector64((Int64*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((Int64*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int64*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int64*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((Int64*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int64(); + AdvSimd.Arm64.StorePairNonTemporal((Int64*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_Int64(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int64*)(pFld1)), + AdvSimd.LoadVector64((Int64*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Int64*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int64*)(pFld1)), + AdvSimd.LoadVector64((Int64*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((Int64*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (Int64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int64*)(&test._fld1)), + AdvSimd.LoadVector64((Int64*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int64[] inArray1 = new Int64[Op1ElementCount]; + Int64[] inArray2 = new Int64[Op2ElementCount]; + Int64[] outArray = new Int64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int64[] firstOp, Int64[] secondOp, Int64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.SByte.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.SByte.cs new file mode 100644 index 000000000000..fa9f78675063 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.SByte.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector64_SByte() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_SByte(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector64_SByte + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(SByte[] inArray1, SByte[] inArray2, SByte[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector64_SByte testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((SByte*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector64_SByte testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (SByte*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((SByte*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static SByte[] _data1 = new SByte[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector64_SByte() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector64_SByte() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (SByte*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(SByte*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(SByte*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(SByte*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(SByte*)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((SByte*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((SByte*)(pClsVar1)), + AdvSimd.LoadVector64((SByte*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((SByte*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((SByte*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_SByte(); + AdvSimd.Arm64.StorePairNonTemporal((SByte*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_SByte(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((SByte*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((SByte*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((SByte*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((SByte*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (SByte*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((SByte*)(&test._fld1)), + AdvSimd.LoadVector64((SByte*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + SByte[] inArray1 = new SByte[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] outArray = new SByte[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(SByte[] firstOp, SByte[] secondOp, SByte[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.Single.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.Single.cs new file mode 100644 index 000000000000..8519772b36ee --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.Single.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector64_Single() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_Single(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector64_Single + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector64_Single testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((Single*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector64_Single testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Single*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector64_Single() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector64_Single() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Single*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Single*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Single*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(Single*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Single*)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Single*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(pClsVar1)), + AdvSimd.LoadVector64((Single*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((Single*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((Single*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_Single(); + AdvSimd.Arm64.StorePairNonTemporal((Single*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_Single(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((Single*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((Single*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(&test._fld1)), + AdvSimd.LoadVector64((Single*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] secondOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(Helpers.Concat(firstOp, secondOp, i)) != BitConverter.SingleToInt32Bits(result[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.UInt16.cs new file mode 100644 index 000000000000..51f449857f22 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.UInt16.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector64_UInt16() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt16 testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((UInt16*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt16 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt16*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt16*)(pFld1)), + AdvSimd.LoadVector64((UInt16*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt16); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static UInt16[] _data1 = new UInt16[Op1ElementCount]; + private static UInt16[] _data2 = new UInt16[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } + _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (UInt16*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(UInt16*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt16*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(UInt16*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt16*)), + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((UInt16*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt16*)(pClsVar1)), + AdvSimd.LoadVector64((UInt16*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((UInt16*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((UInt16*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt16(); + AdvSimd.Arm64.StorePairNonTemporal((UInt16*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt16(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt16*)(pFld1)), + AdvSimd.LoadVector64((UInt16*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((UInt16*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt16*)(pFld1)), + AdvSimd.LoadVector64((UInt16*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((UInt16*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (UInt16*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt16*)(&test._fld1)), + AdvSimd.LoadVector64((UInt16*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt16[] inArray1 = new UInt16[Op1ElementCount]; + UInt16[] inArray2 = new UInt16[Op2ElementCount]; + UInt16[] outArray = new UInt16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt16[] firstOp, UInt16[] secondOp, UInt16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.UInt32.cs new file mode 100644 index 000000000000..e3942f7e97a2 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.UInt32.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector64_UInt32() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt32 testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((UInt32*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt32 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt32*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((UInt32*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (UInt32*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(UInt32*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt32*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(UInt32*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt32*)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((UInt32*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(pClsVar1)), + AdvSimd.LoadVector64((UInt32*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((UInt32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((UInt32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt32(); + AdvSimd.Arm64.StorePairNonTemporal((UInt32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt32(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((UInt32*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((UInt32*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((UInt32*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((UInt32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(&test._fld1)), + AdvSimd.LoadVector64((UInt32*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt32[] secondOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.UInt64.cs new file mode 100644 index 000000000000..463804a2b95f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairNonTemporal.Vector64.UInt64.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairNonTemporal_Vector64_UInt64() + { + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt64(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt64 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt64 testClass) + { + AdvSimd.Arm64.StorePairNonTemporal((UInt64*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt64 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt64*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt64*)(pFld1)), + AdvSimd.LoadVector64((UInt64*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt64); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static UInt64[] _data1 = new UInt64[Op1ElementCount]; + private static UInt64[] _data2 = new UInt64[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt64() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt64() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } + _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairNonTemporal( + (UInt64*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairNonTemporal( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt64*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt64*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(UInt64*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt64*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairNonTemporal), new Type[] { typeof(UInt64*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt64*)), + AdvSimd.LoadVector64((UInt64*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt64*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((UInt64*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt64*)(pClsVar1)), + AdvSimd.LoadVector64((UInt64*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairNonTemporal((UInt64*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((UInt64*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((UInt64*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairNonTemporal((UInt64*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt64(); + AdvSimd.Arm64.StorePairNonTemporal((UInt64*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairNonTemporal_Vector64_UInt64(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt64*)(pFld1)), + AdvSimd.LoadVector64((UInt64*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairNonTemporal((UInt64*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairNonTemporal( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt64*)(pFld1)), + AdvSimd.LoadVector64((UInt64*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal((UInt64*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairNonTemporal( + (UInt64*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt64*)(&test._fld1)), + AdvSimd.LoadVector64((UInt64*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt64[] inArray1 = new UInt64[Op1ElementCount]; + UInt64[] inArray2 = new UInt64[Op2ElementCount]; + UInt64[] outArray = new UInt64[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt64[] firstOp, UInt64[] secondOp, UInt64[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.Concat(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairNonTemporal)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairScalar.Vector64.Int32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairScalar.Vector64.Int32.cs new file mode 100644 index 000000000000..79c0a517c34b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairScalar.Vector64.Int32.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairScalar_Vector64_Int32() + { + var test = new StoreBinaryOpTest__StorePairScalar_Vector64_Int32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairScalar_Vector64_Int32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairScalar_Vector64_Int32 testClass) + { + AdvSimd.Arm64.StorePairScalar((Int32*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairScalar_Vector64_Int32 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairScalar( + (Int32*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairScalar_Vector64_Int32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairScalar_Vector64_Int32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairScalar( + (Int32*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairScalar( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairScalar), new Type[] { typeof(Int32*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int32*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairScalar), new Type[] { typeof(Int32*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int32*)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairScalar((Int32*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairScalar( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((Int32*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairScalar((Int32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairScalar((Int32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairScalar_Vector64_Int32(); + AdvSimd.Arm64.StorePairScalar((Int32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairScalar_Vector64_Int32(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairScalar( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairScalar((Int32*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairScalar( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairScalar((Int32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairScalar( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((Int32*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.ConcatScalar(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairScalar)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairScalar.Vector64.Single.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairScalar.Vector64.Single.cs new file mode 100644 index 000000000000..88cca91f8aa4 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairScalar.Vector64.Single.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairScalar_Vector64_Single() + { + var test = new StoreBinaryOpTest__StorePairScalar_Vector64_Single(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairScalar_Vector64_Single + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairScalar_Vector64_Single testClass) + { + AdvSimd.Arm64.StorePairScalar((Single*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairScalar_Vector64_Single testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairScalar( + (Single*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairScalar_Vector64_Single() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairScalar_Vector64_Single() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairScalar( + (Single*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairScalar( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairScalar), new Type[] { typeof(Single*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Single*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairScalar), new Type[] { typeof(Single*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Single*)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairScalar((Single*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairScalar( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(pClsVar1)), + AdvSimd.LoadVector64((Single*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairScalar((Single*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairScalar((Single*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairScalar_Vector64_Single(); + AdvSimd.Arm64.StorePairScalar((Single*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairScalar_Vector64_Single(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairScalar( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairScalar((Single*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairScalar( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairScalar((Single*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairScalar( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(&test._fld1)), + AdvSimd.LoadVector64((Single*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] secondOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(Helpers.ConcatScalar(firstOp, secondOp, i)) != BitConverter.SingleToInt32Bits(result[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairScalar)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairScalar.Vector64.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairScalar.Vector64.UInt32.cs new file mode 100644 index 000000000000..daaefeeb5bc9 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairScalar.Vector64.UInt32.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairScalar_Vector64_UInt32() + { + var test = new StoreBinaryOpTest__StorePairScalar_Vector64_UInt32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairScalar_Vector64_UInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairScalar_Vector64_UInt32 testClass) + { + AdvSimd.Arm64.StorePairScalar((UInt32*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairScalar_Vector64_UInt32 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairScalar( + (UInt32*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((UInt32*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairScalar_Vector64_UInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairScalar_Vector64_UInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairScalar( + (UInt32*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairScalar( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairScalar), new Type[] { typeof(UInt32*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt32*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairScalar), new Type[] { typeof(UInt32*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt32*)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairScalar((UInt32*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairScalar( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(pClsVar1)), + AdvSimd.LoadVector64((UInt32*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairScalar((UInt32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairScalar((UInt32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairScalar_Vector64_UInt32(); + AdvSimd.Arm64.StorePairScalar((UInt32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairScalar_Vector64_UInt32(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairScalar( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((UInt32*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairScalar((UInt32*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairScalar( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((UInt32*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairScalar((UInt32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairScalar( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(&test._fld1)), + AdvSimd.LoadVector64((UInt32*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt32[] secondOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.ConcatScalar(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairScalar)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairScalarNonTemporal.Vector64.Int32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairScalarNonTemporal.Vector64.Int32.cs new file mode 100644 index 000000000000..8660daaecd83 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairScalarNonTemporal.Vector64.Int32.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairScalarNonTemporal_Vector64_Int32() + { + var test = new StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_Int32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_Int32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_Int32 testClass) + { + AdvSimd.Arm64.StorePairScalarNonTemporal((Int32*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_Int32 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairScalarNonTemporal( + (Int32*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_Int32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_Int32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairScalarNonTemporal( + (Int32*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairScalarNonTemporal( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairScalarNonTemporal), new Type[] { typeof(Int32*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int32*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairScalarNonTemporal), new Type[] { typeof(Int32*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Int32*)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairScalarNonTemporal((Int32*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairScalarNonTemporal( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((Int32*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairScalarNonTemporal((Int32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairScalarNonTemporal((Int32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_Int32(); + AdvSimd.Arm64.StorePairScalarNonTemporal((Int32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_Int32(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairScalarNonTemporal( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairScalarNonTemporal((Int32*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairScalarNonTemporal( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairScalarNonTemporal((Int32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairScalarNonTemporal( + (Int32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((Int32*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.ConcatScalar(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairScalarNonTemporal)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairScalarNonTemporal.Vector64.Single.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairScalarNonTemporal.Vector64.Single.cs new file mode 100644 index 000000000000..bd8da6d5c0de --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairScalarNonTemporal.Vector64.Single.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairScalarNonTemporal_Vector64_Single() + { + var test = new StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_Single(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_Single + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_Single testClass) + { + AdvSimd.Arm64.StorePairScalarNonTemporal((Single*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_Single testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairScalarNonTemporal( + (Single*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Single); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static Single[] _data1 = new Single[Op1ElementCount]; + private static Single[] _data2 = new Single[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_Single() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_Single() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairScalarNonTemporal( + (Single*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairScalarNonTemporal( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairScalarNonTemporal), new Type[] { typeof(Single*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Single*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairScalarNonTemporal), new Type[] { typeof(Single*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(Single*)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairScalarNonTemporal((Single*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairScalarNonTemporal( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(pClsVar1)), + AdvSimd.LoadVector64((Single*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairScalarNonTemporal((Single*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairScalarNonTemporal((Single*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_Single(); + AdvSimd.Arm64.StorePairScalarNonTemporal((Single*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_Single(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairScalarNonTemporal( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairScalarNonTemporal((Single*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairScalarNonTemporal( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(pFld1)), + AdvSimd.LoadVector64((Single*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairScalarNonTemporal((Single*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairScalarNonTemporal( + (Single*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((Single*)(&test._fld1)), + AdvSimd.LoadVector64((Single*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + Single[] inArray1 = new Single[Op1ElementCount]; + Single[] inArray2 = new Single[Op2ElementCount]; + Single[] outArray = new Single[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(Single[] firstOp, Single[] secondOp, Single[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (BitConverter.SingleToInt32Bits(Helpers.ConcatScalar(firstOp, secondOp, i)) != BitConverter.SingleToInt32Bits(result[i])) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairScalarNonTemporal)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairScalarNonTemporal.Vector64.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairScalarNonTemporal.Vector64.UInt32.cs new file mode 100644 index 000000000000..3de3371a0931 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/StorePairScalarNonTemporal.Vector64.UInt32.cs @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void StorePairScalarNonTemporal_Vector64_UInt32() + { + var test = new StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_UInt32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_UInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_UInt32 testClass) + { + AdvSimd.Arm64.StorePairScalarNonTemporal((UInt32*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_UInt32 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairScalarNonTemporal( + (UInt32*)testClass._dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((UInt32*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static UInt32[] _data2 = new UInt32[Op2ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + + private Vector64 _fld1; + private Vector64 _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_UInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + } + + public StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_UInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + _dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => AdvSimd.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + AdvSimd.Arm64.StorePairScalarNonTemporal( + (UInt32*)_dataTable.outArrayPtr, + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + AdvSimd.Arm64.StorePairScalarNonTemporal( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairScalarNonTemporal), new Type[] { typeof(UInt32*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt32*)), + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.StorePairScalarNonTemporal), new Type[] { typeof(UInt32*), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof(UInt32*)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + AdvSimd.Arm64.StorePairScalarNonTemporal((UInt32*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + { + AdvSimd.Arm64.StorePairScalarNonTemporal( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(pClsVar1)), + AdvSimd.LoadVector64((UInt32*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + AdvSimd.Arm64.StorePairScalarNonTemporal((UInt32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)); + AdvSimd.Arm64.StorePairScalarNonTemporal((UInt32*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_UInt32(); + AdvSimd.Arm64.StorePairScalarNonTemporal((UInt32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__StorePairScalarNonTemporal_Vector64_UInt32(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + { + AdvSimd.Arm64.StorePairScalarNonTemporal( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((UInt32*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + AdvSimd.Arm64.StorePairScalarNonTemporal((UInt32*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + { + AdvSimd.Arm64.StorePairScalarNonTemporal( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((UInt32*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairScalarNonTemporal((UInt32*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + AdvSimd.Arm64.StorePairScalarNonTemporal( + (UInt32*)_dataTable.outArrayPtr, + AdvSimd.LoadVector64((UInt32*)(&test._fld1)), + AdvSimd.LoadVector64((UInt32*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + UInt32[] inArray2 = new UInt32[Op2ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, UInt32[] secondOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if (Helpers.ConcatScalar(firstOp, secondOp, i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.StorePairScalarNonTemporal)}(Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProduct.Vector128.Int32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProduct.Vector128.Int32.cs new file mode 100644 index 000000000000..9fdf2e3478d6 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProduct.Vector128.Int32.cs @@ -0,0 +1,570 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void DotProduct_Vector128_Int32() + { + var test = new SimpleTernaryOpTest__DotProduct_Vector128_Int32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__DotProduct_Vector128_Int32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, SByte[] inArray2, SByte[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__DotProduct_Vector128_Int32 testClass) + { + var result = Dp.DotProduct(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__DotProduct_Vector128_Int32 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Dp.DotProduct( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)), + AdvSimd.LoadVector128((SByte*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + private static SByte[] _data3 = new SByte[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__DotProduct_Vector128_Int32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__DotProduct_Vector128_Int32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Dp.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Dp.DotProduct( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Dp.DotProduct( + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProduct), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProduct), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Dp.DotProduct( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Dp.DotProduct( + AdvSimd.LoadVector128((Int32*)(pClsVar1)), + AdvSimd.LoadVector128((SByte*)(pClsVar2)), + AdvSimd.LoadVector128((SByte*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Dp.DotProduct(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray3Ptr)); + var result = Dp.DotProduct(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__DotProduct_Vector128_Int32(); + var result = Dp.DotProduct(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__DotProduct_Vector128_Int32(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Dp.DotProduct( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)), + AdvSimd.LoadVector128((SByte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Dp.DotProduct(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Dp.DotProduct( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)), + AdvSimd.LoadVector128((SByte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Dp.DotProduct(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Dp.DotProduct( + AdvSimd.LoadVector128((Int32*)(&test._fld1)), + AdvSimd.LoadVector128((SByte*)(&test._fld2)), + AdvSimd.LoadVector128((SByte*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, SByte[] secondOp, SByte[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Dp)}.{nameof(Dp.DotProduct)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProduct.Vector128.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProduct.Vector128.UInt32.cs new file mode 100644 index 000000000000..987ef728a1d0 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProduct.Vector128.UInt32.cs @@ -0,0 +1,570 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void DotProduct_Vector128_UInt32() + { + var test = new SimpleTernaryOpTest__DotProduct_Vector128_UInt32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__DotProduct_Vector128_UInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, Byte[] inArray2, Byte[] inArray3, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__DotProduct_Vector128_UInt32 testClass) + { + var result = Dp.DotProduct(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__DotProduct_Vector128_UInt32 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Dp.DotProduct( + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)), + AdvSimd.LoadVector128((Byte*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + private static Byte[] _data3 = new Byte[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__DotProduct_Vector128_UInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__DotProduct_Vector128_UInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Dp.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Dp.DotProduct( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Dp.DotProduct( + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProduct), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProduct), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Dp.DotProduct( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Dp.DotProduct( + AdvSimd.LoadVector128((UInt32*)(pClsVar1)), + AdvSimd.LoadVector128((Byte*)(pClsVar2)), + AdvSimd.LoadVector128((Byte*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Dp.DotProduct(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray3Ptr)); + var result = Dp.DotProduct(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__DotProduct_Vector128_UInt32(); + var result = Dp.DotProduct(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__DotProduct_Vector128_UInt32(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Dp.DotProduct( + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)), + AdvSimd.LoadVector128((Byte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Dp.DotProduct(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Dp.DotProduct( + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)), + AdvSimd.LoadVector128((Byte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Dp.DotProduct(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Dp.DotProduct( + AdvSimd.LoadVector128((UInt32*)(&test._fld1)), + AdvSimd.LoadVector128((Byte*)(&test._fld2)), + AdvSimd.LoadVector128((Byte*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, Byte[] secondOp, Byte[] thirdOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Dp)}.{nameof(Dp.DotProduct)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProduct.Vector64.Int32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProduct.Vector64.Int32.cs new file mode 100644 index 000000000000..7043056283d9 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProduct.Vector64.Int32.cs @@ -0,0 +1,570 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void DotProduct_Vector64_Int32() + { + var test = new SimpleTernaryOpTest__DotProduct_Vector64_Int32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__DotProduct_Vector64_Int32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, SByte[] inArray2, SByte[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__DotProduct_Vector64_Int32 testClass) + { + var result = Dp.DotProduct(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__DotProduct_Vector64_Int32 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Dp.DotProduct( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)), + AdvSimd.LoadVector64((SByte*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + private static SByte[] _data3 = new SByte[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__DotProduct_Vector64_Int32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__DotProduct_Vector64_Int32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Dp.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Dp.DotProduct( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Dp.DotProduct( + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProduct), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProduct), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Dp.DotProduct( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Dp.DotProduct( + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((SByte*)(pClsVar2)), + AdvSimd.LoadVector64((SByte*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Dp.DotProduct(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray3Ptr)); + var result = Dp.DotProduct(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__DotProduct_Vector64_Int32(); + var result = Dp.DotProduct(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__DotProduct_Vector64_Int32(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Dp.DotProduct( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)), + AdvSimd.LoadVector64((SByte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Dp.DotProduct(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Dp.DotProduct( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)), + AdvSimd.LoadVector64((SByte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Dp.DotProduct(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Dp.DotProduct( + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((SByte*)(&test._fld2)), + AdvSimd.LoadVector64((SByte*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, SByte[] secondOp, SByte[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Dp)}.{nameof(Dp.DotProduct)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProduct.Vector64.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProduct.Vector64.UInt32.cs new file mode 100644 index 000000000000..f85a826697fb --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProduct.Vector64.UInt32.cs @@ -0,0 +1,570 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void DotProduct_Vector64_UInt32() + { + var test = new SimpleTernaryOpTest__DotProduct_Vector64_UInt32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__DotProduct_Vector64_UInt32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, Byte[] inArray2, Byte[] inArray3, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__DotProduct_Vector64_UInt32 testClass) + { + var result = Dp.DotProduct(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__DotProduct_Vector64_UInt32 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Dp.DotProduct( + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)), + AdvSimd.LoadVector64((Byte*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + private static Byte[] _data3 = new Byte[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__DotProduct_Vector64_UInt32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__DotProduct_Vector64_UInt32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Dp.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Dp.DotProduct( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Dp.DotProduct( + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProduct), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProduct), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Dp.DotProduct( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Dp.DotProduct( + AdvSimd.LoadVector64((UInt32*)(pClsVar1)), + AdvSimd.LoadVector64((Byte*)(pClsVar2)), + AdvSimd.LoadVector64((Byte*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Dp.DotProduct(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray3Ptr)); + var result = Dp.DotProduct(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__DotProduct_Vector64_UInt32(); + var result = Dp.DotProduct(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__DotProduct_Vector64_UInt32(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Dp.DotProduct( + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)), + AdvSimd.LoadVector64((Byte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Dp.DotProduct(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Dp.DotProduct( + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)), + AdvSimd.LoadVector64((Byte*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Dp.DotProduct(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Dp.DotProduct( + AdvSimd.LoadVector64((UInt32*)(&test._fld1)), + AdvSimd.LoadVector64((Byte*)(&test._fld2)), + AdvSimd.LoadVector64((Byte*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, Byte[] secondOp, Byte[] thirdOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * i) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Dp)}.{nameof(Dp.DotProduct)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector128.Int32.Vector128.SByte.3.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector128.Int32.Vector128.SByte.3.cs new file mode 100644 index 000000000000..fd7ed2cf7f28 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector128.Int32.Vector128.SByte.3.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void DotProductBySelectedQuadruplet_Vector128_Int32_Vector128_SByte_3() + { + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_Int32_Vector128_SByte_3(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_Int32_Vector128_SByte_3 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, SByte[] inArray2, SByte[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_Int32_Vector128_SByte_3 testClass) + { + var result = Dp.DotProductBySelectedQuadruplet(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_Int32_Vector128_SByte_3 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)), + AdvSimd.LoadVector128((SByte*)(pFld3)), + 3 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly byte Imm = 3; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + private static SByte[] _data3 = new SByte[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_Int32_Vector128_SByte_3() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_Int32_Vector128_SByte_3() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Dp.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Dp.DotProductBySelectedQuadruplet( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray3Ptr)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProductBySelectedQuadruplet), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProductBySelectedQuadruplet), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray3Ptr)), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Dp.DotProductBySelectedQuadruplet( + _clsVar1, + _clsVar2, + _clsVar3, + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((Int32*)(pClsVar1)), + AdvSimd.LoadVector128((SByte*)(pClsVar2)), + AdvSimd.LoadVector128((SByte*)(pClsVar3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Dp.DotProductBySelectedQuadruplet(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray3Ptr)); + var result = Dp.DotProductBySelectedQuadruplet(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_Int32_Vector128_SByte_3(); + var result = Dp.DotProductBySelectedQuadruplet(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_Int32_Vector128_SByte_3(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)), + AdvSimd.LoadVector128((SByte*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Dp.DotProductBySelectedQuadruplet(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)), + AdvSimd.LoadVector128((SByte*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Dp.DotProductBySelectedQuadruplet(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((Int32*)(&test._fld1)), + AdvSimd.LoadVector128((SByte*)(&test._fld2)), + AdvSimd.LoadVector128((SByte*)(&test._fld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, SByte[] secondOp, SByte[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * Imm) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Dp)}.{nameof(Dp.DotProductBySelectedQuadruplet)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector128.Int32.Vector64.SByte.1.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector128.Int32.Vector64.SByte.1.cs new file mode 100644 index 000000000000..1310bf213e90 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector128.Int32.Vector64.SByte.1.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void DotProductBySelectedQuadruplet_Vector128_Int32_Vector64_SByte_1() + { + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_Int32_Vector64_SByte_1(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_Int32_Vector64_SByte_1 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, SByte[] inArray2, SByte[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_Int32_Vector64_SByte_1 testClass) + { + var result = Dp.DotProductBySelectedQuadruplet(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_Int32_Vector64_SByte_1 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)), + AdvSimd.LoadVector64((SByte*)(pFld3)), + 1 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly byte Imm = 1; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + private static SByte[] _data3 = new SByte[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector64 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_Int32_Vector64_SByte_1() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_Int32_Vector64_SByte_1() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Dp.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Dp.DotProductBySelectedQuadruplet( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray3Ptr)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProductBySelectedQuadruplet), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProductBySelectedQuadruplet), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray3Ptr)), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Dp.DotProductBySelectedQuadruplet( + _clsVar1, + _clsVar2, + _clsVar3, + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((Int32*)(pClsVar1)), + AdvSimd.LoadVector128((SByte*)(pClsVar2)), + AdvSimd.LoadVector64((SByte*)(pClsVar3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Dp.DotProductBySelectedQuadruplet(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray3Ptr)); + var result = Dp.DotProductBySelectedQuadruplet(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_Int32_Vector64_SByte_1(); + var result = Dp.DotProductBySelectedQuadruplet(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_Int32_Vector64_SByte_1(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)), + AdvSimd.LoadVector64((SByte*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Dp.DotProductBySelectedQuadruplet(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((SByte*)(pFld2)), + AdvSimd.LoadVector64((SByte*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Dp.DotProductBySelectedQuadruplet(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((Int32*)(&test._fld1)), + AdvSimd.LoadVector128((SByte*)(&test._fld2)), + AdvSimd.LoadVector64((SByte*)(&test._fld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, SByte[] secondOp, SByte[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * Imm) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Dp)}.{nameof(Dp.DotProductBySelectedQuadruplet)}(Vector128, Vector128, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector128.UInt32.Vector128.Byte.3.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector128.UInt32.Vector128.Byte.3.cs new file mode 100644 index 000000000000..97d780a8c236 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector128.UInt32.Vector128.Byte.3.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void DotProductBySelectedQuadruplet_Vector128_UInt32_Vector128_Byte_3() + { + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_UInt32_Vector128_Byte_3(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_UInt32_Vector128_Byte_3 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, Byte[] inArray2, Byte[] inArray3, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_UInt32_Vector128_Byte_3 testClass) + { + var result = Dp.DotProductBySelectedQuadruplet(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_UInt32_Vector128_Byte_3 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)), + AdvSimd.LoadVector128((Byte*)(pFld3)), + 3 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly byte Imm = 3; + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + private static Byte[] _data3 = new Byte[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_UInt32_Vector128_Byte_3() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_UInt32_Vector128_Byte_3() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Dp.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Dp.DotProductBySelectedQuadruplet( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray3Ptr)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProductBySelectedQuadruplet), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProductBySelectedQuadruplet), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray3Ptr)), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Dp.DotProductBySelectedQuadruplet( + _clsVar1, + _clsVar2, + _clsVar3, + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((UInt32*)(pClsVar1)), + AdvSimd.LoadVector128((Byte*)(pClsVar2)), + AdvSimd.LoadVector128((Byte*)(pClsVar3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Dp.DotProductBySelectedQuadruplet(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray3Ptr)); + var result = Dp.DotProductBySelectedQuadruplet(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_UInt32_Vector128_Byte_3(); + var result = Dp.DotProductBySelectedQuadruplet(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_UInt32_Vector128_Byte_3(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)), + AdvSimd.LoadVector128((Byte*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Dp.DotProductBySelectedQuadruplet(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)), + AdvSimd.LoadVector128((Byte*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Dp.DotProductBySelectedQuadruplet(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((UInt32*)(&test._fld1)), + AdvSimd.LoadVector128((Byte*)(&test._fld2)), + AdvSimd.LoadVector128((Byte*)(&test._fld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, Byte[] secondOp, Byte[] thirdOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * Imm) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Dp)}.{nameof(Dp.DotProductBySelectedQuadruplet)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector128.UInt32.Vector64.Byte.1.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector128.UInt32.Vector64.Byte.1.cs new file mode 100644 index 000000000000..6f17c900fb28 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector128.UInt32.Vector64.Byte.1.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void DotProductBySelectedQuadruplet_Vector128_UInt32_Vector64_Byte_1() + { + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_UInt32_Vector64_Byte_1(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_UInt32_Vector64_Byte_1 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, Byte[] inArray2, Byte[] inArray3, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_UInt32_Vector64_Byte_1 testClass) + { + var result = Dp.DotProductBySelectedQuadruplet(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_UInt32_Vector64_Byte_1 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)), + AdvSimd.LoadVector64((Byte*)(pFld3)), + 1 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly byte Imm = 1; + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + private static Byte[] _data3 = new Byte[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector64 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_UInt32_Vector64_Byte_1() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_UInt32_Vector64_Byte_1() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Dp.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Dp.DotProductBySelectedQuadruplet( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray3Ptr)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProductBySelectedQuadruplet), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProductBySelectedQuadruplet), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray3Ptr)), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Dp.DotProductBySelectedQuadruplet( + _clsVar1, + _clsVar2, + _clsVar3, + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((UInt32*)(pClsVar1)), + AdvSimd.LoadVector128((Byte*)(pClsVar2)), + AdvSimd.LoadVector64((Byte*)(pClsVar3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Dp.DotProductBySelectedQuadruplet(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray3Ptr)); + var result = Dp.DotProductBySelectedQuadruplet(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_UInt32_Vector64_Byte_1(); + var result = Dp.DotProductBySelectedQuadruplet(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector128_UInt32_Vector64_Byte_1(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)), + AdvSimd.LoadVector64((Byte*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Dp.DotProductBySelectedQuadruplet(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((UInt32*)(pFld1)), + AdvSimd.LoadVector128((Byte*)(pFld2)), + AdvSimd.LoadVector64((Byte*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Dp.DotProductBySelectedQuadruplet(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector128((UInt32*)(&test._fld1)), + AdvSimd.LoadVector128((Byte*)(&test._fld2)), + AdvSimd.LoadVector64((Byte*)(&test._fld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, Byte[] secondOp, Byte[] thirdOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * Imm) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Dp)}.{nameof(Dp.DotProductBySelectedQuadruplet)}(Vector128, Vector128, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector64.Int32.Vector128.SByte.3.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector64.Int32.Vector128.SByte.3.cs new file mode 100644 index 000000000000..0bed8395f744 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector64.Int32.Vector128.SByte.3.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void DotProductBySelectedQuadruplet_Vector64_Int32_Vector128_SByte_3() + { + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_Int32_Vector128_SByte_3(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_Int32_Vector128_SByte_3 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, SByte[] inArray2, SByte[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_Int32_Vector128_SByte_3 testClass) + { + var result = Dp.DotProductBySelectedQuadruplet(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_Int32_Vector128_SByte_3 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)), + AdvSimd.LoadVector128((SByte*)(pFld3)), + 3 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly byte Imm = 3; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + private static SByte[] _data3 = new SByte[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector128 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_Int32_Vector128_SByte_3() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_Int32_Vector128_SByte_3() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Dp.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Dp.DotProductBySelectedQuadruplet( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray3Ptr)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProductBySelectedQuadruplet), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProductBySelectedQuadruplet), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((SByte*)(_dataTable.inArray3Ptr)), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Dp.DotProductBySelectedQuadruplet( + _clsVar1, + _clsVar2, + _clsVar3, + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((SByte*)(pClsVar2)), + AdvSimd.LoadVector128((SByte*)(pClsVar3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Dp.DotProductBySelectedQuadruplet(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray3Ptr)); + var result = Dp.DotProductBySelectedQuadruplet(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_Int32_Vector128_SByte_3(); + var result = Dp.DotProductBySelectedQuadruplet(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_Int32_Vector128_SByte_3(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)), + AdvSimd.LoadVector128((SByte*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Dp.DotProductBySelectedQuadruplet(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)), + AdvSimd.LoadVector128((SByte*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Dp.DotProductBySelectedQuadruplet(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((SByte*)(&test._fld2)), + AdvSimd.LoadVector128((SByte*)(&test._fld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, SByte[] secondOp, SByte[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * Imm) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Dp)}.{nameof(Dp.DotProductBySelectedQuadruplet)}(Vector64, Vector64, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector64.Int32.Vector64.SByte.1.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector64.Int32.Vector64.SByte.1.cs new file mode 100644 index 000000000000..3b610e5c3215 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector64.Int32.Vector64.SByte.1.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void DotProductBySelectedQuadruplet_Vector64_Int32_Vector64_SByte_1() + { + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_Int32_Vector64_SByte_1(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_Int32_Vector64_SByte_1 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, SByte[] inArray2, SByte[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_Int32_Vector64_SByte_1 testClass) + { + var result = Dp.DotProductBySelectedQuadruplet(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_Int32_Vector64_SByte_1 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)), + AdvSimd.LoadVector64((SByte*)(pFld3)), + 1 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(SByte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly byte Imm = 1; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static SByte[] _data2 = new SByte[Op2ElementCount]; + private static SByte[] _data3 = new SByte[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_Int32_Vector64_SByte_1() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_Int32_Vector64_SByte_1() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Dp.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Dp.DotProductBySelectedQuadruplet( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray3Ptr)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProductBySelectedQuadruplet), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProductBySelectedQuadruplet), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((SByte*)(_dataTable.inArray3Ptr)), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Dp.DotProductBySelectedQuadruplet( + _clsVar1, + _clsVar2, + _clsVar3, + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((SByte*)(pClsVar2)), + AdvSimd.LoadVector64((SByte*)(pClsVar3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Dp.DotProductBySelectedQuadruplet(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray3Ptr)); + var result = Dp.DotProductBySelectedQuadruplet(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_Int32_Vector64_SByte_1(); + var result = Dp.DotProductBySelectedQuadruplet(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_Int32_Vector64_SByte_1(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)), + AdvSimd.LoadVector64((SByte*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Dp.DotProductBySelectedQuadruplet(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((SByte*)(pFld2)), + AdvSimd.LoadVector64((SByte*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Dp.DotProductBySelectedQuadruplet(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((SByte*)(&test._fld2)), + AdvSimd.LoadVector64((SByte*)(&test._fld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + SByte[] inArray2 = new SByte[Op2ElementCount]; + SByte[] inArray3 = new SByte[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, SByte[] secondOp, SByte[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * Imm) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Dp)}.{nameof(Dp.DotProductBySelectedQuadruplet)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector64.UInt32.Vector128.Byte.3.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector64.UInt32.Vector128.Byte.3.cs new file mode 100644 index 000000000000..8652307fddf6 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector64.UInt32.Vector128.Byte.3.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void DotProductBySelectedQuadruplet_Vector64_UInt32_Vector128_Byte_3() + { + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_UInt32_Vector128_Byte_3(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_UInt32_Vector128_Byte_3 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, Byte[] inArray2, Byte[] inArray3, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_UInt32_Vector128_Byte_3 testClass) + { + var result = Dp.DotProductBySelectedQuadruplet(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_UInt32_Vector128_Byte_3 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)), + AdvSimd.LoadVector128((Byte*)(pFld3)), + 3 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly byte Imm = 3; + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + private static Byte[] _data3 = new Byte[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector128 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_UInt32_Vector128_Byte_3() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_UInt32_Vector128_Byte_3() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Dp.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Dp.DotProductBySelectedQuadruplet( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray3Ptr)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProductBySelectedQuadruplet), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProductBySelectedQuadruplet), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Byte*)(_dataTable.inArray3Ptr)), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Dp.DotProductBySelectedQuadruplet( + _clsVar1, + _clsVar2, + _clsVar3, + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((UInt32*)(pClsVar1)), + AdvSimd.LoadVector64((Byte*)(pClsVar2)), + AdvSimd.LoadVector128((Byte*)(pClsVar3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Dp.DotProductBySelectedQuadruplet(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray3Ptr)); + var result = Dp.DotProductBySelectedQuadruplet(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_UInt32_Vector128_Byte_3(); + var result = Dp.DotProductBySelectedQuadruplet(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_UInt32_Vector128_Byte_3(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)), + AdvSimd.LoadVector128((Byte*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Dp.DotProductBySelectedQuadruplet(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)), + AdvSimd.LoadVector128((Byte*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Dp.DotProductBySelectedQuadruplet(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((UInt32*)(&test._fld1)), + AdvSimd.LoadVector64((Byte*)(&test._fld2)), + AdvSimd.LoadVector128((Byte*)(&test._fld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, Byte[] secondOp, Byte[] thirdOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * Imm) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Dp)}.{nameof(Dp.DotProductBySelectedQuadruplet)}(Vector64, Vector64, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector64.UInt32.Vector64.Byte.1.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector64.UInt32.Vector64.Byte.1.cs new file mode 100644 index 000000000000..c0c8c9d9c2b2 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/DotProductBySelectedQuadruplet.Vector64.UInt32.Vector64.Byte.1.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void DotProductBySelectedQuadruplet_Vector64_UInt32_Vector64_Byte_1() + { + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_UInt32_Vector64_Byte_1(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_UInt32_Vector64_Byte_1 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(UInt32[] inArray1, Byte[] inArray2, Byte[] inArray3, UInt32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_UInt32_Vector64_Byte_1 testClass) + { + var result = Dp.DotProductBySelectedQuadruplet(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_UInt32_Vector64_Byte_1 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)), + AdvSimd.LoadVector64((Byte*)(pFld3)), + 1 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Byte); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(UInt32); + private static readonly byte Imm = 1; + + private static UInt32[] _data1 = new UInt32[Op1ElementCount]; + private static Byte[] _data2 = new Byte[Op2ElementCount]; + private static Byte[] _data3 = new Byte[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_UInt32_Vector64_Byte_1() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_UInt32_Vector64_Byte_1() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); } + _dataTable = new DataTable(_data1, _data2, _data3, new UInt32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Dp.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Dp.DotProductBySelectedQuadruplet( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray3Ptr)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProductBySelectedQuadruplet), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Dp).GetMethod(nameof(Dp.DotProductBySelectedQuadruplet), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Byte*)(_dataTable.inArray3Ptr)), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Dp.DotProductBySelectedQuadruplet( + _clsVar1, + _clsVar2, + _clsVar3, + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((UInt32*)(pClsVar1)), + AdvSimd.LoadVector64((Byte*)(pClsVar2)), + AdvSimd.LoadVector64((Byte*)(pClsVar3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Dp.DotProductBySelectedQuadruplet(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray3Ptr)); + var result = Dp.DotProductBySelectedQuadruplet(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_UInt32_Vector64_Byte_1(); + var result = Dp.DotProductBySelectedQuadruplet(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__DotProductBySelectedQuadruplet_Vector64_UInt32_Vector64_Byte_1(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)), + AdvSimd.LoadVector64((Byte*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Dp.DotProductBySelectedQuadruplet(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((UInt32*)(pFld1)), + AdvSimd.LoadVector64((Byte*)(pFld2)), + AdvSimd.LoadVector64((Byte*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Dp.DotProductBySelectedQuadruplet(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Dp.DotProductBySelectedQuadruplet( + AdvSimd.LoadVector64((UInt32*)(&test._fld1)), + AdvSimd.LoadVector64((Byte*)(&test._fld2)), + AdvSimd.LoadVector64((Byte*)(&test._fld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + UInt32[] inArray1 = new UInt32[Op1ElementCount]; + Byte[] inArray2 = new Byte[Op2ElementCount]; + Byte[] inArray3 = new Byte[Op3ElementCount]; + UInt32[] outArray = new UInt32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(UInt32[] firstOp, Byte[] secondOp, Byte[] thirdOp, UInt32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * Imm) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Dp)}.{nameof(Dp.DotProductBySelectedQuadruplet)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Dp/Dp_r.csproj b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/Dp_r.csproj new file mode 100644 index 000000000000..096b7a177ea6 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/Dp_r.csproj @@ -0,0 +1,27 @@ + + + Exe + true + + + Embedded + + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Dp/Dp_ro.csproj b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/Dp_ro.csproj new file mode 100644 index 000000000000..4bd4399809f9 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/Dp_ro.csproj @@ -0,0 +1,27 @@ + + + Exe + true + + + Embedded + True + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Dp/Program.Dp.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/Program.Dp.cs new file mode 100644 index 000000000000..94447b003f39 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Dp/Program.Dp.cs @@ -0,0 +1,29 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + static Program() + { + TestList = new Dictionary() { + ["DotProduct.Vector64.Int32"] = DotProduct_Vector64_Int32, + ["DotProduct.Vector64.UInt32"] = DotProduct_Vector64_UInt32, + ["DotProduct.Vector128.Int32"] = DotProduct_Vector128_Int32, + ["DotProduct.Vector128.UInt32"] = DotProduct_Vector128_UInt32, + ["DotProductBySelectedQuadruplet.Vector64.Int32.Vector64.SByte.1"] = DotProductBySelectedQuadruplet_Vector64_Int32_Vector64_SByte_1, + ["DotProductBySelectedQuadruplet.Vector64.Int32.Vector128.SByte.3"] = DotProductBySelectedQuadruplet_Vector64_Int32_Vector128_SByte_3, + ["DotProductBySelectedQuadruplet.Vector64.UInt32.Vector64.Byte.1"] = DotProductBySelectedQuadruplet_Vector64_UInt32_Vector64_Byte_1, + ["DotProductBySelectedQuadruplet.Vector64.UInt32.Vector128.Byte.3"] = DotProductBySelectedQuadruplet_Vector64_UInt32_Vector128_Byte_3, + ["DotProductBySelectedQuadruplet.Vector128.Int32.Vector64.SByte.1"] = DotProductBySelectedQuadruplet_Vector128_Int32_Vector64_SByte_1, + ["DotProductBySelectedQuadruplet.Vector128.Int32.Vector128.SByte.3"] = DotProductBySelectedQuadruplet_Vector128_Int32_Vector128_SByte_3, + ["DotProductBySelectedQuadruplet.Vector128.UInt32.Vector64.Byte.1"] = DotProductBySelectedQuadruplet_Vector128_UInt32_Vector64_Byte_1, + ["DotProductBySelectedQuadruplet.Vector128.UInt32.Vector128.Byte.3"] = DotProductBySelectedQuadruplet_Vector128_UInt32_Vector128_Byte_3, + }; + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingAndAddSaturateHighScalar.Vector64.Int16.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingAndAddSaturateHighScalar.Vector64.Int16.cs new file mode 100644 index 000000000000..ab97e38ac5ac --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingAndAddSaturateHighScalar.Vector64.Int16.cs @@ -0,0 +1,577 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int16() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int16 testClass) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int16 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar( + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar( + AdvSimd.LoadVector64((Int16*)(pClsVar1)), + AdvSimd.LoadVector64((Int16*)(pClsVar2)), + AdvSimd.LoadVector64((Int16*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int16(); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int16(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar( + AdvSimd.LoadVector64((Int16*)(&test._fld1)), + AdvSimd.LoadVector64((Int16*)(&test._fld2)), + AdvSimd.LoadVector64((Int16*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[0], secondOp[0], thirdOp[0]) != result[0]) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm.Arm64)}.{nameof(Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingAndAddSaturateHighScalar.Vector64.Int32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingAndAddSaturateHighScalar.Vector64.Int32.cs new file mode 100644 index 000000000000..fb9ae622a12e --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingAndAddSaturateHighScalar.Vector64.Int32.cs @@ -0,0 +1,577 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int32() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int32 testClass) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int32 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar( + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar( + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((Int32*)(pClsVar2)), + AdvSimd.LoadVector64((Int32*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int32(); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int32(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar( + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((Int32*)(&test._fld2)), + AdvSimd.LoadVector64((Int32*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[0], secondOp[0], thirdOp[0]) != result[0]) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm.Arm64)}.{nameof(Rdm.Arm64.MultiplyRoundedDoublingAndAddSaturateHighScalar)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingAndSubtractSaturateHighScalar.Vector64.Int16.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingAndSubtractSaturateHighScalar.Vector64.Int16.cs new file mode 100644 index 000000000000..ba446b1ee2ff --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingAndSubtractSaturateHighScalar.Vector64.Int16.cs @@ -0,0 +1,577 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int16() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int16 testClass) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int16 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar( + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar( + AdvSimd.LoadVector64((Int16*)(pClsVar1)), + AdvSimd.LoadVector64((Int16*)(pClsVar2)), + AdvSimd.LoadVector64((Int16*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int16(); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int16(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar( + AdvSimd.LoadVector64((Int16*)(&test._fld1)), + AdvSimd.LoadVector64((Int16*)(&test._fld2)), + AdvSimd.LoadVector64((Int16*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[0], secondOp[0], thirdOp[0]) != result[0]) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm.Arm64)}.{nameof(Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingAndSubtractSaturateHighScalar.Vector64.Int32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingAndSubtractSaturateHighScalar.Vector64.Int32.cs new file mode 100644 index 000000000000..137b304677c1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingAndSubtractSaturateHighScalar.Vector64.Int32.cs @@ -0,0 +1,577 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int32() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int32 testClass) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int32 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar( + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar( + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((Int32*)(pClsVar2)), + AdvSimd.LoadVector64((Int32*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int32(); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int32(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar( + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((Int32*)(&test._fld2)), + AdvSimd.LoadVector64((Int32*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[0], secondOp[0], thirdOp[0]) != result[0]) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm.Arm64)}.{nameof(Rdm.Arm64.MultiplyRoundedDoublingAndSubtractSaturateHighScalar)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh.Vector64.Int16.Vector128.Int16.7.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh.Vector64.Int16.Vector128.Int16.7.cs new file mode 100644 index 000000000000..f115f97c5509 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh.Vector64.Int16.Vector128.Int16.7.cs @@ -0,0 +1,588 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7 testClass) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 7); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)), + 7 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly byte Imm = 7; + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector128 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)7 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)), + (byte)7 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pClsVar1)), + AdvSimd.LoadVector64((Int16*)(pClsVar2)), + AdvSimd.LoadVector128((Int16*)(pClsVar3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(&test._fld1)), + AdvSimd.LoadVector64((Int16*)(&test._fld2)), + AdvSimd.LoadVector128((Int16*)(&test._fld3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm.Arm64)}.{nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh)}(Vector64, Vector64, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh.Vector64.Int16.Vector64.Int16.3.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh.Vector64.Int16.Vector64.Int16.3.cs new file mode 100644 index 000000000000..3d1bc4bd9a0b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh.Vector64.Int16.Vector64.Int16.3.cs @@ -0,0 +1,588 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3 testClass) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)), + 3 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly byte Imm = 3; + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pClsVar1)), + AdvSimd.LoadVector64((Int16*)(pClsVar2)), + AdvSimd.LoadVector64((Int16*)(pClsVar3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(&test._fld1)), + AdvSimd.LoadVector64((Int16*)(&test._fld2)), + AdvSimd.LoadVector64((Int16*)(&test._fld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm.Arm64)}.{nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh.Vector64.Int32.Vector128.Int32.3.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh.Vector64.Int32.Vector128.Int32.3.cs new file mode 100644 index 000000000000..1f0ca7fa6bd9 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh.Vector64.Int32.Vector128.Int32.3.cs @@ -0,0 +1,588 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3 testClass) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)), + 3 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly byte Imm = 3; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector128 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((Int32*)(pClsVar2)), + AdvSimd.LoadVector128((Int32*)(pClsVar3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((Int32*)(&test._fld2)), + AdvSimd.LoadVector128((Int32*)(&test._fld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm.Arm64)}.{nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh)}(Vector64, Vector64, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh.Vector64.Int32.Vector64.Int32.1.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh.Vector64.Int32.Vector64.Int32.1.cs new file mode 100644 index 000000000000..a0c41009e6af --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh.Vector64.Int32.Vector64.Int32.1.cs @@ -0,0 +1,588 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1 testClass) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)), + 1 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly byte Imm = 1; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((Int32*)(pClsVar2)), + AdvSimd.LoadVector64((Int32*)(pClsVar3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((Int32*)(&test._fld2)), + AdvSimd.LoadVector64((Int32*)(&test._fld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm.Arm64)}.{nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh.Vector64.Int16.Vector128.Int16.7.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh.Vector64.Int16.Vector128.Int16.7.cs new file mode 100644 index 000000000000..28eb2fdb8cdd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh.Vector64.Int16.Vector128.Int16.7.cs @@ -0,0 +1,588 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7 testClass) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 7); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)), + 7 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly byte Imm = 7; + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector128 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)7 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)), + (byte)7 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pClsVar1)), + AdvSimd.LoadVector64((Int16*)(pClsVar2)), + AdvSimd.LoadVector128((Int16*)(pClsVar3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(&test._fld1)), + AdvSimd.LoadVector64((Int16*)(&test._fld2)), + AdvSimd.LoadVector128((Int16*)(&test._fld3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm.Arm64)}.{nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh)}(Vector64, Vector64, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh.Vector64.Int16.Vector64.Int16.3.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh.Vector64.Int16.Vector64.Int16.3.cs new file mode 100644 index 000000000000..814fd846cb76 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh.Vector64.Int16.Vector64.Int16.3.cs @@ -0,0 +1,588 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3 testClass) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)), + 3 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly byte Imm = 3; + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pClsVar1)), + AdvSimd.LoadVector64((Int16*)(pClsVar2)), + AdvSimd.LoadVector64((Int16*)(pClsVar3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(&test._fld1)), + AdvSimd.LoadVector64((Int16*)(&test._fld2)), + AdvSimd.LoadVector64((Int16*)(&test._fld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm.Arm64)}.{nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh.Vector64.Int32.Vector128.Int32.3.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh.Vector64.Int32.Vector128.Int32.3.cs new file mode 100644 index 000000000000..01a322342031 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh.Vector64.Int32.Vector128.Int32.3.cs @@ -0,0 +1,588 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3 testClass) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)), + 3 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly byte Imm = 3; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector128 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((Int32*)(pClsVar2)), + AdvSimd.LoadVector128((Int32*)(pClsVar3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((Int32*)(&test._fld2)), + AdvSimd.LoadVector128((Int32*)(&test._fld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm.Arm64)}.{nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh)}(Vector64, Vector64, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh.Vector64.Int32.Vector64.Int32.1.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh.Vector64.Int32.Vector64.Int32.1.cs new file mode 100644 index 000000000000..1137683e4450 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh.Vector64.Int32.Vector64.Int32.1.cs @@ -0,0 +1,588 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1 testClass) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)), + 1 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly byte Imm = 1; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.Arm64.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm.Arm64).GetMethod(nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((Int32*)(pClsVar2)), + AdvSimd.LoadVector64((Int32*)(pClsVar3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((Int32*)(&test._fld2)), + AdvSimd.LoadVector64((Int32*)(&test._fld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if (Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]) + { + succeeded = false; + } + else + { + for (var i = 1; i < RetElementCount; i++) + { + if (result[i] != 0) + { + succeeded = false; + break; + } + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm.Arm64)}.{nameof(Rdm.Arm64.MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/Program.Rdm.Arm64.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/Program.Rdm.Arm64.cs new file mode 100644 index 000000000000..acc38ca01eb5 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/Program.Rdm.Arm64.cs @@ -0,0 +1,29 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + static Program() + { + TestList = new Dictionary() { + ["MultiplyRoundedDoublingAndAddSaturateHighScalar.Vector64.Int16"] = MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int16, + ["MultiplyRoundedDoublingAndAddSaturateHighScalar.Vector64.Int32"] = MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int32, + ["MultiplyRoundedDoublingAndSubtractSaturateHighScalar.Vector64.Int16"] = MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int16, + ["MultiplyRoundedDoublingAndSubtractSaturateHighScalar.Vector64.Int32"] = MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int32, + ["MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh.Vector64.Int16.Vector64.Int16.3"] = MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3, + ["MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh.Vector64.Int16.Vector128.Int16.7"] = MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7, + ["MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh.Vector64.Int32.Vector64.Int32.1"] = MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1, + ["MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh.Vector64.Int32.Vector128.Int32.3"] = MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3, + ["MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh.Vector64.Int16.Vector64.Int16.3"] = MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3, + ["MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh.Vector64.Int16.Vector128.Int16.7"] = MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7, + ["MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh.Vector64.Int32.Vector64.Int32.1"] = MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1, + ["MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh.Vector64.Int32.Vector128.Int32.3"] = MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3, + }; + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/Rdm.Arm64_r.csproj b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/Rdm.Arm64_r.csproj new file mode 100644 index 000000000000..a7fffd28af79 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/Rdm.Arm64_r.csproj @@ -0,0 +1,27 @@ + + + Exe + true + + + Embedded + + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/Rdm.Arm64_ro.csproj b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/Rdm.Arm64_ro.csproj new file mode 100644 index 000000000000..fdcd86c3394d --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm.Arm64/Rdm.Arm64_ro.csproj @@ -0,0 +1,27 @@ + + + Exe + true + + + Embedded + True + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndAddSaturateHigh.Vector128.Int16.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndAddSaturateHigh.Vector128.Int16.cs new file mode 100644 index 000000000000..80f6eea5e1fb --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndAddSaturateHigh.Vector128.Int16.cs @@ -0,0 +1,570 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int16() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int16 testClass) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int16 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingAndAddSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingAndAddSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pClsVar1)), + AdvSimd.LoadVector128((Int16*)(pClsVar2)), + AdvSimd.LoadVector128((Int16*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int16(); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int16(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector128((Int16*)(&test._fld1)), + AdvSimd.LoadVector128((Int16*)(&test._fld2)), + AdvSimd.LoadVector128((Int16*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingAndAddSaturateHigh)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndAddSaturateHigh.Vector128.Int32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndAddSaturateHigh.Vector128.Int32.cs new file mode 100644 index 000000000000..49c6df249766 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndAddSaturateHigh.Vector128.Int32.cs @@ -0,0 +1,570 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int32() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int32 testClass) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int32 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingAndAddSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingAndAddSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pClsVar1)), + AdvSimd.LoadVector128((Int32*)(pClsVar2)), + AdvSimd.LoadVector128((Int32*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int32(); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int32(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector128((Int32*)(&test._fld1)), + AdvSimd.LoadVector128((Int32*)(&test._fld2)), + AdvSimd.LoadVector128((Int32*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingAndAddSaturateHigh)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndAddSaturateHigh.Vector64.Int16.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndAddSaturateHigh.Vector64.Int16.cs new file mode 100644 index 000000000000..434ba2df4055 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndAddSaturateHigh.Vector64.Int16.cs @@ -0,0 +1,570 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int16() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int16 testClass) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int16 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pClsVar1)), + AdvSimd.LoadVector64((Int16*)(pClsVar2)), + AdvSimd.LoadVector64((Int16*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int16(); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int16(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(&test._fld1)), + AdvSimd.LoadVector64((Int16*)(&test._fld2)), + AdvSimd.LoadVector64((Int16*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingAndAddSaturateHigh)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndAddSaturateHigh.Vector64.Int32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndAddSaturateHigh.Vector64.Int32.cs new file mode 100644 index 000000000000..1f45fd84f1b6 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndAddSaturateHigh.Vector64.Int32.cs @@ -0,0 +1,570 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int32() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int32 testClass) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int32 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((Int32*)(pClsVar2)), + AdvSimd.LoadVector64((Int32*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int32(); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int32(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((Int32*)(&test._fld2)), + AdvSimd.LoadVector64((Int32*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingAndAddSaturateHigh)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndSubtractSaturateHigh.Vector128.Int16.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndSubtractSaturateHigh.Vector128.Int16.cs new file mode 100644 index 000000000000..797a501c23dd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndSubtractSaturateHigh.Vector128.Int16.cs @@ -0,0 +1,570 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int16() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int16 testClass) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int16 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pClsVar1)), + AdvSimd.LoadVector128((Int16*)(pClsVar2)), + AdvSimd.LoadVector128((Int16*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int16(); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int16(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int16*)(&test._fld1)), + AdvSimd.LoadVector128((Int16*)(&test._fld2)), + AdvSimd.LoadVector128((Int16*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndSubtractSaturateHigh.Vector128.Int32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndSubtractSaturateHigh.Vector128.Int32.cs new file mode 100644 index 000000000000..0a42e7d2f16b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndSubtractSaturateHigh.Vector128.Int32.cs @@ -0,0 +1,570 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int32() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int32 testClass) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int32 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pClsVar1)), + AdvSimd.LoadVector128((Int32*)(pClsVar2)), + AdvSimd.LoadVector128((Int32*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int32(); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int32(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int32*)(&test._fld1)), + AdvSimd.LoadVector128((Int32*)(&test._fld2)), + AdvSimd.LoadVector128((Int32*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndSubtractSaturateHigh.Vector64.Int16.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndSubtractSaturateHigh.Vector64.Int16.cs new file mode 100644 index 000000000000..c5efec4f59da --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndSubtractSaturateHigh.Vector64.Int16.cs @@ -0,0 +1,570 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int16() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int16(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int16 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int16 testClass) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int16 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int16() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int16() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pClsVar1)), + AdvSimd.LoadVector64((Int16*)(pClsVar2)), + AdvSimd.LoadVector64((Int16*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int16(); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int16(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(&test._fld1)), + AdvSimd.LoadVector64((Int16*)(&test._fld2)), + AdvSimd.LoadVector64((Int16*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndSubtractSaturateHigh.Vector64.Int32.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndSubtractSaturateHigh.Vector64.Int32.cs new file mode 100644 index 000000000000..71f181c8cf22 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingAndSubtractSaturateHigh.Vector64.Int32.cs @@ -0,0 +1,570 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int32() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int32(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int32 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int32 testClass) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(_fld1, _fld2, _fld3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int32 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)) + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int32() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int32() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)) + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((Int32*)(pClsVar2)), + AdvSimd.LoadVector64((Int32*)(pClsVar3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(op1, op2, op3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int32(); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int32(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(_fld1, _fld2, _fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((Int32*)(&test._fld2)), + AdvSimd.LoadVector64((Int32*)(&test._fld3)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingAndSubtractSaturateHigh)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector128.Int16.Vector128.Int16.7.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector128.Int16.Vector128.Int16.7.cs new file mode 100644 index 000000000000..07d651438c65 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector128.Int16.Vector128.Int16.7.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector128_Int16_7() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector128_Int16_7(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector128_Int16_7 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector128_Int16_7 testClass) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 7); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector128_Int16_7 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)), + 7 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly byte Imm = 7; + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector128_Int16_7() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector128_Int16_7() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)7 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)), + (byte)7 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pClsVar1)), + AdvSimd.LoadVector128((Int16*)(pClsVar2)), + AdvSimd.LoadVector128((Int16*)(pClsVar3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector128_Int16_7(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector128_Int16_7(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int16*)(&test._fld1)), + AdvSimd.LoadVector128((Int16*)(&test._fld2)), + AdvSimd.LoadVector128((Int16*)(&test._fld3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector128.Int16.Vector64.Int16.3.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector128.Int16.Vector64.Int16.3.cs new file mode 100644 index 000000000000..1db83e7508d5 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector128.Int16.Vector64.Int16.3.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector64_Int16_3() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector64_Int16_3(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector64_Int16_3 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector64_Int16_3 testClass) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector64_Int16_3 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)), + 3 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly byte Imm = 3; + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector64 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector64_Int16_3() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector64_Int16_3() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pClsVar1)), + AdvSimd.LoadVector128((Int16*)(pClsVar2)), + AdvSimd.LoadVector64((Int16*)(pClsVar3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector64_Int16_3(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector64_Int16_3(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int16*)(&test._fld1)), + AdvSimd.LoadVector128((Int16*)(&test._fld2)), + AdvSimd.LoadVector64((Int16*)(&test._fld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh)}(Vector128, Vector128, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector128.Int32.Vector128.Int32.3.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector128.Int32.Vector128.Int32.3.cs new file mode 100644 index 000000000000..2c96560bbaa8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector128.Int32.Vector128.Int32.3.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector128_Int32_3() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector128_Int32_3(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector128_Int32_3 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector128_Int32_3 testClass) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector128_Int32_3 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)), + 3 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly byte Imm = 3; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector128_Int32_3() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector128_Int32_3() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pClsVar1)), + AdvSimd.LoadVector128((Int32*)(pClsVar2)), + AdvSimd.LoadVector128((Int32*)(pClsVar3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector128_Int32_3(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector128_Int32_3(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int32*)(&test._fld1)), + AdvSimd.LoadVector128((Int32*)(&test._fld2)), + AdvSimd.LoadVector128((Int32*)(&test._fld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector128.Int32.Vector64.Int32.1.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector128.Int32.Vector64.Int32.1.cs new file mode 100644 index 000000000000..daf8929fa610 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector128.Int32.Vector64.Int32.1.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector64_Int32_1() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector64_Int32_1(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector64_Int32_1 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector64_Int32_1 testClass) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector64_Int32_1 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)), + 1 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly byte Imm = 1; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector64 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector64_Int32_1() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector64_Int32_1() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pClsVar1)), + AdvSimd.LoadVector128((Int32*)(pClsVar2)), + AdvSimd.LoadVector64((Int32*)(pClsVar3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector64_Int32_1(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector64_Int32_1(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector128((Int32*)(&test._fld1)), + AdvSimd.LoadVector128((Int32*)(&test._fld2)), + AdvSimd.LoadVector64((Int32*)(&test._fld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh)}(Vector128, Vector128, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector64.Int16.Vector128.Int16.7.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector64.Int16.Vector128.Int16.7.cs new file mode 100644 index 000000000000..43dc029ad8cc --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector64.Int16.Vector128.Int16.7.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7 testClass) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 7); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)), + 7 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly byte Imm = 7; + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector128 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)7 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)), + (byte)7 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pClsVar1)), + AdvSimd.LoadVector64((Int16*)(pClsVar2)), + AdvSimd.LoadVector128((Int16*)(pClsVar3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(&test._fld1)), + AdvSimd.LoadVector64((Int16*)(&test._fld2)), + AdvSimd.LoadVector128((Int16*)(&test._fld3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh)}(Vector64, Vector64, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector64.Int16.Vector64.Int16.3.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector64.Int16.Vector64.Int16.3.cs new file mode 100644 index 000000000000..444a552795dd --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector64.Int16.Vector64.Int16.3.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3 testClass) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)), + 3 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly byte Imm = 3; + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pClsVar1)), + AdvSimd.LoadVector64((Int16*)(pClsVar2)), + AdvSimd.LoadVector64((Int16*)(pClsVar3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int16*)(&test._fld1)), + AdvSimd.LoadVector64((Int16*)(&test._fld2)), + AdvSimd.LoadVector64((Int16*)(&test._fld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector64.Int32.Vector128.Int32.3.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector64.Int32.Vector128.Int32.3.cs new file mode 100644 index 000000000000..76e31d40a211 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector64.Int32.Vector128.Int32.3.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3 testClass) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)), + 3 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly byte Imm = 3; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector128 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((Int32*)(pClsVar2)), + AdvSimd.LoadVector128((Int32*)(pClsVar3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((Int32*)(&test._fld2)), + AdvSimd.LoadVector128((Int32*)(&test._fld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh)}(Vector64, Vector64, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector64.Int32.Vector64.Int32.1.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector64.Int32.Vector64.Int32.1.cs new file mode 100644 index 000000000000..ececd3cc201e --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector64.Int32.Vector64.Int32.1.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1 testClass) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)), + 1 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly byte Imm = 1; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((Int32*)(pClsVar2)), + AdvSimd.LoadVector64((Int32*)(pClsVar3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh( + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((Int32*)(&test._fld2)), + AdvSimd.LoadVector64((Int32*)(&test._fld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector128.Int16.Vector128.Int16.7.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector128.Int16.Vector128.Int16.7.cs new file mode 100644 index 000000000000..1637cc48c24b --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector128.Int16.Vector128.Int16.7.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector128_Int16_7() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector128_Int16_7(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector128_Int16_7 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector128_Int16_7 testClass) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 7); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector128_Int16_7 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)), + 7 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly byte Imm = 7; + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector128_Int16_7() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector128_Int16_7() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)7 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)), + (byte)7 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pClsVar1)), + AdvSimd.LoadVector128((Int16*)(pClsVar2)), + AdvSimd.LoadVector128((Int16*)(pClsVar3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector128_Int16_7(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector128_Int16_7(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int16*)(&test._fld1)), + AdvSimd.LoadVector128((Int16*)(&test._fld2)), + AdvSimd.LoadVector128((Int16*)(&test._fld3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector128.Int16.Vector64.Int16.3.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector128.Int16.Vector64.Int16.3.cs new file mode 100644 index 000000000000..700030181344 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector128.Int16.Vector64.Int16.3.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector64_Int16_3() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector64_Int16_3(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector64_Int16_3 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector64_Int16_3 testClass) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector64_Int16_3 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)), + 3 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly byte Imm = 3; + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector64 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector64_Int16_3() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector64_Int16_3() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pClsVar1)), + AdvSimd.LoadVector128((Int16*)(pClsVar2)), + AdvSimd.LoadVector64((Int16*)(pClsVar3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector64_Int16_3(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector64_Int16_3(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int16*)(pFld1)), + AdvSimd.LoadVector128((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int16*)(&test._fld1)), + AdvSimd.LoadVector128((Int16*)(&test._fld2)), + AdvSimd.LoadVector64((Int16*)(&test._fld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh)}(Vector128, Vector128, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector128.Int32.Vector128.Int32.3.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector128.Int32.Vector128.Int32.3.cs new file mode 100644 index 000000000000..33aaac5d26f9 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector128.Int32.Vector128.Int32.3.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector128_Int32_3() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector128_Int32_3(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector128_Int32_3 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector128_Int32_3 testClass) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector128_Int32_3 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)), + 3 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly byte Imm = 3; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector128 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector128_Int32_3() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector128_Int32_3() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pClsVar1)), + AdvSimd.LoadVector128((Int32*)(pClsVar2)), + AdvSimd.LoadVector128((Int32*)(pClsVar3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector128_Int32_3(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector128_Int32_3(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int32*)(&test._fld1)), + AdvSimd.LoadVector128((Int32*)(&test._fld2)), + AdvSimd.LoadVector128((Int32*)(&test._fld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh)}(Vector128, Vector128, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector128.Int32.Vector64.Int32.1.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector128.Int32.Vector64.Int32.1.cs new file mode 100644 index 000000000000..e12b8783f3e5 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector128.Int32.Vector64.Int32.1.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector64_Int32_1() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector64_Int32_1(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector64_Int32_1 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector128 _fld1; + public Vector128 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector64_Int32_1 testClass) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector64_Int32_1 testClass) + { + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)), + 1 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly byte Imm = 1; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector128 _clsVar1; + private static Vector128 _clsVar2; + private static Vector64 _clsVar3; + + private Vector128 _fld1; + private Vector128 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector64_Int32_1() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector64_Int32_1() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector128), typeof(Vector128), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector128* pClsVar1 = &_clsVar1) + fixed (Vector128* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pClsVar1)), + AdvSimd.LoadVector128((Int32*)(pClsVar2)), + AdvSimd.LoadVector64((Int32*)(pClsVar3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector64_Int32_1(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector64_Int32_1(); + + fixed (Vector128* pFld1 = &test._fld1) + fixed (Vector128* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector128* pFld1 = &_fld1) + fixed (Vector128* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int32*)(pFld1)), + AdvSimd.LoadVector128((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector128((Int32*)(&test._fld1)), + AdvSimd.LoadVector128((Int32*)(&test._fld2)), + AdvSimd.LoadVector64((Int32*)(&test._fld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector128 op1, Vector128 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh)}(Vector128, Vector128, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector64.Int16.Vector128.Int16.7.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector64.Int16.Vector128.Int16.7.cs new file mode 100644 index 000000000000..e22e2e474e90 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector64.Int16.Vector128.Int16.7.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7 testClass) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 7); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)), + 7 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly byte Imm = 7; + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector128 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)7 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)), + (byte)7 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pClsVar1)), + AdvSimd.LoadVector64((Int16*)(pClsVar2)), + AdvSimd.LoadVector128((Int16*)(pClsVar3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector128((Int16*)(pFld3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 7); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(&test._fld1)), + AdvSimd.LoadVector64((Int16*)(&test._fld2)), + AdvSimd.LoadVector128((Int16*)(&test._fld3)), + 7 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh)}(Vector64, Vector64, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector64.Int16.Vector64.Int16.3.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector64.Int16.Vector64.Int16.3.cs new file mode 100644 index 000000000000..2e5e004eef5c --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector64.Int16.Vector64.Int16.3.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int16[] inArray1, Int16[] inArray2, Int16[] inArray3, Int16[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3 testClass) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)), + 3 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int16); + private static readonly byte Imm = 3; + + private static Int16[] _data1 = new Int16[Op1ElementCount]; + private static Int16[] _data2 = new Int16[Op2ElementCount]; + private static Int16[] _data3 = new Int16[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int16[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pClsVar1)), + AdvSimd.LoadVector64((Int16*)(pClsVar2)), + AdvSimd.LoadVector64((Int16*)(pClsVar3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(pFld1)), + AdvSimd.LoadVector64((Int16*)(pFld2)), + AdvSimd.LoadVector64((Int16*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int16*)(&test._fld1)), + AdvSimd.LoadVector64((Int16*)(&test._fld2)), + AdvSimd.LoadVector64((Int16*)(&test._fld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int16[] inArray1 = new Int16[Op1ElementCount]; + Int16[] inArray2 = new Int16[Op2ElementCount]; + Int16[] inArray3 = new Int16[Op3ElementCount]; + Int16[] outArray = new Int16[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector64.Int32.Vector128.Int32.3.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector64.Int32.Vector128.Int32.3.cs new file mode 100644 index 000000000000..92d268afec87 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector64.Int32.Vector128.Int32.3.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector128 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3 testClass) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)), + 3 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 16; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly byte Imm = 3; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector128 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector128 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector128), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)), + (byte)3 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector128* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((Int32*)(pClsVar2)), + AdvSimd.LoadVector128((Int32*)(pClsVar3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector128* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector128* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector128((Int32*)(pFld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 3); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((Int32*)(&test._fld2)), + AdvSimd.LoadVector128((Int32*)(&test._fld3)), + 3 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector128 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh)}(Vector64, Vector64, Vector128): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector64.Int32.Vector64.Int32.1.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector64.Int32.Vector64.Int32.1.cs new file mode 100644 index 000000000000..bda1ae293e54 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector64.Int32.Vector64.Int32.1.cs @@ -0,0 +1,581 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1() + { + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if (AdvSimd.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if (AdvSimd.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1 + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] inArray3, Int32[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf(); + if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public Vector64 _fld1; + public Vector64 _fld2; + public Vector64 _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref testStruct._fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + return testStruct; + } + + public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1 testClass) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1 testClass) + { + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)), + 1 + ); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = 8; + + private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op2ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int Op3ElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Int32); + private static readonly byte Imm = 1; + + private static Int32[] _data1 = new Int32[Op1ElementCount]; + private static Int32[] _data2 = new Int32[Op2ElementCount]; + private static Int32[] _data3 = new Int32[Op3ElementCount]; + + private static Vector64 _clsVar1; + private static Vector64 _clsVar2; + private static Vector64 _clsVar3; + + private Vector64 _fld1; + private Vector64 _fld2; + private Vector64 _fld3; + + private DataTable _dataTable; + + static SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + } + + public SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld1), ref Unsafe.As(ref _data1[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld2), ref Unsafe.As(ref _data2[0]), (uint)Unsafe.SizeOf>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld3), ref Unsafe.As(ref _data3[0]), (uint)Unsafe.SizeOf>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); } + _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Rdm.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read>(_dataTable.inArray1Ptr), + Unsafe.Read>(_dataTable.inArray2Ptr), + Unsafe.Read>(_dataTable.inArray3Ptr), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + var result = typeof(Rdm).GetMethod(nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh), new Type[] { typeof(Vector64), typeof(Vector64), typeof(Vector64), typeof(byte) }) + .Invoke(null, new object[] { + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)), + AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)), + (byte)1 + }); + + Unsafe.Write(_dataTable.outArrayPtr, (Vector64)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + _clsVar1, + _clsVar2, + _clsVar3, + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed (Vector64* pClsVar1 = &_clsVar1) + fixed (Vector64* pClsVar2 = &_clsVar2) + fixed (Vector64* pClsVar3 = &_clsVar3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pClsVar1)), + AdvSimd.LoadVector64((Int32*)(pClsVar2)), + AdvSimd.LoadVector64((Int32*)(pClsVar3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read>(_dataTable.inArray2Ptr); + var op3 = Unsafe.Read>(_dataTable.inArray3Ptr); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)); + var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)); + var op3 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr)); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(op1, op2, op3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new SimpleTernaryOpTest__MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1(); + + fixed (Vector64* pFld1 = &test._fld1) + fixed (Vector64* pFld2 = &test._fld2) + fixed (Vector64* pFld3 = &test._fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(_fld1, _fld2, _fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed (Vector64* pFld1 = &_fld1) + fixed (Vector64* pFld2 = &_fld2) + fixed (Vector64* pFld3 = &_fld3) + { + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(pFld1)), + AdvSimd.LoadVector64((Int32*)(pFld2)), + AdvSimd.LoadVector64((Int32*)(pFld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh(test._fld1, test._fld2, test._fld3, 1); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + var result = Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh( + AdvSimd.LoadVector64((Int32*)(&test._fld1)), + AdvSimd.LoadVector64((Int32*)(&test._fld2)), + AdvSimd.LoadVector64((Int32*)(&test._fld3)), + 1 + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult(Vector64 op1, Vector64 op2, Vector64 op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + Int32[] inArray1 = new Int32[Op1ElementCount]; + Int32[] inArray2 = new Int32[Op2ElementCount]; + Int32[] inArray3 = new Int32[Op3ElementCount]; + Int32[] outArray = new Int32[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if (Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Rdm)}.{nameof(Rdm.MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh)}(Vector64, Vector64, Vector64): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/Program.Rdm.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/Program.Rdm.cs new file mode 100644 index 000000000000..ae88b4a77be7 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/Program.Rdm.cs @@ -0,0 +1,41 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + static Program() + { + TestList = new Dictionary() { + ["MultiplyRoundedDoublingAndAddSaturateHigh.Vector64.Int16"] = MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int16, + ["MultiplyRoundedDoublingAndAddSaturateHigh.Vector64.Int32"] = MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int32, + ["MultiplyRoundedDoublingAndAddSaturateHigh.Vector128.Int16"] = MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int16, + ["MultiplyRoundedDoublingAndAddSaturateHigh.Vector128.Int32"] = MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int32, + ["MultiplyRoundedDoublingAndSubtractSaturateHigh.Vector64.Int16"] = MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int16, + ["MultiplyRoundedDoublingAndSubtractSaturateHigh.Vector64.Int32"] = MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int32, + ["MultiplyRoundedDoublingAndSubtractSaturateHigh.Vector128.Int16"] = MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int16, + ["MultiplyRoundedDoublingAndSubtractSaturateHigh.Vector128.Int32"] = MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int32, + ["MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector64.Int16.Vector64.Int16.3"] = MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3, + ["MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector64.Int16.Vector128.Int16.7"] = MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7, + ["MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector64.Int32.Vector64.Int32.1"] = MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1, + ["MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector64.Int32.Vector128.Int32.3"] = MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3, + ["MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector128.Int16.Vector64.Int16.3"] = MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector64_Int16_3, + ["MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector128.Int16.Vector128.Int16.7"] = MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector128_Int16_7, + ["MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector128.Int32.Vector64.Int32.1"] = MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector64_Int32_1, + ["MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh.Vector128.Int32.Vector128.Int32.3"] = MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector128_Int32_3, + ["MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector64.Int16.Vector64.Int16.3"] = MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3, + ["MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector64.Int16.Vector128.Int16.7"] = MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7, + ["MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector64.Int32.Vector64.Int32.1"] = MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1, + ["MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector64.Int32.Vector128.Int32.3"] = MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3, + ["MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector128.Int16.Vector64.Int16.3"] = MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector64_Int16_3, + ["MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector128.Int16.Vector128.Int16.7"] = MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector128_Int16_7, + ["MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector128.Int32.Vector64.Int32.1"] = MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector64_Int32_1, + ["MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh.Vector128.Int32.Vector128.Int32.3"] = MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector128_Int32_3, + }; + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/Rdm_r.csproj b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/Rdm_r.csproj new file mode 100644 index 000000000000..e2bc64bbb20a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/Rdm_r.csproj @@ -0,0 +1,39 @@ + + + Exe + true + + + Embedded + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/Rdm_ro.csproj b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/Rdm_ro.csproj new file mode 100644 index 000000000000..b7572f74d619 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Rdm/Rdm_ro.csproj @@ -0,0 +1,39 @@ + + + Exe + true + + + Embedded + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/GenerateTests.csx b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/GenerateTests.csx index 217bed5627c9..21a9c7d8b905 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/GenerateTests.csx +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/GenerateTests.csx @@ -109,2242 +109,2348 @@ private static readonly (string templateFileName, string outputTemplateName, Dic private static readonly (string templateFileName, Dictionary templateData)[] AdvSimdInputs = new [] { - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "(short)-TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Abs(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Abs(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "(sbyte)-TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Abs(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "-TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Abs(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(short)-TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Abs(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Abs(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(sbyte)-TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Abs(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "-TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Abs(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AbsSaturate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int16.MinValue", ["ValidateIterResult"] = "Helpers.AbsSaturate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AbsSaturate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int32.MinValue", ["ValidateIterResult"] = "Helpers.AbsSaturate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AbsSaturate_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "SByte.MinValue", ["ValidateIterResult"] = "Helpers.AbsSaturate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AbsSaturate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "Int16.MinValue", ["ValidateIterResult"] = "Helpers.AbsSaturate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AbsSaturate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "Int32.MinValue", ["ValidateIterResult"] = "Helpers.AbsSaturate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AbsSaturate_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "SByte.MinValue", ["ValidateIterResult"] = "Helpers.AbsSaturate(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AbsScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "-TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Abs(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AbsScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Abs(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThan_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareGreaterThan(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThan_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareGreaterThan(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThanOrEqual_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareGreaterThanOrEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThanOrEqual_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareGreaterThanOrEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThan_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareLessThan(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThan_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareLessThan(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThanOrEqual_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareLessThanOrEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThanOrEqual_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareLessThanOrEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteDifference(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteDifference(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWidening(left[i], right[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLowerAndAdd_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLowerAndAdd_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLowerAndAdd_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLowerAndAdd_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLowerAndAdd_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLowerAndAdd_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpper(left, right, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpperAndAdd_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpperAndAdd_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpperAndAdd_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpperAndAdd_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpperAndAdd_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpperAndAdd_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Add(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Add(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.AddHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.AddHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.AddHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.AddHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AddPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAddScalar_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, 0) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAddScalar_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, 0) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningScalar_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.AddPairwiseWidening(firstOp, 0) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningScalar_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "Helpers.AddPairwiseWidening(firstOp, 0) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_Byte_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_Int16_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_Int32_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_SByte_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_UInt16_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_UInt32_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_Byte_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_Int16_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_Int32_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_Int64_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_SByte_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_UInt16_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_UInt32_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_UInt64_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_Int64_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_UInt64_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Add(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.Add(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Add(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddScalar_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.Add(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_Byte_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_Int16_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_Int16_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_Int32_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_Int32_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_Int64_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_SByte_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_UInt16_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_UInt16_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_UInt32_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_UInt32_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_UInt64_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.And(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.And(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.And(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.And(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.BitwiseClear(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.BitwiseClear(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.BitwiseClear(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.BitwiseClear(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Ceiling_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Ceiling", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Ceiling(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Ceiling_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Ceiling", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Ceiling(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "CeilingScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CeilingScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Ceiling(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "CeilingScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CeilingScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Ceiling(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareGreaterThan(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareGreaterThan(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareGreaterThanOrEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareGreaterThanOrEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareLessThan(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareLessThan(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareLessThanOrEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareLessThanOrEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareTest(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareTest(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundAwayFromZero_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundAwayFromZero", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundAwayFromZero(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundAwayFromZero_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundAwayFromZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundAwayFromZero(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundAwayFromZeroScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundAwayFromZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToInt32RoundAwayFromZero(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToEven_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundToEven(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToEven_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundToEven(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToEvenScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToEvenScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToInt32RoundToEven(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToNegativeInfinity_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToNegativeInfinity", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundToNegativeInfinity(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToNegativeInfinity_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToNegativeInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundToNegativeInfinity(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToNegativeInfinityScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToNegativeInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToInt32RoundToNegativeInfinity(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToPositiveInfinity_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToPositiveInfinity", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundToPositiveInfinity(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToPositiveInfinity_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToPositiveInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundToPositiveInfinity(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToPositiveInfinityScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToPositiveInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToInt32RoundToPositiveInfinity(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToZero_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToZero", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundToZero(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToZero_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundToZero(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToZeroScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToInt32RoundToZero(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingle_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingle", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ConvertToSingle(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingle_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingle", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ConvertToSingle(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingle_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingle", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ConvertToSingle(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingle_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingle", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ConvertToSingle(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingleScalar_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingleScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.ConvertToSingle(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingleScalar_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingleScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.ConvertToSingle(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundAwayFromZero_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundAwayFromZero", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundAwayFromZero(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundAwayFromZero_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundAwayFromZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundAwayFromZero(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundAwayFromZeroScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundAwayFromZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt32RoundAwayFromZero(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToEven_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundToEven(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToEven_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundToEven(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToEvenScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToEvenScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt32RoundToEven(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToNegativeInfinity_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToNegativeInfinity", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundToNegativeInfinity(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToNegativeInfinity_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToNegativeInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundToNegativeInfinity(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToNegativeInfinityScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToNegativeInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt32RoundToNegativeInfinity(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToPositiveInfinity_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToPositiveInfinity", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundToPositiveInfinity(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToPositiveInfinity_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToPositiveInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundToPositiveInfinity(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToPositiveInfinityScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToPositiveInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt32RoundToPositiveInfinity(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToZero_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToZero", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundToZero(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToZero_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundToZero(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToZeroScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt32RoundToZero(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "DivideScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DivideScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Divide(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "DivideScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DivideScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Divide(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector128_Byte_8", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "8", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector128_Int16_4", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "4", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector128_Int32_2", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "2", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector128_SByte_8", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "8", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector128_Single_2", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "2", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector128_UInt16_4", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "4", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector128_UInt32_2", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "2", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector128_Byte_8", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "8", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector128_Int16_4", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "4", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector128_Int32_2", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "2", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector128_SByte_8", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "8", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector128_Single_2", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "2", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector128_UInt16_4", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "4", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector128_UInt32_2", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "2", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), - ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), - ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_Byte_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), - ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), - ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_Int16_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), - ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), - ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_Int32_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), - ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), - ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_SByte_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), - ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), - ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_Single_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), - ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), - ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_UInt16_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), - ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), - ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_UInt32_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), - ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), - ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Byte_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), - ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), - ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Int16_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), - ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), - ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Int32_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), - ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), - ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_SByte_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), - ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), - ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Single_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), - ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), - ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_UInt16_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), - ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), - ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_UInt32_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), - ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[ElementIndex]) != BitConverter.SingleToInt32Bits(result)"}), - ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_Double_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex"] = "1", ["ValidateResult"] = "BitConverter.DoubleToInt64Bits(firstOp[ElementIndex]) != BitConverter.DoubleToInt64Bits(result)"}), - ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[ElementIndex]) != BitConverter.SingleToInt32Bits(result)"}), - ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowing(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowing(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowing(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowing(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowing(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowing(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUnsignedLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUnsignedLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUnsigned(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUnsignedLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUnsignedLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUnsigned(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUnsignedLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUnsignedLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUnsigned(firstOp[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUnsignedUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUnsignedUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUnsignedUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUnsignedUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUnsignedUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUnsignedUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUnsignedUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUnsignedUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUnsignedUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingUpper(left, right, i) != result[i]"}), - ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_Double_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Floor_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Floor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Floor(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Floor_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Floor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Floor(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "FloorScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FloorScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Floor(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "FloorScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FloorScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Floor(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAdd_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAdd_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplyAdd(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddNegatedScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddNegatedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplyAddNegated(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddNegatedScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddNegatedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAddNegated(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtract_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtract_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplySubtract(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractNegatedScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractNegatedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplySubtractNegated(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractNegatedScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractNegatedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtractNegated(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), - ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Insert(firstOp, ElementIndex, thirdOp, i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_Double_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Insert(firstOp, ElementIndex, thirdOp, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Insert(firstOp, ElementIndex, thirdOp, i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("InsertScalarTest.template", new Dictionary { ["TestName"] = "InsertScalar_Vector128_Double_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Insert(firstOp, ElementIndex, thirdOp[0], i)) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("InsertScalarTest.template", new Dictionary { ["TestName"] = "InsertScalar_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp[0], i) != result[i]"}), - ("InsertScalarTest.template", new Dictionary { ["TestName"] = "InsertScalar_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp[0], i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), - ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector64_Byte_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector64_SByte_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Insert(firstOp, ElementIndex, thirdOp, i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_Byte_15", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "15", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_Double_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Insert(firstOp, ElementIndex, thirdOp, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_SByte_15", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "15", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_Single_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Insert(firstOp, ElementIndex, thirdOp, i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector64_Byte", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector64_Int16", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector64_Int32", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector64_SByte", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector64_Single", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result[i])"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector64_UInt16", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector64_UInt32", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_Byte", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_Int16", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_Int32", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_SByte", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_Single", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result[i])"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_UInt16", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_UInt32", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_Byte", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_Double", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(firstOp[i]) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_Int16", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_Int32", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_Int64", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_SByte", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_Single", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(firstOp[i]) != BitConverter.SingleToInt32Bits(result[i])"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_UInt16", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_UInt32", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_UInt64", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_Byte", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_Double", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(firstOp[i]) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_Int16", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_Int32", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_Int64", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_SByte", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_Single", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(firstOp[i]) != BitConverter.SingleToInt32Bits(result[i])"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_UInt16", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_UInt32", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_UInt64", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Max(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Max(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxNumber_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumber", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxNumber(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxNumber_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumber", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxNumber(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MaxNumberScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumberScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MaxNumber(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MaxNumberScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumberScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxNumber(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Min(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Min(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinNumber_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumber", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinNumber(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinNumber_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumber", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinNumber(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MinNumberScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumberScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MinNumber(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MinNumberScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumberScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinNumber(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Multiply(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddByScalar_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddByScalar_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddByScalar_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddByScalar_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddByScalar_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddByScalar_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddByScalar_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddByScalar_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector64_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector64_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector64_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector64_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector128_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector128_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector128_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector128_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[0]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[0]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(left[i], right[0])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[0]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[0]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[0]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[0]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(left[i], right[0])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[0]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[0]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_Int16_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_Single_Vector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(firstOp[i], secondOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_Single_Vector128_Single_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(firstOp[i], secondOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_UInt16_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_Int16_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_Single_Vector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(firstOp[i], secondOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_Single_Vector128_Single_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(firstOp[i], secondOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_UInt16_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLower_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWidening(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLower_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyWidening(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLower_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyWidening(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLower_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWidening(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLower_Vector64_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWidening(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLower_Vector64_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyWidening(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLower_Vector64_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyWidening(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLower_Vector64_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWidening(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndAdd_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndAdd_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndAdd_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndAdd_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndAdd_Vector64_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndAdd_Vector64_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndAdd_Vector64_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndAdd_Vector64_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndSubtract_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndSubtract_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndSubtract_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndSubtract_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndSubtract_Vector64_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndSubtract_Vector64_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndSubtract_Vector64_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndSubtract_Vector64_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpper_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpper(firstOp, secondOp[Imm], i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpper_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpper(firstOp, secondOp[Imm], i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpper_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpper(firstOp, secondOp[Imm], i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpper_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpper(firstOp, secondOp[Imm], i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpper_Vector128_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpper(firstOp, secondOp[Imm], i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpper_Vector128_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpper(firstOp, secondOp[Imm], i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpper_Vector128_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpper(firstOp, secondOp[Imm], i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpper_Vector128_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpper(firstOp, secondOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndAdd(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndAdd(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndAdd(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndAdd(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndAdd(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndAdd(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndAdd(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndAdd(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndSubtract_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndSubtract(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndSubtract_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndSubtract(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndSubtract_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndSubtract(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndSubtract_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndSubtract(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndSubtract_Vector128_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndSubtract(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndSubtract_Vector128_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndSubtract(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndSubtract_Vector128_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndSubtract(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndSubtract_Vector128_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndSubtract(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingByScalarSaturateHigh_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingByScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[i], right[0]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingByScalarSaturateHigh_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingByScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[i], right[0]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingByScalarSaturateHigh_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingByScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[i], right[0]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingByScalarSaturateHigh_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingByScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[i], right[0]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingBySelectedScalarSaturateHigh_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingBySelectedScalarSaturateHigh_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingBySelectedScalarSaturateHigh_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingBySelectedScalarSaturateHigh_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingBySelectedScalarSaturateHigh_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingBySelectedScalarSaturateHigh_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingBySelectedScalarSaturateHigh_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingBySelectedScalarSaturateHigh_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingSaturateHigh_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingSaturateHigh_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingSaturateHigh_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingSaturateHigh_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[i], right[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerAndAddSaturate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerAndAddSaturate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerAndSubtractSaturate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerAndSubtractSaturate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerByScalarAndAddSaturate_Vector64_Int16_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerByScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerByScalarAndAddSaturate_Vector64_Int32_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerByScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerByScalarAndSubtractSaturate_Vector64_Int16_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerByScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerByScalarAndSubtractSaturate_Vector64_Int32_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerByScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerBySelectedScalarAndAddSaturate_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerBySelectedScalarAndAddSaturate_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerBySelectedScalarAndAddSaturate_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerBySelectedScalarAndSubtractSaturate_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerBySelectedScalarAndSubtractSaturate_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerBySelectedScalarAndSubtractSaturate_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerBySelectedScalarAndSubtractSaturate_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateLowerByScalar_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateLowerByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturate(left[i], right[0]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateLowerByScalar_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateLowerByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturate(left[i], right[0]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateLowerBySelectedScalar_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateLowerBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturate(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateLowerBySelectedScalar_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateLowerBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturate(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateLowerBySelectedScalar_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateLowerBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturate(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateLowerBySelectedScalar_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateLowerBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturate(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturateUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturateUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateUpperByScalar_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateUpperByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturateUpperByScalar(left, right[0], i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateUpperByScalar_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateUpperByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturateUpperByScalar(left, right[0], i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateUpperBySelectedScalar_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateUpperBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturateUpperByScalar(firstOp, secondOp[Imm], i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateUpperBySelectedScalar_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateUpperBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturateUpperByScalar(firstOp, secondOp[Imm], i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateUpperBySelectedScalar_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateUpperBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturateUpperByScalar(firstOp, secondOp[Imm], i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateUpperBySelectedScalar_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateUpperBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturateUpperByScalar(firstOp, secondOp[Imm], i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperAndAddSaturate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperAndAddSaturate(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperAndAddSaturate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperAndAddSaturate(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperAndSubtractSaturate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperAndSubtractSaturate(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperAndSubtractSaturate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperAndSubtractSaturate(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperByScalarAndAddSaturate_Vector128_Int16_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperByScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndAddSaturate(firstOp, secondOp, thirdOp[0], i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperByScalarAndAddSaturate_Vector128_Int32_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperByScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndAddSaturate(firstOp, secondOp, thirdOp[0], i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperByScalarAndSubtractSaturate_Vector128_Int16_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperByScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndSubtractSaturate(firstOp, secondOp, thirdOp[0], i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperByScalarAndSubtractSaturate_Vector128_Int32_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperByScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndSubtractSaturate(firstOp, secondOp, thirdOp[0], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperBySelectedScalarAndAddSaturate_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndAddSaturate(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperBySelectedScalarAndAddSaturate_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndAddSaturate(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperBySelectedScalarAndAddSaturate_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndAddSaturate(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperBySelectedScalarAndAddSaturate_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndAddSaturate(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperBySelectedScalarAndSubtractSaturate_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndSubtractSaturate(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperBySelectedScalarAndSubtractSaturate_Vector128_Int16_Vector128_Int16_7",["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndSubtractSaturate(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperBySelectedScalarAndSubtractSaturate_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndSubtractSaturate(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperBySelectedScalarAndSubtractSaturate_Vector128_Int32_Vector128_Int32_3",["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndSubtractSaturate(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingByScalarSaturateHigh_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingByScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[i], right[0]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingByScalarSaturateHigh_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingByScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[i], right[0]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingByScalarSaturateHigh_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingByScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[i], right[0]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingByScalarSaturateHigh_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingByScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[i], right[0]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh_Vector128_Int16_Vector64_Int16_2", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingSaturateHigh_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingSaturateHigh_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingSaturateHigh_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingSaturateHigh_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[i], right[i]) != result[i]"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyScalarBySelectedScalar_Vector64_Single_Vector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(firstOp[0], secondOp[Imm])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyScalarBySelectedScalar_Vector64_Single_Vector128_Single_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(firstOp[0], secondOp[Imm])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector64_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector64_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector64_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector64_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector128_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector128_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector128_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector128_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractByScalar_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractByScalar_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractByScalar_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractByScalar_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractByScalar_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractByScalar_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractByScalar_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractByScalar_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplyWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplyWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWidening(left[i], right[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndAdd_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndAdd_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndAdd_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndAdd_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndAdd_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndAdd_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndSubtract_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndSubtract_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndSubtract_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndSubtract_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndSubtract_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndSubtract_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpper(left, right, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndAdd_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndAdd_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndAdd_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndAdd_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndAdd_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndAdd_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndSubtract_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndSubtract(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndSubtract_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndSubtract(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndSubtract_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndSubtract(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndSubtract_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndSubtract(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndSubtract_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndSubtract(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndSubtract_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndSubtract(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Negate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Negate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Negate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Negate(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Negate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Negate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Negate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Negate(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "NegateSaturate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int16.MinValue", ["ValidateIterResult"] = "Helpers.NegateSaturate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "NegateSaturate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int32.MinValue", ["ValidateIterResult"] = "Helpers.NegateSaturate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "NegateSaturate_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "SByte.MinValue", ["ValidateIterResult"] = "Helpers.NegateSaturate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "NegateSaturate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "Int16.MinValue", ["ValidateIterResult"] = "Helpers.NegateSaturate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "NegateSaturate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "Int32.MinValue", ["ValidateIterResult"] = "Helpers.NegateSaturate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "NegateSaturate_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "SByte.MinValue", ["ValidateIterResult"] = "Helpers.NegateSaturate(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "NegateScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Negate(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "NegateScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Negate(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Not(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Not(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Not(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Not(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Or(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Or(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Or(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Or(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.OrNot(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.OrNot(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.OrNot(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.OrNot(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiply_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiply", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.PolynomialMultiply(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiply_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiply", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.PolynomialMultiply(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiply_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.PolynomialMultiply(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiply_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.PolynomialMultiply(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiplyWideningLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.PolynomialMultiplyWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiplyWideningLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.PolynomialMultiplyWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiplyWideningUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.PolynomialMultiplyWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiplyWideningUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.PolynomialMultiplyWideningUpper(left, right, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "PopCount_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PopCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.BitCount(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "PopCount_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PopCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.BitCount(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "PopCount_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PopCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.BitCount(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "PopCount_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PopCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.BitCount(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalEstimate_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalEstimate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "BitConverter.Int32BitsToSingle(0x3e4ed9ed)", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(result[i]) != 0x409e8000"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalEstimate_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalEstimate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.UnsignedRecipEstimate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalEstimate_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalEstimate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "BitConverter.Int32BitsToSingle(0x3e4ed9ed)", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(result[i]) != 0x409e8000"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalEstimate_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalEstimate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.UnsignedRecipEstimate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootEstimate_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootEstimate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "BitConverter.Int32BitsToSingle(0x3e4ed9ed)", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(result[i]) != 0x400e8000"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootEstimate_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootEstimate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.UnsignedRSqrtEstimate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootEstimate_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootEstimate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "BitConverter.Int32BitsToSingle(0x3e4ed9ed)", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(result[i]) != 0x400e8000"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootEstimate_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootEstimate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.UnsignedRSqrtEstimate(firstOp[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootStep_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootStep", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FPRSqrtStepFused(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootStep_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootStep", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FPRSqrtStepFused(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalStep_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalStep", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FPRecipStepFused(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalStep_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalStep", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FPRecipStepFused(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement16_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement16", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ReverseElement16(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement16_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement16", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement16(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement16_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement16", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ReverseElement16(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement16_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement16", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement16(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement16_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement16", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ReverseElement16(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement16_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement16", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement16(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement16_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement16", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ReverseElement16(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement16_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement16", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement16(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement32_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement32", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement32(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement32_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement32", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement32(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement32_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement32", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement32(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement32_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement32", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement32(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundAwayFromZero_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundAwayFromZero", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundAwayFromZero(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundAwayFromZero_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundAwayFromZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundAwayFromZero(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "RoundAwayFromZeroScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundAwayFromZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundAwayFromZero(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "RoundAwayFromZeroScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundAwayFromZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundAwayFromZero(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToNearest_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNearest", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToNearest(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToNearest_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNearest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToNearest(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "RoundToNearestScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNearestScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundToNearest(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "RoundToNearestScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNearestScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToNearest(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToNegativeInfinity_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNegativeInfinity", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToNegativeInfinity(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToNegativeInfinity_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNegativeInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToNegativeInfinity(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "RoundToNegativeInfinityScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNegativeInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundToNegativeInfinity(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "RoundToNegativeInfinityScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNegativeInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToNegativeInfinity(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToPositiveInfinity_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToPositiveInfinity", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToPositiveInfinity(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToPositiveInfinity_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToPositiveInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToPositiveInfinity(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "RoundToPositiveInfinityScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToPositiveInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundToPositiveInfinity(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "RoundToPositiveInfinityScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToPositiveInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToPositiveInfinity(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToZero_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToZero", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToZero(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToZero_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToZero(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToZeroScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundToZero(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToZeroScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToZero(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmetic_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmetic", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftArithmetic(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmetic_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmetic", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftArithmetic(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmetic_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmetic", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftArithmetic(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmetic_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmetic", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftArithmetic(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmetic_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmetic", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftArithmetic(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmetic_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmetic", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftArithmetic(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmetic_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmetic", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftArithmetic(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRounded_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRounded_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRounded_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRounded_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRounded_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRounded_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRounded_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturate_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturate_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturate_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[i], right[i]) != result[i]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturateScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftArithmeticRounded(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturate_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturate_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturate_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticSaturate(left[i], right[i]) != result[i]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturateScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftArithmeticSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftArithmetic(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "4", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "8", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "16", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "4", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "8", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "16", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "4", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "8", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "16", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "32", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "4", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "8", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "16", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "32", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsertScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "32", ["ValidateFirstResult"] = "Helpers.ShiftLeftAndInsert(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsertScalar_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "32", ["ValidateFirstResult"] = "Helpers.ShiftLeftAndInsert(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateScalar_Vector64_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsigned_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsigned", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsigned_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsigned", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsigned_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsigned", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsigned_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsigned", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsigned_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsigned", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsigned_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsigned", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsigned_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsigned", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[i], Imm) != result[i]"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsignedScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogical(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalScalar_Vector64_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogical(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningLower_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWidening(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningLower_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWidening(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningLower_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWidening(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningLower_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWidening(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningLower_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWidening(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningLower_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWidening(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningUpper_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWideningUpper(firstOp, Imm, i) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningUpper_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWideningUpper(firstOp, Imm, i) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningUpper_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWideningUpper(firstOp, Imm, i) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningUpper_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWideningUpper(firstOp, Imm, i) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningUpper_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWideningUpper(firstOp, Imm, i) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningUpper_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWideningUpper(firstOp, Imm, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturateScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturateScalar_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRounded(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedScalar_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRounded(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturateScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturateScalar_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftLogical(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalScalar_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftLogical(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "4", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "8", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "16", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "4", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "8", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "16", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "4", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "8", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "16", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "32", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "4", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "8", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "16", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "32", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsertScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "32", ["ValidateFirstResult"] = "Helpers.ShiftRightAndInsert(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsertScalar_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "32", ["ValidateFirstResult"] = "Helpers.ShiftRightAndInsert(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmetic_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmetic", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmetic(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmetic_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmetic", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmetic(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmetic_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmetic", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmetic(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmetic_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmetic", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmetic(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmetic_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmetic", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmetic(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmetic_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmetic", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmetic(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmetic_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmetic", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmetic(firstOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticAdd_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticAdd_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticAdd_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticAdd_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticAdd_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticAdd_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticAdd_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticAddScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticAdd(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateLower_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateLower_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateLower_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUnsignedLower_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUnsignedLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUnsigned(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUnsignedLower_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUnsignedLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUnsigned(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUnsignedLower_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUnsignedLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUnsigned(firstOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUnsignedUpper_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUnsignedUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUnsignedUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUnsignedUpper_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUnsignedUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUnsignedUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUnsignedUpper_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUnsignedUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUnsignedUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUpper_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUpper_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUpper_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRounded_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRounded_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRounded_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRounded_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRounded_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRounded_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRounded_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedAdd_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedAdd_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedAdd_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedAdd_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedAdd_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedAdd_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedAdd_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedAddScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticRoundedAdd(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateLower_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateLower_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateLower_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedLower_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUnsigned(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedLower_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUnsigned(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedLower_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUnsigned(firstOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedUpper_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUnsignedUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedUpper_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUnsignedUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedUpper_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUnsignedUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUpper_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUpper_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUpper_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticRounded(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmetic(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAddScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAddScalar_Vector64_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingLower_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowing(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingLower_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowing(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingLower_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowing(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingLower_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowing(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingLower_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowing(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingLower_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowing(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateLower_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateLower_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateLower_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateLower_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateLower_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateLower_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateUpper_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateUpper_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateUpper_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateUpper_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateUpper_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateUpper_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingUpper_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingUpper_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingUpper_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingUpper_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingUpper_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingUpper_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAddScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAddScalar_Vector64_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingLower_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowing(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingLower_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowing(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingLower_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowing(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingLower_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowing(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingLower_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowing(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingLower_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowing(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateLower_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateLower_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateLower_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateLower_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateLower_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateLower_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[i], Imm) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingUpper_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingUpper_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingUpper_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingUpper_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingUpper_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingUpper_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedScalar_Vector64_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightLogical(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalScalar_Vector64_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightLogical(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "SignExtendWideningLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SignExtendWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SignExtendWidening(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "SignExtendWideningLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SignExtendWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SignExtendWidening(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "SignExtendWideningLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SignExtendWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SignExtendWidening(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "SignExtendWideningUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SignExtendWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SignExtendWideningUpper(firstOp, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "SignExtendWideningUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SignExtendWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SignExtendWideningUpper(firstOp, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "SignExtendWideningUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SignExtendWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SignExtendWideningUpper(firstOp, i) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "SqrtScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SqrtScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Sqrt(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "SqrtScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SqrtScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Sqrt(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(firstOp[i]) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(firstOp[i]) != BitConverter.SingleToInt32Bits(result[i])"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(firstOp[i]) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(firstOp[i]) != BitConverter.SingleToInt32Bits(result[i])"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector64_Byte_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "7", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "3", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector64_SByte_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "7", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[ElementIndex]) != BitConverter.SingleToInt32Bits(result)"}), - ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "3", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_Byte_15", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "15", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_Double_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex"] = "1", ["ValidateResult"] = "BitConverter.DoubleToInt64Bits(firstOp[ElementIndex]) != BitConverter.DoubleToInt64Bits(result)"}), - ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "7", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "3", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_SByte_15", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "15", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_Single_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "3", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[ElementIndex]) != BitConverter.SingleToInt32Bits(result)"}), - ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "7", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "3", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Subtract(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Subtract(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowing(left[i], right[i]) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturateScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.SubtractSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturateScalar_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.SubtractSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Subtract(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.Subtract(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Subtract(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractScalar_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.Subtract(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_Byte_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_Int16_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_Int16_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_Int32_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_Int32_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_Int64_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_SByte_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_UInt16_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_UInt16_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_UInt32_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_UInt32_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_UInt64_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "VectorTableLookup_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "VectorTableLookup", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "(Byte)(TestLibrary.Generator.GetByte() % 20)", ["ValidateFirstResult"] = "Helpers.TableVectorLookup(0, right, left) != result[0]", ["ValidateRemainingResults"] = "Helpers.TableVectorLookup(i, right, left) != result[i]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "VectorTableLookup_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "VectorTableLookup", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "(SByte)(TestLibrary.Generator.GetSByte() % 20)", ["ValidateFirstResult"] = "Helpers.TableVectorLookup(0, right, left) != result[0]", ["ValidateRemainingResults"] = "Helpers.TableVectorLookup(i, right, left) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "VectorTableLookupExtension_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "VectorTableLookupExtension", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "(Byte)(TestLibrary.Generator.GetByte() % 20)", ["ValidateIterResult"] = "Helpers.TableVectorExtension(i, firstOp, thirdOp, secondOp) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "VectorTableLookupExtension_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "VectorTableLookupExtension", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "(SByte)(TestLibrary.Generator.GetSByte() % 20)", ["ValidateIterResult"] = "Helpers.TableVectorExtension(i, firstOp, thirdOp, secondOp) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Xor(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Xor(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Xor(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Xor(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.ZeroExtendWidening(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ZeroExtendWidening(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ZeroExtendWidening(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ZeroExtendWidening(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.ZeroExtendWidening(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ZeroExtendWidening(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.ZeroExtendWideningUpper(firstOp, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ZeroExtendWideningUpper(firstOp, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ZeroExtendWideningUpper(firstOp, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ZeroExtendWideningUpper(firstOp, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.ZeroExtendWideningUpper(firstOp, i) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ZeroExtendWideningUpper(firstOp, i) != result[i]"}) + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "(short)-TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Abs(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Abs(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "(sbyte)-TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Abs(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "-TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Abs(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(short)-TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Abs(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Abs(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(sbyte)-TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Abs(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "-TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Abs(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AbsSaturate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int16.MinValue", ["ValidateIterResult"] = "Helpers.AbsSaturate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AbsSaturate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int32.MinValue", ["ValidateIterResult"] = "Helpers.AbsSaturate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AbsSaturate_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "SByte.MinValue", ["ValidateIterResult"] = "Helpers.AbsSaturate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AbsSaturate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "Int16.MinValue", ["ValidateIterResult"] = "Helpers.AbsSaturate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AbsSaturate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "Int32.MinValue", ["ValidateIterResult"] = "Helpers.AbsSaturate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AbsSaturate_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "SByte.MinValue", ["ValidateIterResult"] = "Helpers.AbsSaturate(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AbsScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "-TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Abs(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AbsScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Abs(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThan_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareGreaterThan(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThan_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareGreaterThan(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThanOrEqual_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareGreaterThanOrEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThanOrEqual_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareGreaterThanOrEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThan_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareLessThan(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThan_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareLessThan(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThanOrEqual_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareLessThanOrEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThanOrEqual_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareLessThanOrEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteDifference(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteDifference(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceAdd_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWidening(left[i], right[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLowerAndAdd_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLowerAndAdd_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLowerAndAdd_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLowerAndAdd_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLowerAndAdd_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningLowerAndAdd_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpper(left, right, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpperAndAdd_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpperAndAdd_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpperAndAdd_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpperAndAdd_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpperAndAdd_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceWideningUpperAndAdd_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AbsoluteDifferenceWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Add(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Add(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Add(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.AddHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.AddHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.AddHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddHighNarrowingUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.AddHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AddPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWidening_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWidening", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddPairwiseWidening(firstOp, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAdd_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, i) != result[i]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAddScalar_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, 0) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningAndAddScalar_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningAndAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "Helpers.AddPairwiseWideningAndAdd(left, right, 0) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningScalar_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.AddPairwiseWidening(firstOp, 0) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseWideningScalar_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseWideningScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "Helpers.AddPairwiseWidening(firstOp, 0) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "AddRoundedHighNarrowingUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.AddRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_Byte_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_Int16_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_Int32_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_SByte_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_UInt16_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_UInt32_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_Byte_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_Int16_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_Int32_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_Int64_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_SByte_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_UInt16_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_UInt32_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_UInt64_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_Int64_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_UInt64_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Add(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.Add(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Add(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddScalar_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.Add(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningLower_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_Byte_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_Int16_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_Int16_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_Int32_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_Int32_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_Int64_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_SByte_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_UInt16_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_UInt16_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_UInt32_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_UInt32_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddWideningUpper_Vector128_UInt64_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.And(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.And(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.And(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.And(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "And_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "And", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.And(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.BitwiseClear(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.BitwiseClear(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.BitwiseClear(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.BitwiseClear(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "BitwiseClear_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "BitwiseSelect_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Ceiling_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Ceiling", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Ceiling(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Ceiling_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Ceiling", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Ceiling(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "CeilingScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CeilingScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Ceiling(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "CeilingScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CeilingScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Ceiling(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareGreaterThan(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareGreaterThan(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareGreaterThanOrEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareGreaterThanOrEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareLessThan(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareLessThan(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareLessThanOrEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareLessThanOrEqual(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareTest(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareTest(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundAwayFromZero_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundAwayFromZero", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundAwayFromZero(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundAwayFromZero_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundAwayFromZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundAwayFromZero(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundAwayFromZeroScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundAwayFromZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToInt32RoundAwayFromZero(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToEven_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundToEven(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToEven_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundToEven(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToEvenScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToEvenScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToInt32RoundToEven(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToNegativeInfinity_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToNegativeInfinity", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundToNegativeInfinity(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToNegativeInfinity_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToNegativeInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundToNegativeInfinity(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToNegativeInfinityScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToNegativeInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToInt32RoundToNegativeInfinity(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToPositiveInfinity_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToPositiveInfinity", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundToPositiveInfinity(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToPositiveInfinity_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToPositiveInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundToPositiveInfinity(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToPositiveInfinityScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToPositiveInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToInt32RoundToPositiveInfinity(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToZero_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToZero", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundToZero(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToZero_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToInt32RoundToZero(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt32RoundToZeroScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt32RoundToZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToInt32RoundToZero(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingle_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingle", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ConvertToSingle(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingle_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingle", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ConvertToSingle(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingle_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingle", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ConvertToSingle(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingle_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingle", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ConvertToSingle(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingleScalar_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingleScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.ConvertToSingle(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingleScalar_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingleScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.ConvertToSingle(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundAwayFromZero_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundAwayFromZero", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundAwayFromZero(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundAwayFromZero_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundAwayFromZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundAwayFromZero(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundAwayFromZeroScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundAwayFromZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt32RoundAwayFromZero(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToEven_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundToEven(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToEven_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundToEven(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToEvenScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToEvenScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt32RoundToEven(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToNegativeInfinity_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToNegativeInfinity", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundToNegativeInfinity(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToNegativeInfinity_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToNegativeInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundToNegativeInfinity(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToNegativeInfinityScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToNegativeInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt32RoundToNegativeInfinity(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToPositiveInfinity_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToPositiveInfinity", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundToPositiveInfinity(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToPositiveInfinity_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToPositiveInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundToPositiveInfinity(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToPositiveInfinityScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToPositiveInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt32RoundToPositiveInfinity(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToZero_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToZero", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundToZero(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToZero_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.ConvertToUInt32RoundToZero(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt32RoundToZeroScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt32RoundToZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt32RoundToZero(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "DivideScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DivideScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Divide(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "DivideScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DivideScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Divide(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector128_Byte_8", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "8", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector128_Int16_4", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "4", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector128_Int32_2", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "2", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector128_SByte_8", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "8", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector128_Single_2", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "2", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector128_UInt16_4", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "4", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector64_Vector128_UInt32_2", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "2", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector128_Byte_8", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "8", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector128_Int16_4", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "4", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector128_Int32_2", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "2", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector128_SByte_8", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "8", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector128_Single_2", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "2", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector128_UInt16_4", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "4", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_Vector128_UInt32_2", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "2", ["ValidateIterResult"] = "firstOp[Imm] != result[i]"}), + ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), + ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_Byte_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), + ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), + ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_Int16_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), + ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), + ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_Int32_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), + ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), + ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_SByte_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), + ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), + ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_Single_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), + ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), + ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_UInt16_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), + ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), + ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector64_UInt32_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), + ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), + ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Byte_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), + ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), + ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Int16_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), + ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), + ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Int32_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), + ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), + ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_SByte_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), + ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), + ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Single_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), + ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), + ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_UInt16_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), + ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), + ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_UInt32_31", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), + ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[ElementIndex]) != BitConverter.SingleToInt32Bits(result)"}), + ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_Double_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex"] = "1", ["ValidateResult"] = "BitConverter.DoubleToInt64Bits(firstOp[ElementIndex]) != BitConverter.DoubleToInt64Bits(result)"}), + ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[ElementIndex]) != BitConverter.SingleToInt32Bits(result)"}), + ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("ExtractTest.template", new Dictionary { ["TestName"] = "Extract_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Extract", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowing(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowing(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowing(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowing(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowing(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowing(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUnsignedLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUnsignedLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUnsigned(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUnsignedLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUnsignedLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUnsigned(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUnsignedLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUnsignedLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUnsigned(firstOp[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUnsignedUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUnsignedUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUnsignedUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUnsignedUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUnsignedUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUnsignedUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUnsignedUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUnsignedUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUnsignedUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingSaturateUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ExtractNarrowingUpper(left, right, i) != result[i]"}), + ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_Double_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("ExtractVectorTest.template", new Dictionary { ["TestName"] = "ExtractVector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Floor_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Floor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Floor(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Floor_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Floor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Floor(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "FloorScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FloorScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Floor(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "FloorScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FloorScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Floor(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddHalving_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.FusedAddHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedAddRoundedHalving_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedAddRoundedHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.FusedAddRoundedHalving(left[i], right[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAdd_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAdd_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplyAdd(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddNegatedScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddNegatedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplyAddNegated(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddNegatedScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddNegatedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAddNegated(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtract_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtract_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplySubtract(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractNegatedScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractNegatedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplySubtractNegated(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractNegatedScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractNegatedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtractNegated(firstOp[0], secondOp[0], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "FusedSubtractHalving_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedSubtractHalving", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.FusedSubtractHalving(left[i], right[i]) != result[i]"}), + ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Insert(firstOp, ElementIndex, thirdOp, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_Double_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Insert(firstOp, ElementIndex, thirdOp, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Insert(firstOp, ElementIndex, thirdOp, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("InsertTest.template", new Dictionary { ["TestName"] = "Insert_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("InsertScalarTest.template", new Dictionary { ["TestName"] = "InsertScalar_Vector128_Double_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Insert(firstOp, ElementIndex, thirdOp[0], i)) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("InsertScalarTest.template", new Dictionary { ["TestName"] = "InsertScalar_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp[0], i) != result[i]"}), + ("InsertScalarTest.template", new Dictionary { ["TestName"] = "InsertScalar_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp[0], i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}), + ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector64_Byte_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector64_SByte_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Insert(firstOp, ElementIndex, thirdOp, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_Byte_15", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "15", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_Double_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Insert(firstOp, ElementIndex, thirdOp, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_SByte_15", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "15", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_Single_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Insert(firstOp, ElementIndex, thirdOp, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("LoadAndInsertScalarTest.template", new Dictionary { ["TestName"] = "LoadAndInsertScalar_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadAndInsertScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex, thirdOp, i) != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector64_Byte", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector64_Int16", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector64_Int32", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector64_SByte", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector64_Single", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result[i])"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector64_UInt16", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector64_UInt32", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_Byte", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_Int16", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_Int32", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_SByte", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_Single", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result[i])"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_UInt16", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_UInt32", ["Isa"] = "AdvSimd", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_Byte", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_Double", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(firstOp[i]) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_Int16", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_Int32", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_Int64", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_SByte", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_Single", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(firstOp[i]) != BitConverter.SingleToInt32Bits(result[i])"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_UInt16", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_UInt32", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector64_UInt64", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector64", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_Byte", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_Double", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(firstOp[i]) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_Int16", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_Int32", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_Int64", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_SByte", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_Single", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(firstOp[i]) != BitConverter.SingleToInt32Bits(result[i])"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_UInt16", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_UInt32", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_UInt64", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Max(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Max(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Max(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxNumber_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumber", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxNumber(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxNumber_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumber", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxNumber(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MaxNumberScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumberScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MaxNumber(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MaxNumberScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumberScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxNumber(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Min(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Min(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Min(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinNumber_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumber", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinNumber(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinNumber_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumber", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinNumber(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MinNumberScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumberScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MinNumber(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MinNumberScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumberScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinNumber(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[i]) != result[i]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Multiply(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAdd_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddByScalar_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddByScalar_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddByScalar_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddByScalar_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddByScalar_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddByScalar_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddByScalar_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddByScalar_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector64_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector64_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector64_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector64_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector128_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector128_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector128_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyAddBySelectedScalar_Vector128_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[0]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[0]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(left[i], right[0])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[0]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[0]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[0]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[0]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(left[i], right[0])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[0]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Multiply(left[i], right[0]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_Int16_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_Single_Vector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(firstOp[i], secondOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_Single_Vector128_Single_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(firstOp[i], secondOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_UInt16_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector64_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_Int16_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_Single_Vector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(firstOp[i], secondOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_Single_Vector128_Single_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(firstOp[i], secondOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_UInt16_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.Multiply(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLower_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWidening(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLower_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyWidening(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLower_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyWidening(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLower_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWidening(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLower_Vector64_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWidening(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLower_Vector64_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyWidening(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLower_Vector64_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyWidening(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLower_Vector64_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWidening(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndAdd_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndAdd_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndAdd_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndAdd_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndAdd_Vector64_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndAdd_Vector64_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndAdd_Vector64_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndAdd_Vector64_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndSubtract_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndSubtract_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndSubtract_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndSubtract_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndSubtract_Vector64_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndSubtract_Vector64_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndSubtract_Vector64_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningLowerAndSubtract_Vector64_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpper_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpper(firstOp, secondOp[Imm], i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpper_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpper(firstOp, secondOp[Imm], i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpper_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpper(firstOp, secondOp[Imm], i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpper_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpper(firstOp, secondOp[Imm], i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpper_Vector128_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpper(firstOp, secondOp[Imm], i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpper_Vector128_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpper(firstOp, secondOp[Imm], i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpper_Vector128_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpper(firstOp, secondOp[Imm], i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpper_Vector128_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpper(firstOp, secondOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndAdd(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndAdd(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndAdd(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndAdd(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndAdd(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndAdd(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndAdd(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndAdd_Vector128_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndAdd(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndSubtract_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndSubtract(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndSubtract_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndSubtract(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndSubtract_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndSubtract(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndSubtract_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndSubtract(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndSubtract_Vector128_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndSubtract(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndSubtract_Vector128_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndSubtract(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndSubtract_Vector128_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndSubtract(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalarWideningUpperAndSubtract_Vector128_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalarWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyByScalarWideningUpperAndSubtract(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingByScalarSaturateHigh_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingByScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[i], right[0]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingByScalarSaturateHigh_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingByScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[i], right[0]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingByScalarSaturateHigh_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingByScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[i], right[0]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingByScalarSaturateHigh_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingByScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[i], right[0]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingBySelectedScalarSaturateHigh_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingBySelectedScalarSaturateHigh_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingBySelectedScalarSaturateHigh_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingBySelectedScalarSaturateHigh_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingBySelectedScalarSaturateHigh_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingBySelectedScalarSaturateHigh_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingBySelectedScalarSaturateHigh_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingBySelectedScalarSaturateHigh_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingSaturateHigh_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingSaturateHigh_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingSaturateHigh_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingSaturateHigh_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[i], right[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerAndAddSaturate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerAndAddSaturate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerAndSubtractSaturate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerAndSubtractSaturate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerByScalarAndAddSaturate_Vector64_Int16_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerByScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerByScalarAndAddSaturate_Vector64_Int32_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerByScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerByScalarAndSubtractSaturate_Vector64_Int16_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerByScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerByScalarAndSubtractSaturate_Vector64_Int32_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerByScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerBySelectedScalarAndAddSaturate_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerBySelectedScalarAndAddSaturate_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerBySelectedScalarAndAddSaturate_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerBySelectedScalarAndSubtractSaturate_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerBySelectedScalarAndSubtractSaturate_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerBySelectedScalarAndSubtractSaturate_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningLowerBySelectedScalarAndSubtractSaturate_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningLowerBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateLowerByScalar_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateLowerByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturate(left[i], right[0]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateLowerByScalar_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateLowerByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturate(left[i], right[0]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateLowerBySelectedScalar_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateLowerBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturate(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateLowerBySelectedScalar_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateLowerBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturate(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateLowerBySelectedScalar_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateLowerBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturate(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateLowerBySelectedScalar_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateLowerBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturate(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturateUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturateUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateUpperByScalar_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateUpperByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturateUpperByScalar(left, right[0], i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateUpperByScalar_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateUpperByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturateUpperByScalar(left, right[0], i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateUpperBySelectedScalar_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateUpperBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturateUpperByScalar(firstOp, secondOp[Imm], i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateUpperBySelectedScalar_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateUpperBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturateUpperByScalar(firstOp, secondOp[Imm], i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateUpperBySelectedScalar_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateUpperBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturateUpperByScalar(firstOp, secondOp[Imm], i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateUpperBySelectedScalar_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateUpperBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningSaturateUpperByScalar(firstOp, secondOp[Imm], i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperAndAddSaturate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperAndAddSaturate(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperAndAddSaturate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperAndAddSaturate(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperAndSubtractSaturate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperAndSubtractSaturate(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperAndSubtractSaturate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperAndSubtractSaturate(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperByScalarAndAddSaturate_Vector128_Int16_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperByScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndAddSaturate(firstOp, secondOp, thirdOp[0], i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperByScalarAndAddSaturate_Vector128_Int32_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperByScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndAddSaturate(firstOp, secondOp, thirdOp[0], i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperByScalarAndSubtractSaturate_Vector128_Int16_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperByScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndSubtractSaturate(firstOp, secondOp, thirdOp[0], i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperByScalarAndSubtractSaturate_Vector128_Int32_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperByScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndSubtractSaturate(firstOp, secondOp, thirdOp[0], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperBySelectedScalarAndAddSaturate_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndAddSaturate(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperBySelectedScalarAndAddSaturate_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndAddSaturate(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperBySelectedScalarAndAddSaturate_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndAddSaturate(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperBySelectedScalarAndAddSaturate_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndAddSaturate(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperBySelectedScalarAndSubtractSaturate_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndSubtractSaturate(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperBySelectedScalarAndSubtractSaturate_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndSubtractSaturate(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperBySelectedScalarAndSubtractSaturate_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndSubtractSaturate(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningUpperBySelectedScalarAndSubtractSaturate_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningUpperBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyDoublingWideningUpperByScalarAndSubtractSaturate(firstOp, secondOp, thirdOp[Imm], i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingByScalarSaturateHigh_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingByScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[i], right[0]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingByScalarSaturateHigh_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingByScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[i], right[0]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingByScalarSaturateHigh_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingByScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[i], right[0]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingByScalarSaturateHigh_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingByScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[i], right[0]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh_Vector128_Int16_Vector64_Int16_2", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[i], secondOp[Imm]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingSaturateHigh_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingSaturateHigh_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingSaturateHigh_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingSaturateHigh_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[i], right[i]) != result[i]"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyScalarBySelectedScalar_Vector64_Single_Vector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(firstOp[0], secondOp[Imm])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyScalarBySelectedScalar_Vector64_Single_Vector128_Single_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Multiply(firstOp[0], secondOp[Imm])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtract_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector64_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector64_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector64_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector64_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector128_UInt16_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector128_UInt16_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector128_UInt32_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractBySelectedScalar_Vector128_UInt32_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractByScalar_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractByScalar_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractByScalar_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractByScalar_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractByScalar_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractByScalar_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractByScalar_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplySubtractByScalar_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplySubtractByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplySubtract(firstOp[i], secondOp[i], thirdOp[0]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplyWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplyWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWidening(left[i], right[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndAdd_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndAdd_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndAdd_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndAdd_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndAdd_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndAdd_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndSubtract_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndSubtract_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndSubtract_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndSubtract_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndSubtract_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningLowerAndSubtract_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningLowerAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningAndSubtract(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpper(left, right, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndAdd_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndAdd_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndAdd_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndAdd_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndAdd_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndAdd_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndAdd(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndSubtract_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndSubtract(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndSubtract_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndSubtract(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndSubtract_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndSubtract(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndSubtract_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndSubtract(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndSubtract_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndSubtract(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyWideningUpperAndSubtract_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyWideningUpperAndSubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MultiplyWideningUpperAndSubtract(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Negate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Negate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Negate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Negate(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Negate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Negate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Negate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Negate(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "NegateSaturate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int16.MinValue", ["ValidateIterResult"] = "Helpers.NegateSaturate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "NegateSaturate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int32.MinValue", ["ValidateIterResult"] = "Helpers.NegateSaturate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "NegateSaturate_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "SByte.MinValue", ["ValidateIterResult"] = "Helpers.NegateSaturate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "NegateSaturate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "Int16.MinValue", ["ValidateIterResult"] = "Helpers.NegateSaturate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "NegateSaturate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "Int32.MinValue", ["ValidateIterResult"] = "Helpers.NegateSaturate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "NegateSaturate_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "SByte.MinValue", ["ValidateIterResult"] = "Helpers.NegateSaturate(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "NegateScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Negate(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "NegateScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Negate(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Not(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Not(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Not(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Not(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Not_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Not", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Not(firstOp[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Or(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Or(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Or(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Or(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Or_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Or", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Or(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.OrNot(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.OrNot(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.OrNot(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.OrNot(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "OrNot_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "OrNot", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.OrNot(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiply_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiply", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.PolynomialMultiply(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiply_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiply", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.PolynomialMultiply(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiply_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.PolynomialMultiply(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiply_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.PolynomialMultiply(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiplyWideningLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.PolynomialMultiplyWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiplyWideningLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.PolynomialMultiplyWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiplyWideningUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.PolynomialMultiplyWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiplyWideningUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.PolynomialMultiplyWideningUpper(left, right, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "PopCount_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PopCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.BitCount(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "PopCount_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PopCount", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.BitCount(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "PopCount_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PopCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.BitCount(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "PopCount_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PopCount", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.BitCount(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalEstimate_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalEstimate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "BitConverter.Int32BitsToSingle(0x3e4ed9ed)", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(result[i]) != 0x409e8000"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalEstimate_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalEstimate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.UnsignedRecipEstimate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalEstimate_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalEstimate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "BitConverter.Int32BitsToSingle(0x3e4ed9ed)", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(result[i]) != 0x409e8000"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalEstimate_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalEstimate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.UnsignedRecipEstimate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootEstimate_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootEstimate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "BitConverter.Int32BitsToSingle(0x3e4ed9ed)", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(result[i]) != 0x400e8000"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootEstimate_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootEstimate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.UnsignedRSqrtEstimate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootEstimate_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootEstimate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "BitConverter.Int32BitsToSingle(0x3e4ed9ed)", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(result[i]) != 0x400e8000"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootEstimate_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootEstimate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.UnsignedRSqrtEstimate(firstOp[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootStep_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootStep", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FPRSqrtStepFused(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootStep_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootStep", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FPRSqrtStepFused(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalStep_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalStep", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FPRecipStepFused(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalStep_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalStep", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FPRecipStepFused(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement16_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement16", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ReverseElement16(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement16_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement16", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement16(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement16_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement16", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ReverseElement16(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement16_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement16", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement16(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement16_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement16", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ReverseElement16(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement16_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement16", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement16(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement16_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement16", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ReverseElement16(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement16_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement16", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement16(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement32_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement32", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement32(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement32_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement32", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement32(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement32_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement32", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement32(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement32_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement32", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement32(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElement8_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElement8", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ReverseElement8(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundAwayFromZero_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundAwayFromZero", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundAwayFromZero(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundAwayFromZero_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundAwayFromZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundAwayFromZero(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "RoundAwayFromZeroScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundAwayFromZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundAwayFromZero(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "RoundAwayFromZeroScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundAwayFromZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundAwayFromZero(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToNearest_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNearest", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToNearest(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToNearest_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNearest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToNearest(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "RoundToNearestScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNearestScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundToNearest(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "RoundToNearestScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNearestScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToNearest(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToNegativeInfinity_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNegativeInfinity", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToNegativeInfinity(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToNegativeInfinity_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNegativeInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToNegativeInfinity(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "RoundToNegativeInfinityScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNegativeInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundToNegativeInfinity(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "RoundToNegativeInfinityScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNegativeInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToNegativeInfinity(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToPositiveInfinity_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToPositiveInfinity", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToPositiveInfinity(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToPositiveInfinity_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToPositiveInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToPositiveInfinity(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "RoundToPositiveInfinityScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToPositiveInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundToPositiveInfinity(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "RoundToPositiveInfinityScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToPositiveInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToPositiveInfinity(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToZero_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToZero", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToZero(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToZero_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToZero(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToZeroScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundToZero(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToZeroScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.RoundToZero(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmetic_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmetic", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftArithmetic(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmetic_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmetic", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftArithmetic(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmetic_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmetic", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftArithmetic(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmetic_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmetic", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftArithmetic(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmetic_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmetic", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftArithmetic(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmetic_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmetic", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftArithmetic(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmetic_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmetic", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftArithmetic(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRounded_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRounded_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRounded_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRounded_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRounded_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRounded_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRounded_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturate_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturate_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturate_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[i], right[i]) != result[i]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturateScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftArithmeticRounded(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturate_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturate_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturate_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftArithmeticSaturate(left[i], right[i]) != result[i]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturateScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftArithmeticSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftArithmetic(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "4", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "8", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "16", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "4", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "8", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "16", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "4", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "8", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "16", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "32", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "4", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "8", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "16", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsert_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "32", ["ValidateIterResult"] = "Helpers.ShiftLeftAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsertScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "32", ["ValidateFirstResult"] = "Helpers.ShiftLeftAndInsert(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftAndInsertScalar_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "32", ["ValidateFirstResult"] = "Helpers.ShiftLeftAndInsert(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogical_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturate_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[i], Imm) != result[i]"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateScalar_Vector64_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsigned_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsigned", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsigned_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsigned", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsigned_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsigned", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsigned_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsigned", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsigned_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsigned", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsigned_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsigned", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsigned_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsigned", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[i], Imm) != result[i]"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsignedScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogical(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalScalar_Vector64_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogical(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningLower_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWidening(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningLower_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWidening(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningLower_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWidening(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningLower_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWidening(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningLower_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWidening(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningLower_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWidening(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningUpper_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWideningUpper(firstOp, Imm, i) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningUpper_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWideningUpper(firstOp, Imm, i) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningUpper_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWideningUpper(firstOp, Imm, i) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningUpper_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWideningUpper(firstOp, Imm, i) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningUpper_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWideningUpper(firstOp, Imm, i) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalWideningUpper_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftLeftLogicalWideningUpper(firstOp, Imm, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogical_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftLogical(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRounded_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRounded(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturate_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[i], right[i]) != result[i]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturateScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturateScalar_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRounded(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedScalar_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRounded(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturate_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.ShiftLogicalSaturate(left[i], right[i]) != result[i]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturateScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturateScalar_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftLogical(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalScalar_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ShiftLogical(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "4", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "8", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "16", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "4", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "8", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "16", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "4", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "8", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "16", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "32", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "4", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "8", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "16", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsert_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "32", ["ValidateIterResult"] = "Helpers.ShiftRightAndInsert(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsertScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "32", ["ValidateFirstResult"] = "Helpers.ShiftRightAndInsert(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightAndInsertScalar_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightAndInsertScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "32", ["ValidateFirstResult"] = "Helpers.ShiftRightAndInsert(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmetic_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmetic", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmetic(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmetic_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmetic", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmetic(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmetic_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmetic", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmetic(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmetic_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmetic", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmetic(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmetic_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmetic", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmetic(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmetic_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmetic", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmetic(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmetic_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmetic", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmetic(firstOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticAdd_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticAdd_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticAdd_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticAdd_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticAdd_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticAdd_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticAdd_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticAddScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticAdd(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateLower_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateLower_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateLower_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUnsignedLower_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUnsignedLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUnsigned(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUnsignedLower_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUnsignedLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUnsigned(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUnsignedLower_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUnsignedLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUnsigned(firstOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUnsignedUpper_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUnsignedUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUnsignedUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUnsignedUpper_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUnsignedUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUnsignedUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUnsignedUpper_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUnsignedUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUnsignedUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUpper_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUpper_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUpper_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRounded_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRounded_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRounded_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRounded_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRounded_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRounded_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRounded_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedAdd_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedAdd_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedAdd_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedAdd_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedAdd_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedAdd_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedAdd_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedAddScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticRoundedAdd(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateLower_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateLower_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateLower_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedLower_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUnsigned(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedLower_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUnsigned(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedLower_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUnsigned(firstOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedUpper_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUnsignedUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedUpper_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUnsignedUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedUpper_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUnsignedUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUpper_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUpper_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUpper_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticRounded(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmetic(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogical_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogical(firstOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAdd_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAddScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalAddScalar_Vector64_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalAdd(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingLower_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowing(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingLower_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowing(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingLower_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowing(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingLower_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowing(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingLower_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowing(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingLower_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowing(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateLower_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateLower_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateLower_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateLower_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateLower_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateLower_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateUpper_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateUpper_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateUpper_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateUpper_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateUpper_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateUpper_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingUpper_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingUpper_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingUpper_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingUpper_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingUpper_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingUpper_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRounded_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRounded", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAdd_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[i], secondOp[i], Imm) != result[i]"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAddScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedAddScalar_Vector64_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedAddScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRoundedAdd(firstOp[0], secondOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingLower_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowing(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingLower_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowing(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingLower_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowing(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingLower_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowing(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingLower_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowing(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingLower_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowing(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateLower_Vector64_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateLower_Vector64_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateLower_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateLower_Vector64_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateLower_Vector64_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateLower_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[i], Imm) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturateUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingUpper_Vector128_Byte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingUpper_Vector128_Int16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingUpper_Vector128_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingUpper_Vector128_SByte_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingUpper_Vector128_UInt16_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingUpper_Vector128_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingUpper(firstOp, secondOp, Imm, i) != result[i]"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedScalar_Vector64_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRounded(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalScalar_Vector64_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightLogical(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalScalar_Vector64_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftRightLogical(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "SignExtendWideningLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SignExtendWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SignExtendWidening(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "SignExtendWideningLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SignExtendWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SignExtendWidening(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "SignExtendWideningLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SignExtendWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SignExtendWidening(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "SignExtendWideningUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SignExtendWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SignExtendWideningUpper(firstOp, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "SignExtendWideningUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SignExtendWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SignExtendWideningUpper(firstOp, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "SignExtendWideningUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SignExtendWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SignExtendWideningUpper(firstOp, i) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "SqrtScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SqrtScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Sqrt(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "SqrtScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SqrtScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Sqrt(firstOp[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(firstOp[i]) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(firstOp[i]) != BitConverter.SingleToInt32Bits(result[i])"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(firstOp[i]) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(firstOp[i]) != BitConverter.SingleToInt32Bits(result[i])"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("StoreUnOpTest.template", new Dictionary { ["TestName"] = "Store_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Store", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector64_Byte_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "7", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector64_Int16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "3", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector64_Int32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector64_SByte_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "7", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector64_Single_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[ElementIndex]) != BitConverter.SingleToInt32Bits(result)"}), + ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector64_UInt16_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "3", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector64_UInt32_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_Byte_15", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "15", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_Double_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex"] = "1", ["ValidateResult"] = "BitConverter.DoubleToInt64Bits(firstOp[ElementIndex]) != BitConverter.DoubleToInt64Bits(result)"}), + ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_Int16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "7", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_Int32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "3", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_Int64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_SByte_15", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "15", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_Single_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "3", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[ElementIndex]) != BitConverter.SingleToInt32Bits(result)"}), + ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_UInt16_7", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "7", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_UInt32_3", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "3", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("StoreSelectedScalarTest.template", new Dictionary { ["TestName"] = "StoreSelectedScalar_Vector128_UInt64_1", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "StoreSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex"] = "1", ["ValidateResult"] = "firstOp[ElementIndex] != result"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Subtract(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Subtract(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Subtract(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractHighNarrowingUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.SubtractHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowing(left[i], right[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "SubtractRoundedHighNarrowingUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractRoundedHighNarrowingUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.SubtractRoundedHighNarrowingUpper(firstOp, secondOp, thirdOp, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturate_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.SubtractSaturate(left[i], right[i]) != result[i]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturateScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.SubtractSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturateScalar_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.SubtractSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractScalar_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Subtract(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractScalar_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.Subtract(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractScalar_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Subtract(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractScalar_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.Subtract(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningLower_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractWidening(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_Byte_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_Int16_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_Int16_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_Int32_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_Int32_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_Int64_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_SByte_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_UInt16_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_UInt16_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_UInt32_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_UInt32_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "SubtractWideningUpper_Vector128_UInt64_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SubtractWideningUpper(left, right, i) != result[i]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "VectorTableLookup_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "VectorTableLookup", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "(Byte)(TestLibrary.Generator.GetByte() % 20)", ["ValidateFirstResult"] = "Helpers.TableVectorLookup(0, right, left) != result[0]", ["ValidateRemainingResults"] = "Helpers.TableVectorLookup(i, right, left) != result[i]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "VectorTableLookup_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "VectorTableLookup", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "(SByte)(TestLibrary.Generator.GetSByte() % 20)", ["ValidateFirstResult"] = "Helpers.TableVectorLookup(0, right, left) != result[0]", ["ValidateRemainingResults"] = "Helpers.TableVectorLookup(i, right, left) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "VectorTableLookupExtension_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "VectorTableLookupExtension", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "(Byte)(TestLibrary.Generator.GetByte() % 20)", ["ValidateIterResult"] = "Helpers.TableVectorExtension(i, firstOp, thirdOp, secondOp) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "VectorTableLookupExtension_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "VectorTableLookupExtension", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "(SByte)(TestLibrary.Generator.GetSByte() % 20)", ["ValidateIterResult"] = "Helpers.TableVectorExtension(i, firstOp, thirdOp, secondOp) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Xor(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Xor(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector64_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_Double", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Xor(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_Int64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_Single", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Xor(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Xor_Vector128_UInt64", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Xor(left[i], right[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningLower_Vector64_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.ZeroExtendWidening(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningLower_Vector64_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ZeroExtendWidening(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningLower_Vector64_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ZeroExtendWidening(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningLower_Vector64_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ZeroExtendWidening(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningLower_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.ZeroExtendWidening(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningLower_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ZeroExtendWidening(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningUpper_Vector128_Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.ZeroExtendWideningUpper(firstOp, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningUpper_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.ZeroExtendWideningUpper(firstOp, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningUpper_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ZeroExtendWideningUpper(firstOp, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningUpper_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ZeroExtendWideningUpper(firstOp, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningUpper_Vector128_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.ZeroExtendWideningUpper(firstOp, i) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ZeroExtendWideningUpper_Vector128_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZeroExtendWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ZeroExtendWideningUpper(firstOp, i) != result[i]"}) }; private static readonly (string templateFileName, Dictionary templateData)[] AdvSimd_Arm64Inputs = new [] { - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "-TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Abs(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "-TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Abs(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AbsSaturate_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "Int64.MinValue", ["ValidateIterResult"] = "Helpers.AbsSaturate(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AbsSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int16.MinValue", ["ValidateFirstResult"] = "Helpers.AbsSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AbsSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int32.MinValue", ["ValidateFirstResult"] = "Helpers.AbsSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AbsSaturateScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int64.MinValue", ["ValidateFirstResult"] = "Helpers.AbsSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AbsSaturateScalar_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "SByte.MinValue", ["ValidateFirstResult"] = "Helpers.AbsSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AbsScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "-TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.Abs(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThan_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteCompareGreaterThan(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThanScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteCompareGreaterThan(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThanScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareGreaterThan(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThanOrEqual_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteCompareGreaterThanOrEqual(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThanOrEqualScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteCompareGreaterThanOrEqual(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThanOrEqualScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareGreaterThanOrEqual(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThan_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteCompareLessThan(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThanScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteCompareLessThan(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThanScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareLessThan(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThanOrEqual_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteCompareLessThanOrEqual(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThanOrEqualScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteCompareLessThanOrEqual(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThanOrEqualScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareLessThanOrEqual(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteDifference(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteDifference(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteDifference(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Add(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AddPairwise(left, right, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AddPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.AddPairwise(firstOp, 0)) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseScalar_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AddPairwise(firstOp, 0)) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseScalar_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.AddPairwise(firstOp, 0) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseScalar_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.AddPairwise(firstOp, 0) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_Byte_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_Int16_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_Int32_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_SByte_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_UInt16_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_UInt32_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_Byte_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_Int16_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_Int32_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_Int64_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_SByte_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_UInt16_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_UInt32_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_UInt64_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_Byte_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_Byte_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_Int16_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_Int16_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_Int32_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_Int32_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_Int64_Vector64_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_SByte_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_SByte_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_UInt16_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_UInt16_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_UInt32_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_UInt32_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_UInt64_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Ceiling_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Ceiling", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Ceiling(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareEqual(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqualScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareEqual(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqualScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.CompareEqual(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqualScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareEqual(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqualScalar_Vector64_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.CompareEqual(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareGreaterThan(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareGreaterThan(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.CompareGreaterThan(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareGreaterThan(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanScalar_Vector64_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.CompareGreaterThan(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareGreaterThanOrEqual(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqualScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareGreaterThanOrEqual(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqualScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.CompareGreaterThanOrEqual(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqualScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareGreaterThanOrEqual(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqualScalar_Vector64_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.CompareGreaterThanOrEqual(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareLessThan(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareLessThan(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.CompareLessThan(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareLessThan(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanScalar_Vector64_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.CompareLessThan(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareLessThanOrEqual(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqualScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareLessThanOrEqual(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqualScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.CompareLessThanOrEqual(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqualScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareLessThanOrEqual(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqualScalar_Vector64_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.CompareLessThanOrEqual(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareTest(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareTestScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTestScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareTest(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareTestScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTestScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.CompareTest(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareTestScalar_Vector64_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTestScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.CompareTest(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToDouble_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToDouble", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ConvertToDouble(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToDouble_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToDouble", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ConvertToDouble(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToDouble_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToDouble", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ConvertToDouble(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToDoubleScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToDoubleScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ConvertToDouble(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToDoubleScalar_Vector64_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToDoubleScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ConvertToDouble(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToDoubleUpper_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToDoubleUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ConvertToDoubleUpper(firstOp, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundAwayFromZero_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundAwayFromZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToInt64RoundAwayFromZero(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundAwayFromZeroScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundAwayFromZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToInt64RoundAwayFromZero(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundToEven_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundToEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToInt64RoundToEven(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundToEvenScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundToEvenScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToInt64RoundToEven(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundToNegativeInfinity_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundToNegativeInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToInt64RoundToNegativeInfinity(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundToNegativeInfinityScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundToNegativeInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToInt64RoundToNegativeInfinity(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundToPositiveInfinity_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundToPositiveInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToInt64RoundToPositiveInfinity(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundToPositiveInfinityScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundToPositiveInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToInt64RoundToPositiveInfinity(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundToZero_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundToZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToInt64RoundToZero(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundToZeroScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundToZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToInt64RoundToZero(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingleLower_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingleLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ConvertToSingle(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingleRoundToOddLower_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingleRoundToOddLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "BitConverter.Int64BitsToDouble(0x3FF9E427C7C5260FL)", ["ValidateIterResult"] = "0x3FCF213F != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingleRoundToOddUpper_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingleRoundToOddUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "BitConverter.Int32BitsToSingle(0x3FCF213E)",["NextValueOp2"] = "BitConverter.Int64BitsToDouble(0x3FF9E427C7C5260FL)", ["ValidateIterResult"] = "(i < 2 ? 0x3FCF213E : 0x3FCF213F) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingleUpper_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingleUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ConvertToSingleUpper(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundAwayFromZero_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundAwayFromZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToUInt64RoundAwayFromZero(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundAwayFromZeroScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundAwayFromZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt64RoundAwayFromZero(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundToEven_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundToEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToUInt64RoundToEven(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundToEvenScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundToEvenScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt64RoundToEven(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundToNegativeInfinity_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundToNegativeInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToUInt64RoundToNegativeInfinity(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundToNegativeInfinityScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundToNegativeInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt64RoundToNegativeInfinity(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundToPositiveInfinity_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundToPositiveInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToUInt64RoundToPositiveInfinity(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundToPositiveInfinityScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundToPositiveInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt64RoundToPositiveInfinity(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundToZero_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundToZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToUInt64RoundToZero(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundToZeroScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundToZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt64RoundToZero(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Divide_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Divide", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Divide(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Divide_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Divide", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Divide(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Divide_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Divide", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Divide(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_V128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ValidateFirstResult"] = "result[0] != firstOp[1]", ["ValidateRemainingResults"] = "result[i] != firstOp[1]" }), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_V128_Int64_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "result[0] != firstOp[1]", ["ValidateRemainingResults"] = "result[i] != firstOp[1]" }), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_V128_UInt64_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "result[0] != firstOp[1]", ["ValidateRemainingResults"] = "result[i] != firstOp[1]" }), - ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), - ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Double_31", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), - ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), - ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Int64_31", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), - ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), - ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_UInt64_31", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateScalar_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateScalar_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateScalar_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateScalar_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUnsignedScalar_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.ExtractNarrowingSaturateUnsigned(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUnsignedScalar_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.ExtractNarrowingSaturateUnsigned(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUnsignedScalar_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ExtractNarrowingSaturateUnsigned(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Floor_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Floor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Floor(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAdd_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddByScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddByScalar_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddByScalar_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddBySelectedScalar_Vector64_Single_Vector64_Single_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddBySelectedScalar_Vector64_Single_Vector128_Single_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddBySelectedScalar_Vector128_Double_Vector128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddBySelectedScalar_Vector128_Single_Vector64_Single_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddBySelectedScalar_Vector128_Single_Vector128_Single_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddScalarBySelectedScalar_Vector64_Double_Vector128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplyAdd(firstOp[0], secondOp[0], thirdOp[Imm])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddScalarBySelectedScalar_Vector64_Single_Vector64_Single_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[0], secondOp[0], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddScalarBySelectedScalar_Vector64_Single_Vector128_Single_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[0], secondOp[0], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtract_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractByScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractByScalar_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractByScalar_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractBySelectedScalar_Vector64_Single_Vector64_Single_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractBySelectedScalar_Vector64_Single_Vector128_Single_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractBySelectedScalar_Vector128_Double_Vector128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractBySelectedScalar_Vector128_Single_Vector64_Single_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractBySelectedScalar_Vector128_Single_Vector128_Single_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractScalarBySelectedScalar_Vector64_Double_Vector128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplySubtract(firstOp[0], secondOp[0], thirdOp[Imm])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractScalarBySelectedScalar_Vector64_Single_Vector64_Single_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[0], secondOp[0], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractScalarBySelectedScalar_Vector64_Single_Vector128_Single_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[0], secondOp[0], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_Byte_7_Vector64_Byte_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex1"] = "7", ["ElementIndex2"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_Byte_7_Vector128_Byte_15", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex1"] = "7", ["ElementIndex2"] = "15", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_Int16_3_Vector64_Int16_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_Int16_3_Vector128_Int16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_Int32_1_Vector64_Int32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex1"] = "1", ["ElementIndex2"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_Int32_1_Vector128_Int32_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex1"] = "1", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_SByte_7_Vector64_SByte_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex1"] = "7", ["ElementIndex2"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_SByte_7_Vector128_SByte_15", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex1"] = "7", ["ElementIndex2"] = "15", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_Single_1_Vector64_Single_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex1"] = "1", ["ElementIndex2"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_Single_1_Vector128_Single_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex1"] = "1", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_UInt16_3_Vector64_UInt16_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_UInt16_3_Vector128_UInt16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_UInt32_1_Vector64_UInt32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex1"] = "1", ["ElementIndex2"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_UInt32_1_Vector128_UInt32_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex1"] = "1", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Byte_15_Vector64_Byte_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex1"] = "15", ["ElementIndex2"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Byte_15_Vector128_Byte_15", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex1"] = "15", ["ElementIndex2"] = "15", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Double_1_Vector128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex1"] = "1", ["ElementIndex2"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i)) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Int16_7_Vector64_Int16_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex1"] = "7", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Int16_7_Vector128_Int16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex1"] = "7", ["ElementIndex2"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Int32_3_Vector64_Int32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Int32_3_Vector128_Int32_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Int64_1_Vector128_Int64_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ElementIndex1"] = "1", ["ElementIndex2"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_SByte_15_Vector64_SByte_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex1"] = "15", ["ElementIndex2"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_SByte_15_Vector128_SByte_15", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex1"] = "15", ["ElementIndex2"] = "15", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Single_3_Vector64_Single_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Single_3_Vector128_Single_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_UInt16_7_Vector64_UInt16_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex1"] = "7", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_UInt16_7_Vector128_UInt16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex1"] = "7", ["ElementIndex2"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_UInt32_3_Vector64_UInt32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_UInt32_3_Vector128_UInt32_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_UInt64_1_Vector128_UInt64_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex1"] = "1", ["ElementIndex2"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_Double", ["Isa"] = "AdvSimd.Arm64", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(firstOp[0]) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), - ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Max(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateReduceOpResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxAcross(firstOp)) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxNumber_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumber", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MaxNumber(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxNumberAcross_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumberAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateReduceOpResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxNumberAcross(firstOp)) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxNumberPairwise_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumberPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxNumberPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxNumberPairwise_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumberPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MaxNumberPairwise(left, right, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxNumberPairwise_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumberPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxNumberPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "MaxNumberPairwiseScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumberPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxNumberPairwise(firstOp, 0)) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "MaxNumberPairwiseScalar_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumberPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MaxNumberPairwise(firstOp, 0)) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MaxPairwise(left, right, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "MaxPairwiseScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxPairwise(firstOp, 0)) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "MaxPairwiseScalar_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MaxPairwise(firstOp, 0)) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MaxScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Max(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MaxScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Max(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Min(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateReduceOpResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinAcross(firstOp)) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinNumber_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumber", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MinNumber(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinNumberAcross_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumberAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateReduceOpResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinNumberAcross(firstOp)) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinNumberPairwise_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumberPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinNumberPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinNumberPairwise_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumberPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MinNumberPairwise(left, right, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinNumberPairwise_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumberPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinNumberPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "MinNumberPairwiseScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumberPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinNumberPairwise(firstOp, 0)) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "MinNumberPairwiseScalar_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumberPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MinNumberPairwise(firstOp, 0)) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MinPairwise(left, right, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "MinPairwiseScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinPairwise(firstOp, 0)) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "MinPairwiseScalar_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MinPairwise(firstOp, 0)) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MinScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Min(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MinScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Min(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Multiply(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Multiply(left[i], right[0])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_Double_Vector128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Multiply(firstOp[i], secondOp[Imm])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingSaturateHighScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingSaturateHighScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingSaturateHighScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingSaturateHighScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingScalarBySelectedScalarSaturateHigh_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingScalarBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingScalarBySelectedScalarSaturateHigh_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingScalarBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingScalarBySelectedScalarSaturateHigh_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingScalarBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingScalarBySelectedScalarSaturateHigh_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingScalarBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "2", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningAndAddSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningAndAddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[0], secondOp[0], thirdOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningAndAddSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningAndAddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[0], secondOp[0], thirdOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningAndSubtractSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningAndSubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[0], secondOp[0], thirdOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningAndSubtractSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningAndSubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[0], secondOp[0], thirdOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateScalarBySelectedScalar_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningSaturate(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateScalarBySelectedScalar_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningSaturate(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateScalarBySelectedScalar_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningSaturate(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateScalarBySelectedScalar_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningSaturate(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningScalarBySelectedScalarAndSubtractSaturate_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningScalarBySelectedScalarAndSubtractSaturate",["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningScalarBySelectedScalarAndSubtractSaturate_Vector64_Int16_Vector128_Int16_7",["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningScalarBySelectedScalarAndSubtractSaturate",["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningScalarBySelectedScalarAndSubtractSaturate_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningScalarBySelectedScalarAndSubtractSaturate",["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningScalarBySelectedScalarAndSubtractSaturate_Vector64_Int32_Vector128_Int32_3",["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningScalarBySelectedScalarAndSubtractSaturate",["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtended_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtended", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MultiplyExtended(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtended_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtended", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MultiplyExtended(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtended_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtended", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MultiplyExtended(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtendedByScalar_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtendedByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MultiplyExtended(left[i], right[0])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtendedBySelectedScalar_Vector128_Double_Vector128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtendedBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MultiplyExtended(firstOp[i], secondOp[Imm])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtendedScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtendedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MultiplyExtended(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtendedScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtendedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.MultiplyExtended(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtendedScalarBySelectedScalar_Vector64_Double_Vector128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtendedScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MultiplyExtended(firstOp[0], secondOp[Imm])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtendedScalarBySelectedScalar_Vector64_Single_Vector64_Single_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtendedScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.MultiplyExtended(firstOp[0], secondOp[Imm])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtendedScalarBySelectedScalar_Vector64_Single_Vector128_Single_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtendedScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.MultiplyExtended(firstOp[0], secondOp[Imm])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingSaturateHighScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingSaturateHighScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingSaturateHighScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingSaturateHighScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingScalarBySelectedScalarSaturateHigh_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingScalarBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingScalarBySelectedScalarSaturateHigh_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingScalarBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingScalarBySelectedScalarSaturateHigh_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingScalarBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingScalarBySelectedScalarSaturateHigh_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingScalarBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyScalarBySelectedScalar_Vector64_Double_Vector128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Multiply(firstOp[0], secondOp[Imm])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Negate(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Negate(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "NegateSaturate_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "Int64.MinValue", ["ValidateIterResult"] = "Helpers.NegateSaturate(firstOp[i]) != result[i]"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "NegateSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int16.MinValue", ["ValidateFirstResult"] = "Helpers.NegateSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "NegateSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int32.MinValue", ["ValidateFirstResult"] = "Helpers.NegateSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "NegateSaturateScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int64.MinValue", ["ValidateFirstResult"] = "Helpers.NegateSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "NegateSaturateScalar_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "SByte.MinValue", ["ValidateFirstResult"] = "Helpers.NegateSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "NegateScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.Negate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalEstimate_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalEstimate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "BitConverter.Int64BitsToDouble(0x3fc9db3dab555868)", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0x4013d00000000000"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ReciprocalEstimateScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalEstimateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "BitConverter.Int64BitsToDouble(0x3fc9db3dab555868)", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != 0x4013d00000000000", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ReciprocalEstimateScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalEstimateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "BitConverter.Int32BitsToSingle(0x3e4ed9ed)", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != 0x409e8000", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ReciprocalExponentScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalExponentScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "BitConverter.Int64BitsToDouble(0x3fc9db3dab555868)", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != 0x4030000000000000", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ReciprocalExponentScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalExponentScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "BitConverter.Int32BitsToSingle(0x3e4ed9ed)", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != 0x41800000", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootEstimate_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootEstimate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "BitConverter.Int64BitsToDouble(0x3fc9db3dab555868)", ["ValidateIterResult"] = " BitConverter.DoubleToInt64Bits(result[i]) != 0x4001d00000000000"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootEstimateScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootEstimateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "BitConverter.Int64BitsToDouble(0x3fc9db3dab555868)", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != 0x4001d00000000000", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootEstimateScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootEstimateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "BitConverter.Int32BitsToSingle(0x3e4ed9ed)", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != 0x400e8000", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootStep_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootStep", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FPRSqrtStepFused(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootStepScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootStepScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FPRSqrtStepFused(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootStepScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootStepScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FPRSqrtStepFused(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalStep_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalStep", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FPRecipStepFused(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalStepScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalStepScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FPRecipStepFused(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalStepScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalStepScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FPRecipStepFused(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElementBits_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElementBits", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.ReverseElementBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElementBits_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElementBits", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ReverseElementBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElementBits_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElementBits", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.ReverseElementBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElementBits_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElementBits", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ReverseElementBits(firstOp[i]) != result[i]"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundAwayFromZero_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundAwayFromZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundAwayFromZero(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToNearest_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNearest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundToNearest(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToNegativeInfinity_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNegativeInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundToNegativeInfinity(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToPositiveInfinity_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToPositiveInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundToPositiveInfinity(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToZero_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundToZero(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturateScalar_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.ShiftArithmeticSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.ShiftArithmeticSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturateScalar_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "Helpers.ShiftArithmeticSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateScalar_Vector64_Byte_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateScalar_Vector64_Int16_15", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "15", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateScalar_Vector64_Int32_31", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "31", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateScalar_Vector64_SByte_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateScalar_Vector64_UInt16_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateScalar_Vector64_UInt32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsignedScalar_Vector64_Int16_5", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "5", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsignedScalar_Vector64_Int32_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsignedScalar_Vector64_SByte_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturateScalar_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturateScalar_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturateScalar_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturateScalar_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturateScalar_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturateScalar_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturateScalar_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturateScalar_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateScalar_Vector64_Int16_16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "16", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateScalar_Vector64_Int32_32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "32", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateScalar_Vector64_SByte_8", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "8", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUnsignedScalar_Vector64_Byte_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUnsignedScalar_Vector64_UInt16_5", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "5", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUnsignedScalar_Vector64_UInt32_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateScalar_Vector64_Int16_32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "16", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateScalar_Vector64_Int32_64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "32", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateScalar_Vector64_SByte_16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "8", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedScalar_Vector64_Byte_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedScalar_Vector64_UInt16_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "15", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedScalar_Vector64_UInt32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "31", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateScalar_Vector64_Byte_5", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateScalar_Vector64_Int16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "15", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateScalar_Vector64_Int32_11", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "31", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateScalar_Vector64_SByte_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateScalar_Vector64_UInt16_5", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "15", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateScalar_Vector64_UInt32_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "31", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar_Vector64_Byte_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar_Vector64_Int16_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "5", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar_Vector64_Int32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar_Vector64_SByte_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar_Vector64_UInt16_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "5", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar_Vector64_UInt32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sqrt_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Sqrt", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Sqrt(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sqrt_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Sqrt", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Sqrt(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sqrt_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Sqrt", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Sqrt(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), - ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Subtract(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturateScalar_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "Helpers.SubtractSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.SubtractSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.SubtractSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturateScalar_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "Helpers.SubtractSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturateScalar_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "Helpers.SubtractSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturateScalar_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "Helpers.SubtractSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "VectorTableLookup_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "VectorTableLookup", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "(Byte)(TestLibrary.Generator.GetByte() % 20)", ["ValidateFirstResult"] = "Helpers.TableVectorLookup(0, right, left) != result[0]", ["ValidateRemainingResults"] = "Helpers.TableVectorLookup(i, right, left) != result[i]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "VectorTableLookup_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "VectorTableLookup", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "(SByte)(TestLibrary.Generator.GetSByte() % 20)", ["ValidateFirstResult"] = "Helpers.TableVectorLookup(0, right, left) != result[0]", ["ValidateRemainingResults"] = "Helpers.TableVectorLookup(i, right, left) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "VectorTableLookupExtension_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "VectorTableLookupExtension", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "(Byte)(TestLibrary.Generator.GetByte() % 20)", ["ValidateIterResult"] = "Helpers.TableVectorExtension(i, firstOp, thirdOp, secondOp) != result[i]"}), - ("VecTernOpTest.template", new Dictionary { ["TestName"] = "VectorTableLookupExtension_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "VectorTableLookupExtension", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "(SByte)(TestLibrary.Generator.GetSByte() % 20)", ["ValidateIterResult"] = "Helpers.TableVectorExtension(i, firstOp, thirdOp, secondOp) != result[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), - ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "-TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Abs(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Abs_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "-TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Abs(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "AbsSaturate_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "Int64.MinValue", ["ValidateIterResult"] = "Helpers.AbsSaturate(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AbsSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int16.MinValue", ["ValidateFirstResult"] = "Helpers.AbsSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AbsSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int32.MinValue", ["ValidateFirstResult"] = "Helpers.AbsSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AbsSaturateScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int64.MinValue", ["ValidateFirstResult"] = "Helpers.AbsSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AbsSaturateScalar_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "SByte.MinValue", ["ValidateFirstResult"] = "Helpers.AbsSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AbsScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "-TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.Abs(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThan_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteCompareGreaterThan(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThanScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteCompareGreaterThan(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThanScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareGreaterThan(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThanOrEqual_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteCompareGreaterThanOrEqual(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThanOrEqualScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteCompareGreaterThanOrEqual(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareGreaterThanOrEqualScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareGreaterThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareGreaterThanOrEqual(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThan_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteCompareLessThan(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThanScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteCompareLessThan(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThanScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareLessThan(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThanOrEqual_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteCompareLessThanOrEqual(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThanOrEqualScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteCompareLessThanOrEqual(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteCompareLessThanOrEqualScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteCompareLessThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteCompareLessThanOrEqual(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifference_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteDifference(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteDifference(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AbsoluteDifferenceScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsoluteDifferenceScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteDifference(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Add_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Add(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcross_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateReduceOpResult"] = "Helpers.AddAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "AddAcrossWidening_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddAcrossWidening", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateReduceOpResult"] = "Helpers.AddAcrossWidening(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AddPairwise(left, right, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AddPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddPairwise_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.AddPairwise(left, right, i) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.AddPairwise(firstOp, 0)) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseScalar_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AddPairwise(firstOp, 0)) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseScalar_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.AddPairwise(firstOp, 0) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "AddPairwiseScalar_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.AddPairwise(firstOp, 0) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_Byte_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_Int16_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_Int32_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_SByte_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_UInt16_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector64_UInt32_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_Byte_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_Int16_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_Int32_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_Int64_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_SByte_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_UInt16_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_UInt32_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturate_Vector128_UInt64_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.AddSaturate(left[i], right[i]) != result[i]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_Byte_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_Byte_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_Int16_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_Int16_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_Int32_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_Int32_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_Int64_Vector64_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_SByte_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_SByte_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_UInt16_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_UInt16_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_UInt32_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_UInt32_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "AddSaturateScalar_Vector64_UInt64_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.AddSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Ceiling_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Ceiling", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Ceiling(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareEqual(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqual_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.CompareEqual(left[i], right[i]) != result[i]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqualScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareEqual(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqualScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.CompareEqual(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqualScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareEqual(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareEqualScalar_Vector64_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.CompareEqual(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareGreaterThan(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThan_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.CompareGreaterThan(left[i], right[i]) != result[i]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareGreaterThan(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.CompareGreaterThan(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareGreaterThan(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanScalar_Vector64_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.CompareGreaterThan(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareGreaterThanOrEqual(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqual_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqualScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareGreaterThanOrEqual(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqualScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.CompareGreaterThanOrEqual(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqualScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareGreaterThanOrEqual(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareGreaterThanOrEqualScalar_Vector64_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareGreaterThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.CompareGreaterThanOrEqual(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareLessThan(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThan_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.CompareLessThan(left[i], right[i]) != result[i]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareLessThan(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.CompareLessThan(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareLessThan(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanScalar_Vector64_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.CompareLessThan(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareLessThanOrEqual(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqual_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqualScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareLessThanOrEqual(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqualScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.CompareLessThanOrEqual(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqualScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.CompareLessThanOrEqual(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareLessThanOrEqualScalar_Vector64_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareLessThanOrEqualScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.CompareLessThanOrEqual(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareTest(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "CompareTest_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.CompareTest(left[i], right[i]) != result[i]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareTestScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTestScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.CompareTest(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareTestScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTestScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.CompareTest(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "CompareTestScalar_Vector64_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "CompareTestScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.CompareTest(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToDouble_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToDouble", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ConvertToDouble(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToDouble_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToDouble", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ConvertToDouble(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToDouble_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToDouble", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ConvertToDouble(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToDoubleScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToDoubleScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ConvertToDouble(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToDoubleScalar_Vector64_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToDoubleScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ConvertToDouble(firstOp[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToDoubleUpper_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToDoubleUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ConvertToDoubleUpper(firstOp, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundAwayFromZero_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundAwayFromZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToInt64RoundAwayFromZero(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundAwayFromZeroScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundAwayFromZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToInt64RoundAwayFromZero(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundToEven_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundToEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToInt64RoundToEven(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundToEvenScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundToEvenScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToInt64RoundToEven(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundToNegativeInfinity_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundToNegativeInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToInt64RoundToNegativeInfinity(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundToNegativeInfinityScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundToNegativeInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToInt64RoundToNegativeInfinity(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundToPositiveInfinity_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundToPositiveInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToInt64RoundToPositiveInfinity(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundToPositiveInfinityScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundToPositiveInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToInt64RoundToPositiveInfinity(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundToZero_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundToZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToInt64RoundToZero(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToInt64RoundToZeroScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToInt64RoundToZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToInt64RoundToZero(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingleLower_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingleLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ConvertToSingle(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingleRoundToOddLower_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingleRoundToOddLower", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "BitConverter.Int64BitsToDouble(0x3FF9E427C7C5260FL)", ["ValidateIterResult"] = "0x3FCF213F != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingleRoundToOddUpper_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingleRoundToOddUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "BitConverter.Int32BitsToSingle(0x3FCF213E)",["NextValueOp2"] = "BitConverter.Int64BitsToDouble(0x3FF9E427C7C5260FL)", ["ValidateIterResult"] = "(i < 2 ? 0x3FCF213E : 0x3FCF213F) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ConvertToSingleUpper_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToSingleUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ConvertToSingleUpper(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundAwayFromZero_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundAwayFromZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToUInt64RoundAwayFromZero(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundAwayFromZeroScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundAwayFromZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt64RoundAwayFromZero(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundToEven_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundToEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToUInt64RoundToEven(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundToEvenScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundToEvenScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt64RoundToEven(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundToNegativeInfinity_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundToNegativeInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToUInt64RoundToNegativeInfinity(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundToNegativeInfinityScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundToNegativeInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt64RoundToNegativeInfinity(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundToPositiveInfinity_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundToPositiveInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToUInt64RoundToPositiveInfinity(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundToPositiveInfinityScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundToPositiveInfinityScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt64RoundToPositiveInfinity(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundToZero_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundToZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.ConvertToUInt64RoundToZero(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ConvertToUInt64RoundToZeroScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ConvertToUInt64RoundToZeroScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.ConvertToUInt64RoundToZero(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Divide_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Divide", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Divide(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Divide_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Divide", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Divide(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Divide_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Divide", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Divide(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_V128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ValidateFirstResult"] = "result[0] != firstOp[1]", ["ValidateRemainingResults"] = "result[i] != firstOp[1]" }), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_V128_Int64_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "result[0] != firstOp[1]", ["ValidateRemainingResults"] = "result[i] != firstOp[1]" }), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "DuplicateSelectedScalarToVector128_V128_UInt64_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateSelectedScalarToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "1", ["ValidateFirstResult"] = "result[0] != firstOp[1]", ["ValidateRemainingResults"] = "result[i] != firstOp[1]" }), + ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), + ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Double_31", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), + ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), + ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_Int64_31", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), + ("DuplicateTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "result[0] != data", ["ValidateRemainingResults"] = "result[i] != data"}), + ("ImmOpTest.template", new Dictionary { ["TestName"] = "DuplicateToVector128_UInt64_31", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "DuplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["Imm"] = "31", ["ValidateFirstResult"] = "result[0] != 31", ["ValidateRemainingResults"] = "result[i] != 31"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateScalar_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateScalar_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateScalar_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateScalar_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.ExtractNarrowingSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUnsignedScalar_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.ExtractNarrowingSaturateUnsigned(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUnsignedScalar_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.ExtractNarrowingSaturateUnsigned(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ExtractNarrowingSaturateUnsignedScalar_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ExtractNarrowingSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.ExtractNarrowingSaturateUnsigned(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Floor_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Floor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Floor(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAdd_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddByScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddByScalar_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddByScalar_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddBySelectedScalar_Vector64_Single_Vector64_Single_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddBySelectedScalar_Vector64_Single_Vector128_Single_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddBySelectedScalar_Vector128_Double_Vector128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddBySelectedScalar_Vector128_Single_Vector64_Single_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddBySelectedScalar_Vector128_Single_Vector128_Single_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddScalarBySelectedScalar_Vector64_Double_Vector128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplyAdd(firstOp[0], secondOp[0], thirdOp[Imm])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddScalarBySelectedScalar_Vector64_Single_Vector64_Single_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[0], secondOp[0], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplyAddScalarBySelectedScalar_Vector64_Single_Vector128_Single_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplyAddScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplyAdd(firstOp[0], secondOp[0], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtract_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractByScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractByScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractByScalar_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[0])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractByScalar_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[0])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractBySelectedScalar_Vector64_Single_Vector64_Single_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractBySelectedScalar_Vector64_Single_Vector128_Single_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractBySelectedScalar_Vector128_Double_Vector128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractBySelectedScalar_Vector128_Single_Vector64_Single_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractBySelectedScalar_Vector128_Single_Vector128_Single_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[i], secondOp[i], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractScalarBySelectedScalar_Vector64_Double_Vector128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FusedMultiplySubtract(firstOp[0], secondOp[0], thirdOp[Imm])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractScalarBySelectedScalar_Vector64_Single_Vector64_Single_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[0], secondOp[0], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "FusedMultiplySubtractScalarBySelectedScalar_Vector64_Single_Vector128_Single_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "FusedMultiplySubtractScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FusedMultiplySubtract(firstOp[0], secondOp[0], thirdOp[Imm])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_Byte_7_Vector64_Byte_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex1"] = "7", ["ElementIndex2"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_Byte_7_Vector128_Byte_15", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex1"] = "7", ["ElementIndex2"] = "15", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_Int16_3_Vector64_Int16_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_Int16_3_Vector128_Int16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_Int32_1_Vector64_Int32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex1"] = "1", ["ElementIndex2"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_Int32_1_Vector128_Int32_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex1"] = "1", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_SByte_7_Vector64_SByte_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex1"] = "7", ["ElementIndex2"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_SByte_7_Vector128_SByte_15", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex1"] = "7", ["ElementIndex2"] = "15", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_Single_1_Vector64_Single_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex1"] = "1", ["ElementIndex2"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_Single_1_Vector128_Single_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex1"] = "1", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_UInt16_3_Vector64_UInt16_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_UInt16_3_Vector128_UInt16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_UInt32_1_Vector64_UInt32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex1"] = "1", ["ElementIndex2"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector64_UInt32_1_Vector128_UInt32_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex1"] = "1", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Byte_15_Vector64_Byte_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex1"] = "15", ["ElementIndex2"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Byte_15_Vector128_Byte_15", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ElementIndex1"] = "15", ["ElementIndex2"] = "15", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Double_1_Vector128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex1"] = "1", ["ElementIndex2"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i)) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Int16_7_Vector64_Int16_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex1"] = "7", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Int16_7_Vector128_Int16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex1"] = "7", ["ElementIndex2"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Int32_3_Vector64_Int32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Int32_3_Vector128_Int32_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Int64_1_Vector128_Int64_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ElementIndex1"] = "1", ["ElementIndex2"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_SByte_15_Vector64_SByte_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex1"] = "15", ["ElementIndex2"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_SByte_15_Vector128_SByte_15", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex1"] = "15", ["ElementIndex2"] = "15", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Single_3_Vector64_Single_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_Single_3_Vector128_Single_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_UInt16_7_Vector64_UInt16_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex1"] = "7", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_UInt16_7_Vector128_UInt16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex1"] = "7", ["ElementIndex2"] = "7", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_UInt32_3_Vector64_UInt32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_UInt32_3_Vector128_UInt32_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex1"] = "3", ["ElementIndex2"] = "3", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("InsertSelectedScalarTest.template", new Dictionary { ["TestName"] = "InsertSelectedScalar_Vector128_UInt64_1_Vector128_UInt64_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "InsertSelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex1"] = "1", ["ElementIndex2"] = "1", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Insert(firstOp, ElementIndex1, thirdOp[ElementIndex2], i) != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_Double", ["Isa"] = "AdvSimd.Arm64", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(firstOp[0]) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), + ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadAndReplicateToVector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["Method"] = "LoadAndReplicateToVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "firstOp[0] != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Max_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Max(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateReduceOpResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxAcross(firstOp)) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxAcross_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateReduceOpResult"] = "Helpers.MaxAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxNumber_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumber", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MaxNumber(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MaxNumberAcross_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumberAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateReduceOpResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxNumberAcross(firstOp)) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxNumberPairwise_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumberPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxNumberPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxNumberPairwise_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumberPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MaxNumberPairwise(left, right, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxNumberPairwise_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumberPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxNumberPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "MaxNumberPairwiseScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumberPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxNumberPairwise(firstOp, 0)) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "MaxNumberPairwiseScalar_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxNumberPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MaxNumberPairwise(firstOp, 0)) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MaxPairwise(left, right, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MaxPairwise_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MaxPairwise(left, right, i) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "MaxPairwiseScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.MaxPairwise(firstOp, 0)) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "MaxPairwiseScalar_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MaxPairwise(firstOp, 0)) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MaxScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Max(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MaxScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MaxScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Max(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Min_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Min", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Min(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateReduceOpResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinAcross(firstOp)) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinAcross_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateReduceOpResult"] = "Helpers.MinAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinNumber_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumber", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MinNumber(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecReduceUnOpTest.template", new Dictionary { ["TestName"] = "MinNumberAcross_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumberAcross", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateReduceOpResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinNumberAcross(firstOp)) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinNumberPairwise_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumberPairwise", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinNumberPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinNumberPairwise_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumberPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MinNumberPairwise(left, right, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinNumberPairwise_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumberPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinNumberPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "MinNumberPairwiseScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumberPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinNumberPairwise(firstOp, 0)) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "MinNumberPairwiseScalar_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinNumberPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MinNumberPairwise(firstOp, 0)) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MinPairwise(left, right, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinPairwise(left, right, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MinPairwise_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwise", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.MinPairwise(left, right, i) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "MinPairwiseScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.MinPairwise(firstOp, 0)) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "MinPairwiseScalar_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinPairwiseScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MinPairwise(firstOp, 0)) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MinScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Min(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MinScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MinScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.Min(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Multiply_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Multiply", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Multiply(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyByScalar_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Multiply(left[i], right[0])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyBySelectedScalar_Vector128_Double_Vector128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Multiply(firstOp[i], secondOp[Imm])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingSaturateHighScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingSaturateHighScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingSaturateHighScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingSaturateHighScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingSaturateHigh(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingScalarBySelectedScalarSaturateHigh_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingScalarBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingScalarBySelectedScalarSaturateHigh_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingScalarBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingScalarBySelectedScalarSaturateHigh_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingScalarBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingScalarBySelectedScalarSaturateHigh_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingScalarBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "2", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingSaturateHigh(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningAndAddSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningAndAddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[0], secondOp[0], thirdOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningAndAddSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningAndAddSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[0], secondOp[0], thirdOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningAndSubtractSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningAndSubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[0], secondOp[0], thirdOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningAndSubtractSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningAndSubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[0], secondOp[0], thirdOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateScalarBySelectedScalar_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningSaturate(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateScalarBySelectedScalar_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningSaturate(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateScalarBySelectedScalar_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningSaturate(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningSaturateScalarBySelectedScalar_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningSaturateScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningSaturate(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningScalarBySelectedScalarAndSubtractSaturate_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningScalarBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningScalarBySelectedScalarAndSubtractSaturate_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningScalarBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningScalarBySelectedScalarAndSubtractSaturate_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningScalarBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyDoublingWideningScalarBySelectedScalarAndSubtractSaturate_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyDoublingWideningScalarBySelectedScalarAndSubtractSaturate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyDoublingWideningAndSubtractSaturate(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtended_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtended", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MultiplyExtended(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtended_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtended", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MultiplyExtended(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtended_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtended", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.MultiplyExtended(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtendedByScalar_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtendedByScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MultiplyExtended(left[i], right[0])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("VecImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtendedBySelectedScalar_Vector128_Double_Vector128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtendedBySelectedScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MultiplyExtended(firstOp[i], secondOp[Imm])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtendedScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtendedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MultiplyExtended(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtendedScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtendedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.MultiplyExtended(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtendedScalarBySelectedScalar_Vector64_Double_Vector128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtendedScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.MultiplyExtended(firstOp[0], secondOp[Imm])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtendedScalarBySelectedScalar_Vector64_Single_Vector64_Single_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtendedScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "1", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.MultiplyExtended(firstOp[0], secondOp[Imm])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyExtendedScalarBySelectedScalar_Vector64_Single_Vector128_Single_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyExtendedScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["Imm"] = "3", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.MultiplyExtended(firstOp[0], secondOp[Imm])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingSaturateHighScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingSaturateHighScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingSaturateHighScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingSaturateHighScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingScalarBySelectedScalarSaturateHigh_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingScalarBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingScalarBySelectedScalarSaturateHigh_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingScalarBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingScalarBySelectedScalarSaturateHigh_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingScalarBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingScalarBySelectedScalarSaturateHigh_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingScalarBySelectedScalarSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingSaturateHigh(firstOp[0], secondOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmBinOpTest.template", new Dictionary { ["TestName"] = "MultiplyScalarBySelectedScalar_Vector64_Double_Vector128_Double_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyScalarBySelectedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["Imm"] = "1", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Multiply(firstOp[0], secondOp[Imm])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Negate(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Negate_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Negate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Negate(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "NegateSaturate_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "Int64.MinValue", ["ValidateIterResult"] = "Helpers.NegateSaturate(firstOp[i]) != result[i]"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "NegateSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int16.MinValue", ["ValidateFirstResult"] = "Helpers.NegateSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "NegateSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int32.MinValue", ["ValidateFirstResult"] = "Helpers.NegateSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "NegateSaturateScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "Int64.MinValue", ["ValidateFirstResult"] = "Helpers.NegateSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "NegateSaturateScalar_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "SByte.MinValue", ["ValidateFirstResult"] = "Helpers.NegateSaturate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "NegateScalar_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "NegateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.Negate(firstOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalEstimate_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalEstimate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "BitConverter.Int64BitsToDouble(0x3fc9db3dab555868)", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0x4013d00000000000"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ReciprocalEstimateScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalEstimateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "BitConverter.Int64BitsToDouble(0x3fc9db3dab555868)", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != 0x4013d00000000000", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ReciprocalEstimateScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalEstimateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "BitConverter.Int32BitsToSingle(0x3e4ed9ed)", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != 0x409e8000", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ReciprocalExponentScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalExponentScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "BitConverter.Int64BitsToDouble(0x3fc9db3dab555868)", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != 0x4030000000000000", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ReciprocalExponentScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalExponentScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "BitConverter.Int32BitsToSingle(0x3e4ed9ed)", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != 0x41800000", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootEstimate_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootEstimate", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "BitConverter.Int64BitsToDouble(0x3fc9db3dab555868)", ["ValidateIterResult"] = " BitConverter.DoubleToInt64Bits(result[i]) != 0x4001d00000000000"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootEstimateScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootEstimateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "BitConverter.Int64BitsToDouble(0x3fc9db3dab555868)", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != 0x4001d00000000000", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleUnOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootEstimateScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootEstimateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "BitConverter.Int32BitsToSingle(0x3e4ed9ed)", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != 0x400e8000", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootStep_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootStep", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FPRSqrtStepFused(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootStepScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootStepScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FPRSqrtStepFused(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalSquareRootStepScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalSquareRootStepScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FPRSqrtStepFused(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalStep_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalStep", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FPRecipStepFused(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalStepScalar_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalStepScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(Helpers.FPRecipStepFused(left[0], right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ReciprocalStepScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReciprocalStepScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(Helpers.FPRecipStepFused(left[0], right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElementBits_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElementBits", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.ReverseElementBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElementBits_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElementBits", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ReverseElementBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElementBits_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElementBits", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.ReverseElementBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "ReverseElementBits_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ReverseElementBits", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.ReverseElementBits(firstOp[i]) != result[i]"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundAwayFromZero_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundAwayFromZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundAwayFromZero(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToNearest_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNearest", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundToNearest(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToNegativeInfinity_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToNegativeInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundToNegativeInfinity(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToPositiveInfinity_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToPositiveInfinity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundToPositiveInfinity(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "RoundToZero_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "RoundToZero", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.RoundToZero(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticRoundedSaturateScalar_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "Helpers.ShiftArithmeticRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.ShiftArithmeticSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.ShiftArithmeticSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftArithmeticSaturateScalar_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftArithmeticSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "Helpers.ShiftArithmeticSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateScalar_Vector64_Byte_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateScalar_Vector64_Int16_15", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "15", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateScalar_Vector64_Int32_31", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "31", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateScalar_Vector64_SByte_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateScalar_Vector64_UInt16_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateScalar_Vector64_UInt32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsignedScalar_Vector64_Int16_5", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "5", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsignedScalar_Vector64_Int32_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftLeftLogicalSaturateUnsignedScalar_Vector64_SByte_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLeftLogicalSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.ShiftLeftLogicalSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturateScalar_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturateScalar_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturateScalar_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalRoundedSaturateScalar_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalRoundedSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalRoundedSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturateScalar_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturateScalar_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturateScalar_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "ShiftLogicalSaturateScalar_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftLogicalSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.ShiftLogicalSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateScalar_Vector64_Int16_16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "16", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateScalar_Vector64_Int32_32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "32", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateScalar_Vector64_SByte_8", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "8", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUnsignedScalar_Vector64_Byte_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUnsignedScalar_Vector64_UInt16_5", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "5", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticNarrowingSaturateUnsignedScalar_Vector64_UInt32_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticNarrowingSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticNarrowingSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateScalar_Vector64_Int16_32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "16", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateScalar_Vector64_Int32_64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "32", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateScalar_Vector64_SByte_16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "8", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedScalar_Vector64_Byte_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedScalar_Vector64_UInt16_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "15", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedScalar_Vector64_UInt32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightArithmeticRoundedNarrowingSaturateUnsignedScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "31", ["ValidateFirstResult"] = "Helpers.ShiftRightArithmeticRoundedNarrowingSaturateUnsigned(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateScalar_Vector64_Byte_5", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateScalar_Vector64_Int16_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "15", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateScalar_Vector64_Int32_11", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "31", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateScalar_Vector64_SByte_3", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateScalar_Vector64_UInt16_5", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "15", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalNarrowingSaturateScalar_Vector64_UInt32_7", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "31", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar_Vector64_Byte_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar_Vector64_Int16_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "5", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar_Vector64_Int32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar_Vector64_SByte_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar_Vector64_UInt16_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "5", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ImmUnOpTest.template", new Dictionary { ["TestName"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar_Vector64_UInt32_1", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ShiftRightLogicalRoundedNarrowingSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.ShiftRightLogicalRoundedNarrowingSaturate(firstOp[0], Imm) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sqrt_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Sqrt", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Sqrt(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sqrt_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Sqrt", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Sqrt(firstOp[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sqrt_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Sqrt", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Sqrt(firstOp[i])) != BitConverter.SingleToInt32Bits(result[i])"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Concat(firstOp, secondOp, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Concat(firstOp, secondOp, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector64_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Concat(firstOp, secondOp, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Concat(firstOp, secondOp, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePair_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePair", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairScalar", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ConcatScalar(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairScalar_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairScalar", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ConcatScalar(firstOp, secondOp, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairScalar_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairScalar", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ConcatScalar(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairScalarNonTemporal_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairScalarNonTemporal", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.ConcatScalar(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairScalarNonTemporal_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairScalarNonTemporal", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ConcatScalar(firstOp, secondOp, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairScalarNonTemporal_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairScalarNonTemporal", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.ConcatScalar(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector64_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Concat(firstOp, secondOp, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector64_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Concat(firstOp, secondOp, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector64_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Concat(firstOp, secondOp, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.Concat(firstOp, secondOp, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("StoreBinOpTest.template", new Dictionary { ["TestName"] = "StorePairNonTemporal_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "StorePairNonTemporal", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.Concat(firstOp, secondOp, i) != result[i]"}), + ("VecBinOpTest.template", new Dictionary { ["TestName"] = "Subtract_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "Subtract", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.Subtract(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturateScalar_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateFirstResult"] = "Helpers.SubtractSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturateScalar_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.SubtractSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturateScalar_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.SubtractSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturateScalar_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateFirstResult"] = "Helpers.SubtractSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturateScalar_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "Helpers.SubtractSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "SubtractSaturateScalar_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "SubtractSaturateScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "Helpers.SubtractSaturate(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeEven_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[index] != left[i] || result[++index] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "TransposeOdd_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[index] != left[i+1] || result[++index] != right[i+1]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "VectorTableLookup_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "VectorTableLookup", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "(Byte)(TestLibrary.Generator.GetByte() % 20)", ["ValidateFirstResult"] = "Helpers.TableVectorLookup(0, right, left) != result[0]", ["ValidateRemainingResults"] = "Helpers.TableVectorLookup(i, right, left) != result[i]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "VectorTableLookup_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "VectorTableLookup", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "(SByte)(TestLibrary.Generator.GetSByte() % 20)", ["ValidateFirstResult"] = "Helpers.TableVectorLookup(0, right, left) != result[0]", ["ValidateRemainingResults"] = "Helpers.TableVectorLookup(i, right, left) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "VectorTableLookupExtension_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "VectorTableLookupExtension", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "(Byte)(TestLibrary.Generator.GetByte() % 20)", ["ValidateIterResult"] = "Helpers.TableVectorExtension(i, firstOp, thirdOp, secondOp) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "VectorTableLookupExtension_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "VectorTableLookupExtension", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "(SByte)(TestLibrary.Generator.GetSByte() % 20)", ["ValidateIterResult"] = "Helpers.TableVectorExtension(i, firstOp, thirdOp, secondOp) != result[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipEven_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipEven", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[index] != left[i] || result[index + half] != right[i]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "UnzipOdd_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[index] != left[i+1] || result[index + half] != right[i+1]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipHigh_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[i] != left[index+half] || result[i+1] != right[index+half]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector64_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector64_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector64_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector64_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector64_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector64_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector64_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_Double", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_Int16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_Int32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_Int64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_Single", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_UInt16", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_UInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), + ("VecPairBinOpTest.template", new Dictionary { ["TestName"] = "ZipLow_Vector128_UInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[i] != left[index] || result[i+1] != right[index]"}), }; private static readonly (string templateFileName, Dictionary templateData)[] AesInputs = new [] { - ("AesBinOpTest.template", new Dictionary { ["TestName"] = "Decrypt_Vector128_Byte", ["Isa"] = "Aes", ["LoadIsa"] = "AdvSimd", ["Method"] = "Decrypt", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["InputSize"] = "16", ["Input"] = "{0xEF, 0xCD, 0xAB, 0x89, 0x67, 0x45, 0x23, 0x01, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA, 0x99, 0x88}", ["KeySize"] = "16", ["Key"] = "{0xFF, 0xDD, 0xBB, 0x99, 0x77, 0x55, 0x33, 0x11, 0xEE, 0xCC, 0xAA, 0x88, 0x66, 0x44, 0x22, 0x00}", ["ExpectedRetSize"] = "16", ["ExpectedRet"] = "{0x7C, 0x99, 0x02, 0x7C, 0x7C, 0x7C, 0xFE, 0x86, 0xE3, 0x7C, 0x7C, 0x97, 0xC9, 0x94, 0x7C, 0x7C}"}), - ("AesBinOpTest.template", new Dictionary { ["TestName"] = "Encrypt_Vector128_Byte", ["Isa"] = "Aes", ["LoadIsa"] = "AdvSimd", ["Method"] = "Encrypt", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["InputSize"] = "16", ["Input"] = "{0xEF, 0xCD, 0xAB, 0x89, 0x67, 0x45, 0x23, 0x01, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA, 0x99, 0x88}", ["KeySize"] = "16", ["Key"] = "{0xFF, 0xDD, 0xBB, 0x99, 0x77, 0x55, 0x33, 0x11, 0xEE, 0xCC, 0xAA, 0x88, 0x66, 0x44, 0x22, 0x00}", ["ExpectedRetSize"] = "16", ["ExpectedRet"] = "{0xCA, 0xCA, 0xF5, 0xC4, 0xCA, 0x93, 0xEA, 0xCA, 0x82, 0x28, 0xCA, 0xCA, 0xC1, 0xCA, 0xCA, 0x1B}"}), - ("AesUnOpTest.template", new Dictionary { ["TestName"] = "InverseMixColumns_Vector128_Byte", ["Isa"] = "Aes", ["LoadIsa"] = "AdvSimd", ["Method"] = "InverseMixColumns", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["InputSize"] = "16", ["Input"] = "{0xEF, 0xCD, 0xAB, 0x89, 0x67, 0x45, 0x23, 0x01, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA, 0x99, 0x88}", ["ExpectedRetSize"] = "16", ["ExpectedRet"] = "{0xA0, 0x0A, 0xE4, 0x4E, 0x28, 0x82, 0x6C, 0xC6, 0x55, 0x00, 0x77, 0x22, 0x11, 0x44, 0x33, 0x66}"}), - ("AesUnOpTest.template", new Dictionary { ["TestName"] = "MixColumns_Vector128_Byte", ["Isa"] = "Aes", ["LoadIsa"] = "AdvSimd", ["Method"] = "MixColumns", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["InputSize"] = "16", ["Input"] = "{0xEF, 0xCD, 0xAB, 0x89, 0x67, 0x45, 0x23, 0x01, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA, 0x99, 0x88}", ["ExpectedRetSize"] = "16", ["ExpectedRet"] = "{0xAB, 0x01, 0xEF, 0x45, 0x23, 0x89, 0x67, 0xCD, 0xDD, 0x88, 0xFF, 0xAA, 0x99, 0xCC, 0xBB, 0xEE}"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiplyWideningLower_Vector64_Int64", ["Isa"] = "Aes", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.PolynomialMultiplyWideningLo64(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "Helpers.PolynomialMultiplyWideningHi64(left[0], right[0]) != result[1]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiplyWideningLower_Vector64_UInt64", ["Isa"] = "Aes", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.PolynomialMultiplyWideningLo64(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "Helpers.PolynomialMultiplyWideningHi64(left[0], right[0]) != result[1]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiplyWideningUpper_Vector128_Int64", ["Isa"] = "Aes", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.PolynomialMultiplyWideningLo64(left[1], right[1]) != result[0]", ["ValidateRemainingResults"] = "Helpers.PolynomialMultiplyWideningHi64(left[1], right[1]) != result[1]"}), - ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiplyWideningUpper_Vector128_UInt64", ["Isa"] = "Aes", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.PolynomialMultiplyWideningLo64(left[1], right[1]) != result[0]", ["ValidateRemainingResults"] = "Helpers.PolynomialMultiplyWideningHi64(left[1], right[1]) != result[1]"}) + ("AesBinOpTest.template", new Dictionary { ["TestName"] = "Decrypt_Vector128_Byte", ["Isa"] = "Aes", ["LoadIsa"] = "AdvSimd", ["Method"] = "Decrypt", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["InputSize"] = "16", ["Input"] = "{0xEF, 0xCD, 0xAB, 0x89, 0x67, 0x45, 0x23, 0x01, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA, 0x99, 0x88}", ["KeySize"] = "16", ["Key"] = "{0xFF, 0xDD, 0xBB, 0x99, 0x77, 0x55, 0x33, 0x11, 0xEE, 0xCC, 0xAA, 0x88, 0x66, 0x44, 0x22, 0x00}", ["ExpectedRetSize"] = "16", ["ExpectedRet"] = "{0x7C, 0x99, 0x02, 0x7C, 0x7C, 0x7C, 0xFE, 0x86, 0xE3, 0x7C, 0x7C, 0x97, 0xC9, 0x94, 0x7C, 0x7C}"}), + ("AesBinOpTest.template", new Dictionary { ["TestName"] = "Encrypt_Vector128_Byte", ["Isa"] = "Aes", ["LoadIsa"] = "AdvSimd", ["Method"] = "Encrypt", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["InputSize"] = "16", ["Input"] = "{0xEF, 0xCD, 0xAB, 0x89, 0x67, 0x45, 0x23, 0x01, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA, 0x99, 0x88}", ["KeySize"] = "16", ["Key"] = "{0xFF, 0xDD, 0xBB, 0x99, 0x77, 0x55, 0x33, 0x11, 0xEE, 0xCC, 0xAA, 0x88, 0x66, 0x44, 0x22, 0x00}", ["ExpectedRetSize"] = "16", ["ExpectedRet"] = "{0xCA, 0xCA, 0xF5, 0xC4, 0xCA, 0x93, 0xEA, 0xCA, 0x82, 0x28, 0xCA, 0xCA, 0xC1, 0xCA, 0xCA, 0x1B}"}), + ("AesUnOpTest.template", new Dictionary { ["TestName"] = "InverseMixColumns_Vector128_Byte", ["Isa"] = "Aes", ["LoadIsa"] = "AdvSimd", ["Method"] = "InverseMixColumns", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["InputSize"] = "16", ["Input"] = "{0xEF, 0xCD, 0xAB, 0x89, 0x67, 0x45, 0x23, 0x01, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA, 0x99, 0x88}", ["ExpectedRetSize"] = "16", ["ExpectedRet"] = "{0xA0, 0x0A, 0xE4, 0x4E, 0x28, 0x82, 0x6C, 0xC6, 0x55, 0x00, 0x77, 0x22, 0x11, 0x44, 0x33, 0x66}"}), + ("AesUnOpTest.template", new Dictionary { ["TestName"] = "MixColumns_Vector128_Byte", ["Isa"] = "Aes", ["LoadIsa"] = "AdvSimd", ["Method"] = "MixColumns", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["InputSize"] = "16", ["Input"] = "{0xEF, 0xCD, 0xAB, 0x89, 0x67, 0x45, 0x23, 0x01, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA, 0x99, 0x88}", ["ExpectedRetSize"] = "16", ["ExpectedRet"] = "{0xAB, 0x01, 0xEF, 0x45, 0x23, 0x89, 0x67, 0xCD, 0xDD, 0x88, 0xFF, 0xAA, 0x99, 0xCC, 0xBB, 0xEE}"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiplyWideningLower_Vector64_Int64", ["Isa"] = "Aes", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.PolynomialMultiplyWideningLo64(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "Helpers.PolynomialMultiplyWideningHi64(left[0], right[0]) != result[1]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiplyWideningLower_Vector64_UInt64", ["Isa"] = "Aes", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiplyWideningLower", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.PolynomialMultiplyWideningLo64(left[0], right[0]) != result[0]", ["ValidateRemainingResults"] = "Helpers.PolynomialMultiplyWideningHi64(left[0], right[0]) != result[1]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiplyWideningUpper_Vector128_Int64", ["Isa"] = "Aes", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "Helpers.PolynomialMultiplyWideningLo64(left[1], right[1]) != result[0]", ["ValidateRemainingResults"] = "Helpers.PolynomialMultiplyWideningHi64(left[1], right[1]) != result[1]"}), + ("SimpleBinOpTest.template", new Dictionary { ["TestName"] = "PolynomialMultiplyWideningUpper_Vector128_UInt64", ["Isa"] = "Aes", ["LoadIsa"] = "AdvSimd", ["Method"] = "PolynomialMultiplyWideningUpper", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.PolynomialMultiplyWideningLo64(left[1], right[1]) != result[0]", ["ValidateRemainingResults"] = "Helpers.PolynomialMultiplyWideningHi64(left[1], right[1]) != result[1]"}) }; private static readonly (string templateFileName, Dictionary templateData)[] ArmBaseInputs = new [] { - ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Int32", ["Isa"] = "ArmBase", ["Method"] = "LeadingZeroCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateResult"] = "int expectedResult = 0; for (int index = 31; (((uint)data >> index) & 1) == 0; index--) { expectedResult++; } isUnexpectedResult = (expectedResult != result);" }), - ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_UInt32", ["Isa"] = "ArmBase", ["Method"] = "LeadingZeroCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "UInt32", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateResult"] = "int expectedResult = 0; for (int index = 31; ((data >> index) & 1) == 0; index--) { expectedResult++; } isUnexpectedResult = (expectedResult != result);" }), - ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "ReverseElementBits_Int32", ["Isa"] = "ArmBase", ["Method"] = "ReverseElementBits", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateResult"] = "isUnexpectedResult = Helpers.ReverseElementBits(data) != result;" }), - ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "ReverseElementBits_UInt32", ["Isa"] = "ArmBase", ["Method"] = "ReverseElementBits", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateResult"] = "isUnexpectedResult = Helpers.ReverseElementBits(data) != result;" }), + ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Int32", ["Isa"] = "ArmBase", ["Method"] = "LeadingZeroCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateResult"] = "int expectedResult = 0; for (int index = 31; (((uint)data >> index) & 1) == 0; index--) { expectedResult++; } isUnexpectedResult = (expectedResult != result);" }), + ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_UInt32", ["Isa"] = "ArmBase", ["Method"] = "LeadingZeroCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "UInt32", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateResult"] = "int expectedResult = 0; for (int index = 31; ((data >> index) & 1) == 0; index--) { expectedResult++; } isUnexpectedResult = (expectedResult != result);" }), + ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "ReverseElementBits_Int32", ["Isa"] = "ArmBase", ["Method"] = "ReverseElementBits", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateResult"] = "isUnexpectedResult = Helpers.ReverseElementBits(data) != result;" }), + ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "ReverseElementBits_UInt32", ["Isa"] = "ArmBase", ["Method"] = "ReverseElementBits", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateResult"] = "isUnexpectedResult = Helpers.ReverseElementBits(data) != result;" }), }; private static readonly (string templateFileName, Dictionary templateData)[] ArmBase_Arm64Inputs = new [] { - ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Int32", ["Isa"] = "ArmBase.Arm64", ["Method"] = "LeadingSignCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateResult"] = "int expectedResult = 0; for (int index = 30; (((uint)data >> index) & 1) == (((uint)data >> 31) & 1); index--) { expectedResult++; } isUnexpectedResult = (expectedResult != result);" }), - ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Int64", ["Isa"] = "ArmBase.Arm64", ["Method"] = "LeadingSignCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateResult"] = "int expectedResult = 0; for (int index = 62; (((ulong)data >> index) & 1) == (((ulong)data >> 63) & 1); index--) { expectedResult++; } isUnexpectedResult = (expectedResult != result);" }), - ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Int64", ["Isa"] = "ArmBase.Arm64", ["Method"] = "LeadingZeroCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateResult"] = "int expectedResult = 0; for (int index = 63; (((ulong)data >> index) & 1) == 0; index--) { expectedResult++; } isUnexpectedResult = (expectedResult != result);" }), - ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_UInt64", ["Isa"] = "ArmBase.Arm64", ["Method"] = "LeadingZeroCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "UInt64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateResult"] = "int expectedResult = 0; for (int index = 63; ((data >> index) & 1) == 0; index--) { expectedResult++; } isUnexpectedResult = (expectedResult != result);" }), - ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "ReverseElementBits_Int64", ["Isa"] = "ArmBase.Arm64", ["Method"] = "ReverseElementBits", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateResult"] = "isUnexpectedResult = Helpers.ReverseElementBits(data) != result;" }), - ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "ReverseElementBits_UInt64", ["Isa"] = "ArmBase.Arm64", ["Method"] = "ReverseElementBits", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateResult"] = "isUnexpectedResult = Helpers.ReverseElementBits(data) != result;" }), + ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Int32", ["Isa"] = "ArmBase.Arm64", ["Method"] = "LeadingSignCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateResult"] = "int expectedResult = 0; for (int index = 30; (((uint)data >> index) & 1) == (((uint)data >> 31) & 1); index--) { expectedResult++; } isUnexpectedResult = (expectedResult != result);" }), + ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "LeadingSignCount_Int64", ["Isa"] = "ArmBase.Arm64", ["Method"] = "LeadingSignCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateResult"] = "int expectedResult = 0; for (int index = 62; (((ulong)data >> index) & 1) == (((ulong)data >> 63) & 1); index--) { expectedResult++; } isUnexpectedResult = (expectedResult != result);" }), + ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_Int64", ["Isa"] = "ArmBase.Arm64", ["Method"] = "LeadingZeroCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateResult"] = "int expectedResult = 0; for (int index = 63; (((ulong)data >> index) & 1) == 0; index--) { expectedResult++; } isUnexpectedResult = (expectedResult != result);" }), + ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "LeadingZeroCount_UInt64", ["Isa"] = "ArmBase.Arm64", ["Method"] = "LeadingZeroCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "UInt64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateResult"] = "int expectedResult = 0; for (int index = 63; ((data >> index) & 1) == 0; index--) { expectedResult++; } isUnexpectedResult = (expectedResult != result);" }), + ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "ReverseElementBits_Int64", ["Isa"] = "ArmBase.Arm64", ["Method"] = "ReverseElementBits", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateResult"] = "isUnexpectedResult = Helpers.ReverseElementBits(data) != result;" }), + ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "ReverseElementBits_UInt64", ["Isa"] = "ArmBase.Arm64", ["Method"] = "ReverseElementBits", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateResult"] = "isUnexpectedResult = Helpers.ReverseElementBits(data) != result;" }), }; private static readonly (string templateFileName, Dictionary templateData)[] Crc32Inputs = new [] { - ("ScalarBinOpTest.template", new Dictionary { ["TestName"] = "ComputeCrc32_Byte", ["Isa"] = "Crc32", ["Method"] = "ComputeCrc32", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["NextValueOp1"] = "0xFFFFFFFF", ["NextValueOp2"] = "0x20", ["ValidateResult"] = "uint expectedResult = 0x169330BA; isUnexpectedResult = (expectedResult != result);" }), - ("ScalarBinOpTest.template", new Dictionary { ["TestName"] = "ComputeCrc32_UInt16", ["Isa"] = "Crc32", ["Method"] = "ComputeCrc32", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "UInt16", ["NextValueOp1"] = "0xFFFFFFFF", ["NextValueOp2"] = "0x2019", ["ValidateResult"] = "uint expectedResult = 0x1E4864D0; isUnexpectedResult = (expectedResult != result);" }), - ("ScalarBinOpTest.template", new Dictionary { ["TestName"] = "ComputeCrc32_UInt32", ["Isa"] = "Crc32", ["Method"] = "ComputeCrc32", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "UInt32", ["NextValueOp1"] = "0xFFFFFFFF", ["NextValueOp2"] = "0x20191113", ["ValidateResult"] = "uint expectedResult = 0x219D9805; isUnexpectedResult = (expectedResult != result);" }), - ("ScalarBinOpTest.template", new Dictionary { ["TestName"] = "ComputeCrc32C_Byte", ["Isa"] = "Crc32", ["Method"] = "ComputeCrc32C", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["NextValueOp1"] = "0xFFFFFFFF", ["NextValueOp2"] = "0x20", ["ValidateResult"] = "uint expectedResult = 0x8D3F2270; isUnexpectedResult = (expectedResult != result);" }), - ("ScalarBinOpTest.template", new Dictionary { ["TestName"] = "ComputeCrc32C_UInt16", ["Isa"] = "Crc32", ["Method"] = "ComputeCrc32C", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "UInt16", ["NextValueOp1"] = "0xFFFFFFFF", ["NextValueOp2"] = "0x2019", ["ValidateResult"] = "uint expectedResult = 0x9F50ACBD; isUnexpectedResult = (expectedResult != result);" }), - ("ScalarBinOpTest.template", new Dictionary { ["TestName"] = "ComputeCrc32C_UInt32", ["Isa"] = "Crc32", ["Method"] = "ComputeCrc32C", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "UInt32", ["NextValueOp1"] = "0xFFFFFFFF", ["NextValueOp2"] = "0x20191113", ["ValidateResult"] = "uint expectedResult = 0x78F34758; isUnexpectedResult = (expectedResult != result);" }), + ("ScalarBinOpTest.template", new Dictionary { ["TestName"] = "ComputeCrc32_Byte", ["Isa"] = "Crc32", ["Method"] = "ComputeCrc32", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["NextValueOp1"] = "0xFFFFFFFF", ["NextValueOp2"] = "0x20", ["ValidateResult"] = "uint expectedResult = 0x169330BA; isUnexpectedResult = (expectedResult != result);" }), + ("ScalarBinOpTest.template", new Dictionary { ["TestName"] = "ComputeCrc32_UInt16", ["Isa"] = "Crc32", ["Method"] = "ComputeCrc32", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "UInt16", ["NextValueOp1"] = "0xFFFFFFFF", ["NextValueOp2"] = "0x2019", ["ValidateResult"] = "uint expectedResult = 0x1E4864D0; isUnexpectedResult = (expectedResult != result);" }), + ("ScalarBinOpTest.template", new Dictionary { ["TestName"] = "ComputeCrc32_UInt32", ["Isa"] = "Crc32", ["Method"] = "ComputeCrc32", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "UInt32", ["NextValueOp1"] = "0xFFFFFFFF", ["NextValueOp2"] = "0x20191113", ["ValidateResult"] = "uint expectedResult = 0x219D9805; isUnexpectedResult = (expectedResult != result);" }), + ("ScalarBinOpTest.template", new Dictionary { ["TestName"] = "ComputeCrc32C_Byte", ["Isa"] = "Crc32", ["Method"] = "ComputeCrc32C", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["NextValueOp1"] = "0xFFFFFFFF", ["NextValueOp2"] = "0x20", ["ValidateResult"] = "uint expectedResult = 0x8D3F2270; isUnexpectedResult = (expectedResult != result);" }), + ("ScalarBinOpTest.template", new Dictionary { ["TestName"] = "ComputeCrc32C_UInt16", ["Isa"] = "Crc32", ["Method"] = "ComputeCrc32C", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "UInt16", ["NextValueOp1"] = "0xFFFFFFFF", ["NextValueOp2"] = "0x2019", ["ValidateResult"] = "uint expectedResult = 0x9F50ACBD; isUnexpectedResult = (expectedResult != result);" }), + ("ScalarBinOpTest.template", new Dictionary { ["TestName"] = "ComputeCrc32C_UInt32", ["Isa"] = "Crc32", ["Method"] = "ComputeCrc32C", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "UInt32", ["NextValueOp1"] = "0xFFFFFFFF", ["NextValueOp2"] = "0x20191113", ["ValidateResult"] = "uint expectedResult = 0x78F34758; isUnexpectedResult = (expectedResult != result);" }), }; private static readonly (string templateFileName, Dictionary templateData)[] Crc32_Arm64Inputs = new [] { - ("ScalarBinOpTest.template", new Dictionary { ["TestName"] = "ComputeCrc32_UInt64", ["Isa"] = "Crc32.Arm64", ["Method"] = "ComputeCrc32", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "UInt64", ["NextValueOp1"] = "0xFFFFFFFF", ["NextValueOp2"] = "0x20191113110219UL", ["ValidateResult"] = "uint expectedResult = 0xEFAAAB74; isUnexpectedResult = (expectedResult != result);" }), - ("ScalarBinOpTest.template", new Dictionary { ["TestName"] = "ComputeCrc32C_UInt64", ["Isa"] = "Crc32.Arm64", ["Method"] = "ComputeCrc32C", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "UInt64", ["NextValueOp1"] = "0xFFFFFFFF", ["NextValueOp2"] = "0x20191113110219UL", ["ValidateResult"] = "uint expectedResult = 0x6295C71A; isUnexpectedResult = (expectedResult != result);" }), + ("ScalarBinOpTest.template", new Dictionary { ["TestName"] = "ComputeCrc32_UInt64", ["Isa"] = "Crc32.Arm64", ["Method"] = "ComputeCrc32", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "UInt64", ["NextValueOp1"] = "0xFFFFFFFF", ["NextValueOp2"] = "0x20191113110219UL", ["ValidateResult"] = "uint expectedResult = 0xEFAAAB74; isUnexpectedResult = (expectedResult != result);" }), + ("ScalarBinOpTest.template", new Dictionary { ["TestName"] = "ComputeCrc32C_UInt64", ["Isa"] = "Crc32.Arm64", ["Method"] = "ComputeCrc32C", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "UInt64", ["NextValueOp1"] = "0xFFFFFFFF", ["NextValueOp2"] = "0x20191113110219UL", ["ValidateResult"] = "uint expectedResult = 0x6295C71A; isUnexpectedResult = (expectedResult != result);" }), +}; + +private static readonly (string templateFileName, Dictionary templateData)[] DpInputs = new [] +{ + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "DotProduct_Vector64_Int32", ["Isa"] = "Dp", ["LoadIsa"] = "AdvSimd", ["Method"] = "DotProduct", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "DotProduct_Vector64_UInt32", ["Isa"] = "Dp", ["LoadIsa"] = "AdvSimd", ["Method"] = "DotProduct", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "DotProduct_Vector128_Int32", ["Isa"] = "Dp", ["LoadIsa"] = "AdvSimd", ["Method"] = "DotProduct", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * i) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "DotProduct_Vector128_UInt32", ["Isa"] = "Dp", ["LoadIsa"] = "AdvSimd", ["Method"] = "DotProduct", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * i) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "DotProductBySelectedQuadruplet_Vector64_Int32_Vector64_SByte_1", ["Isa"] = "Dp", ["LoadIsa"] = "AdvSimd", ["Method"] = "DotProductBySelectedQuadruplet", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * Imm) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "DotProductBySelectedQuadruplet_Vector64_Int32_Vector128_SByte_3", ["Isa"] = "Dp", ["LoadIsa"] = "AdvSimd", ["Method"] = "DotProductBySelectedQuadruplet", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * Imm) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "DotProductBySelectedQuadruplet_Vector64_UInt32_Vector64_Byte_1", ["Isa"] = "Dp", ["LoadIsa"] = "AdvSimd", ["Method"] = "DotProductBySelectedQuadruplet", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * Imm) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "DotProductBySelectedQuadruplet_Vector64_UInt32_Vector128_Byte_3", ["Isa"] = "Dp", ["LoadIsa"] = "AdvSimd", ["Method"] = "DotProductBySelectedQuadruplet", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * Imm) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "DotProductBySelectedQuadruplet_Vector128_Int32_Vector64_SByte_1", ["Isa"] = "Dp", ["LoadIsa"] = "AdvSimd", ["Method"] = "DotProductBySelectedQuadruplet", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * Imm) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "DotProductBySelectedQuadruplet_Vector128_Int32_Vector128_SByte_3", ["Isa"] = "Dp", ["LoadIsa"] = "AdvSimd", ["Method"] = "DotProductBySelectedQuadruplet", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * Imm) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "DotProductBySelectedQuadruplet_Vector128_UInt32_Vector64_Byte_1", ["Isa"] = "Dp", ["LoadIsa"] = "AdvSimd", ["Method"] = "DotProductBySelectedQuadruplet", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * Imm) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "DotProductBySelectedQuadruplet_Vector128_UInt32_Vector128_Byte_3", ["Isa"] = "Dp", ["LoadIsa"] = "AdvSimd", ["Method"] = "DotProductBySelectedQuadruplet", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetByte()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.DotProduct(firstOp[i], secondOp, 4 * i, thirdOp, 4 * Imm) != result[i]"}), +}; + +private static readonly (string templateFileName, Dictionary templateData)[] RdmInputs = new [] +{ + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int16", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingAndAddSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingAndAddSaturateHigh_Vector64_Int32", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingAndAddSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int16", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingAndAddSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingAndAddSaturateHigh_Vector128_Int32", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingAndAddSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int16", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingAndSubtractSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector64_Int32", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingAndSubtractSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int16", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingAndSubtractSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingAndSubtractSaturateHigh_Vector128_Int32", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingAndSubtractSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector64_Int16_3", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int16_Vector128_Int16_7", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector64_Int32_1", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), + ("VecImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh_Vector128_Int32_Vector128_Int32_3", ["Isa"] = "Rdm", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateIterResult"] = "Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[i], secondOp[i], thirdOp[Imm]) != result[i]"}), +}; + +private static readonly (string templateFileName, Dictionary templateData)[] Rdm_Arm64Inputs = new [] +{ + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int16", ["Isa"] = "Rdm.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingAndAddSaturateHighScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[0], secondOp[0], thirdOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingAndAddSaturateHighScalar_Vector64_Int32", ["Isa"] = "Rdm.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingAndAddSaturateHighScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[0], secondOp[0], thirdOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int16", ["Isa"] = "Rdm.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingAndSubtractSaturateHighScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[0], secondOp[0], thirdOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingAndSubtractSaturateHighScalar_Vector64_Int32", ["Isa"] = "Rdm.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingAndSubtractSaturateHighScalar", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[0], secondOp[0], thirdOp[0]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "Rdm.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "Rdm.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "Rdm.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "Rdm.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingAndAddSaturateHigh(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector64_Int16_3", ["Isa"] = "Rdm.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int16_Vector128_Int16_7", ["Isa"] = "Rdm.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "7", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector64_Int32_1", ["Isa"] = "Rdm.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector64", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "1", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SimpleImmTernOpTest.template", new Dictionary { ["TestName"] = "MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh_Vector64_Int32_Vector128_Int32_3", ["Isa"] = "Rdm.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "Int32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "3", ["ValidateFirstResult"] = "Helpers.MultiplyRoundedDoublingAndSubtractSaturateHigh(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), }; private static readonly (string templateFileName, Dictionary templateData)[] Sha1Inputs = new [] { - ("SecureHashUnOpTest.template", new Dictionary { ["TestName"] = "FixedRotate_Vector64_UInt32", ["Isa"] = "Sha1", ["LoadIsa"] = "AdvSimd", ["Method"] = "FixedRotate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "0x00112233", ["ExpectedResult"] = "{0xC004488C, 0x0, 0x0, 0x0}"}), - ("SecureHashTernOpTest.template", new Dictionary { ["TestName"] = "HashUpdateChoose_Vector128_UInt32", ["Isa"] = "Sha1", ["LoadIsa"] = "AdvSimd", ["Method"] = "HashUpdateChoose", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "0x00112233", ["NextValueOp2"] = "0x44556677", ["NextValueOp3"] = "0x8899AABB", ["ExpectedResult"] = "{0x27A38C6D, 0xEFEFCA67, 0xDB4E8169, 0x73C91E71}"}), - ("SecureHashTernOpTest.template", new Dictionary { ["TestName"] = "HashUpdateMajority_Vector128_UInt32", ["Isa"] = "Sha1", ["LoadIsa"] = "AdvSimd", ["Method"] = "HashUpdateMajority", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "0x00112233", ["NextValueOp2"] = "0x44556677", ["NextValueOp3"] = "0x8899AABB", ["ExpectedResult"] = "{0xEC691B1D, 0xF21410C7, 0x9B52C9F6, 0x73C91E71}"}), - ("SecureHashTernOpTest.template", new Dictionary { ["TestName"] = "HashUpdateParity_Vector128_UInt32", ["Isa"] = "Sha1", ["LoadIsa"] = "AdvSimd", ["Method"] = "HashUpdateParity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "0x00112233", ["NextValueOp2"] = "0x44556677", ["NextValueOp3"] = "0x8899AABB", ["ExpectedResult"] = "{0xDAB2AF34, 0xFF990D18, 0xCB4F938C, 0x73C91E71}"}), - ("SecureHashTernOpTest.template", new Dictionary { ["TestName"] = "ScheduleUpdate0_Vector128_UInt32", ["Isa"] = "Sha1", ["LoadIsa"] = "AdvSimd", ["Method"] = "ScheduleUpdate0", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "0x00112233", ["NextValueOp2"] = "0x44556677", ["NextValueOp3"] = "0x8899AABB", ["ExpectedResult"] = "{0x8899AABB, 0x8899AABB, 0xCCDDEEFF, 0xCCDDEEFF}"}), - ("SecureHashBinOpTest.template", new Dictionary { ["TestName"] = "ScheduleUpdate1_Vector128_UInt32", ["Isa"] = "Sha1", ["LoadIsa"] = "AdvSimd", ["Method"] = "ScheduleUpdate1", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "0x00112233", ["NextValueOp2"] = "0x44556677", ["ExpectedResult"] = "{0x88888888, 0x88888888, 0x88888888, 0x11335577}"}), + ("SecureHashUnOpTest.template", new Dictionary { ["TestName"] = "FixedRotate_Vector64_UInt32", ["Isa"] = "Sha1", ["LoadIsa"] = "AdvSimd", ["Method"] = "FixedRotate", ["RetVectorType"] = "Vector64", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp1"] = "0x00112233", ["ExpectedResult"] = "{0xC004488C, 0x0, 0x0, 0x0}"}), + ("SecureHashTernOpTest.template", new Dictionary { ["TestName"] = "HashUpdateChoose_Vector128_UInt32", ["Isa"] = "Sha1", ["LoadIsa"] = "AdvSimd", ["Method"] = "HashUpdateChoose", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "0x00112233", ["NextValueOp2"] = "0x44556677", ["NextValueOp3"] = "0x8899AABB", ["ExpectedResult"] = "{0x27A38C6D, 0xEFEFCA67, 0xDB4E8169, 0x73C91E71}"}), + ("SecureHashTernOpTest.template", new Dictionary { ["TestName"] = "HashUpdateMajority_Vector128_UInt32", ["Isa"] = "Sha1", ["LoadIsa"] = "AdvSimd", ["Method"] = "HashUpdateMajority", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "0x00112233", ["NextValueOp2"] = "0x44556677", ["NextValueOp3"] = "0x8899AABB", ["ExpectedResult"] = "{0xEC691B1D, 0xF21410C7, 0x9B52C9F6, 0x73C91E71}"}), + ("SecureHashTernOpTest.template", new Dictionary { ["TestName"] = "HashUpdateParity_Vector128_UInt32", ["Isa"] = "Sha1", ["LoadIsa"] = "AdvSimd", ["Method"] = "HashUpdateParity", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "0x00112233", ["NextValueOp2"] = "0x44556677", ["NextValueOp3"] = "0x8899AABB", ["ExpectedResult"] = "{0xDAB2AF34, 0xFF990D18, 0xCB4F938C, 0x73C91E71}"}), + ("SecureHashTernOpTest.template", new Dictionary { ["TestName"] = "ScheduleUpdate0_Vector128_UInt32", ["Isa"] = "Sha1", ["LoadIsa"] = "AdvSimd", ["Method"] = "ScheduleUpdate0", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "0x00112233", ["NextValueOp2"] = "0x44556677", ["NextValueOp3"] = "0x8899AABB", ["ExpectedResult"] = "{0x8899AABB, 0x8899AABB, 0xCCDDEEFF, 0xCCDDEEFF}"}), + ("SecureHashBinOpTest.template", new Dictionary { ["TestName"] = "ScheduleUpdate1_Vector128_UInt32", ["Isa"] = "Sha1", ["LoadIsa"] = "AdvSimd", ["Method"] = "ScheduleUpdate1", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "0x00112233", ["NextValueOp2"] = "0x44556677", ["ExpectedResult"] = "{0x88888888, 0x88888888, 0x88888888, 0x11335577}"}), }; private static readonly (string templateFileName, Dictionary templateData)[] Sha256Inputs = new [] { - ("SecureHashTernOpTest.template", new Dictionary { ["TestName"] = "HashUpdate1_Vector128_UInt32", ["Isa"] = "Sha256", ["LoadIsa"] = "AdvSimd", ["Method"] = "HashUpdate1", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "0x00112233", ["NextValueOp2"] = "0x44556677", ["NextValueOp3"] = "0x8899AABB", ["ExpectedResult"] = "{0x3D22118E, 0x987CA5FB, 0x54F4E477, 0xDFB50278}"}), - ("SecureHashTernOpTest.template", new Dictionary { ["TestName"] = "HashUpdate2_Vector128_UInt32", ["Isa"] = "Sha256", ["LoadIsa"] = "AdvSimd", ["Method"] = "HashUpdate2", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "0x00112233", ["NextValueOp2"] = "0x44556677", ["NextValueOp3"] = "0x8899AABB", ["ExpectedResult"] = "{0xFFD38634, 0x2A33F83F, 0x55A1BE45, 0x5002B4C4}"}), - ("SecureHashBinOpTest.template", new Dictionary { ["TestName"] = "ScheduleUpdate0_Vector128_UInt32", ["Isa"] = "Sha256", ["LoadIsa"] = "AdvSimd", ["Method"] = "ScheduleUpdate0", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "0x00112233", ["NextValueOp2"] = "0x44556677", ["ExpectedResult"] = "{0x2E9FE839, 0x2E9FE839, 0x2E9FE839, 0xBFB0F94A}"}), - ("SecureHashTernOpTest.template", new Dictionary { ["TestName"] = "ScheduleUpdate1_Vector128_UInt32", ["Isa"] = "Sha256", ["LoadIsa"] = "AdvSimd", ["Method"] = "ScheduleUpdate1", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "0x00112233", ["NextValueOp2"] = "0x44556677", ["NextValueOp3"] = "0x8899AABB", ["ExpectedResult"] = "{0x248F1BDF, 0x248F1BDF, 0xB303DDBA, 0xF74821FE}"}), + ("SecureHashTernOpTest.template", new Dictionary { ["TestName"] = "HashUpdate1_Vector128_UInt32", ["Isa"] = "Sha256", ["LoadIsa"] = "AdvSimd", ["Method"] = "HashUpdate1", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "0x00112233", ["NextValueOp2"] = "0x44556677", ["NextValueOp3"] = "0x8899AABB", ["ExpectedResult"] = "{0x3D22118E, 0x987CA5FB, 0x54F4E477, 0xDFB50278}"}), + ("SecureHashTernOpTest.template", new Dictionary { ["TestName"] = "HashUpdate2_Vector128_UInt32", ["Isa"] = "Sha256", ["LoadIsa"] = "AdvSimd", ["Method"] = "HashUpdate2", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "0x00112233", ["NextValueOp2"] = "0x44556677", ["NextValueOp3"] = "0x8899AABB", ["ExpectedResult"] = "{0xFFD38634, 0x2A33F83F, 0x55A1BE45, 0x5002B4C4}"}), + ("SecureHashBinOpTest.template", new Dictionary { ["TestName"] = "ScheduleUpdate0_Vector128_UInt32", ["Isa"] = "Sha256", ["LoadIsa"] = "AdvSimd", ["Method"] = "ScheduleUpdate0", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "0x00112233", ["NextValueOp2"] = "0x44556677", ["ExpectedResult"] = "{0x2E9FE839, 0x2E9FE839, 0x2E9FE839, 0xBFB0F94A}"}), + ("SecureHashTernOpTest.template", new Dictionary { ["TestName"] = "ScheduleUpdate1_Vector128_UInt32", ["Isa"] = "Sha256", ["LoadIsa"] = "AdvSimd", ["Method"] = "ScheduleUpdate1", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "0x00112233", ["NextValueOp2"] = "0x44556677", ["NextValueOp3"] = "0x8899AABB", ["ExpectedResult"] = "{0x248F1BDF, 0x248F1BDF, 0xB303DDBA, 0xF74821FE}"}), }; private static void ProcessInputs(string groupName, (string templateFileName, Dictionary templateData)[] inputs) @@ -2492,5 +2598,8 @@ ProcessInputs("ArmBase", ArmBaseInputs); ProcessInputs("ArmBase.Arm64", ArmBase_Arm64Inputs); ProcessInputs("Crc32", Crc32Inputs); ProcessInputs("Crc32.Arm64", Crc32_Arm64Inputs); +ProcessInputs("Dp", DpInputs); +ProcessInputs("Rdm", RdmInputs); +ProcessInputs("Rdm.Arm64", Rdm_Arm64Inputs); ProcessInputs("Sha1", Sha1Inputs); ProcessInputs("Sha256", Sha256Inputs); diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs index a04cd431571c..ba1e776bdba0 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs @@ -2152,8 +2152,25 @@ public static byte ExtractNarrowingSaturateUnsigned(short op1) public static byte ExtractNarrowingSaturateUnsignedUpper(byte[] op1, short[] op2, int i) => i < op1.Length ? op1[i] : ExtractNarrowingSaturateUnsigned(op2[i - op1.Length]); - private static (short val, bool ovf) MultiplyDoublingOvf(sbyte op1, sbyte op2, bool rounding) + private static (short val, bool ovf) MultiplyDoublingOvf(sbyte op1, sbyte op2, bool rounding, short op3, bool subOp) { + short product = (short)((short)op1 * (short)op2); + + bool dblOvf; + (product, dblOvf) = AddOvf(product, product); + + bool addOvf; + short accum; + + if (subOp) + { + (accum, addOvf) = SubtractOvf(op3, product); + } + else + { + (accum, addOvf) = AddOvf(op3, product); + } + short roundConst = 0; if (rounding) @@ -2161,45 +2178,41 @@ private static (short val, bool ovf) MultiplyDoublingOvf(sbyte op1, sbyte op2, b roundConst = (short)1 << (8 * sizeof(sbyte) - 1); } - short product = (short)((short)op1 * (short)op2); + bool rndOvf; + short result; + + (result, rndOvf) = AddOvf(accum, roundConst); - var (result, ovf) = AddOvf(product, roundConst); + return (result, addOvf ^ rndOvf ^ dblOvf); + } + private static sbyte SaturateHigh(short val, bool ovf) + { if (ovf) { - return (result, ovf); + return val < 0 ? sbyte.MaxValue : sbyte.MinValue; } - return AddOvf(result, product); + return (sbyte)UnsignedShift(val, (short)(-8 * sizeof(sbyte))); } public static sbyte MultiplyDoublingSaturateHigh(sbyte op1, sbyte op2) { - var (product, ovf) = MultiplyDoublingOvf(op1, op2, rounding: false); + var (val, ovf) = MultiplyDoublingOvf(op1, op2, rounding: false, (short)0, subOp: false); - if (ovf) - { - return product < 0 ? sbyte.MaxValue : sbyte.MinValue; - } - - return (sbyte)UnsignedShift(product, (short)(-8 * sizeof(sbyte))); + return SaturateHigh(val, ovf); } public static sbyte MultiplyRoundedDoublingSaturateHigh(sbyte op1, sbyte op2) { - var (product, ovf) = MultiplyDoublingOvf(op1, op2, rounding: true); - - if (ovf) - { - return product < 0 ? sbyte.MaxValue : sbyte.MinValue; - } + var (val, ovf) = MultiplyDoublingOvf(op1, op2, rounding: true, (short)0, subOp: false); - return (sbyte)UnsignedShift(product, (short)(-8 * sizeof(sbyte))); + return SaturateHigh(val, ovf); } public static short MultiplyDoublingWideningSaturate(sbyte op1, sbyte op2) { - var (product, ovf) = MultiplyDoublingOvf(op1, op2, rounding: false); + var (product, ovf) = MultiplyDoublingOvf(op1, op2, rounding: false, (short)0, subOp: false); if (ovf) { @@ -2209,6 +2222,24 @@ public static short MultiplyDoublingWideningSaturate(sbyte op1, sbyte op2) return product; } + public static sbyte MultiplyRoundedDoublingAndAddSaturateHigh(sbyte op1, sbyte op2, sbyte op3) + { + short addend = UnsignedShift((short)op1, (short)(8 * sizeof(sbyte))); + + var (val, ovf) = MultiplyDoublingOvf(op2, op3, rounding: true, addend, subOp: false); + + return SaturateHigh(val, ovf); + } + + public static sbyte MultiplyRoundedDoublingAndSubtractSaturateHigh(sbyte op1, sbyte op2, sbyte op3) + { + short minuend = UnsignedShift((short)op1, (short)(8 * sizeof(sbyte))); + + var (val, ovf) = MultiplyDoublingOvf(op2, op3, rounding: true, minuend, subOp: true); + + return SaturateHigh(val, ovf); + } + public static short MultiplyDoublingWideningAndAddSaturate(short op1, sbyte op2, sbyte op3) => AddSaturate(op1, MultiplyDoublingWideningSaturate(op2, op3)); public static short MultiplyDoublingWideningAndSubtractSaturate(short op1, sbyte op2, sbyte op3) => SubtractSaturate(op1, MultiplyDoublingWideningSaturate(op2, op3)); @@ -2460,8 +2491,25 @@ public static ushort ExtractNarrowingSaturateUnsigned(int op1) public static ushort ExtractNarrowingSaturateUnsignedUpper(ushort[] op1, int[] op2, int i) => i < op1.Length ? op1[i] : ExtractNarrowingSaturateUnsigned(op2[i - op1.Length]); - private static (int val, bool ovf) MultiplyDoublingOvf(short op1, short op2, bool rounding) + private static (int val, bool ovf) MultiplyDoublingOvf(short op1, short op2, bool rounding, int op3, bool subOp) { + int product = (int)((int)op1 * (int)op2); + + bool dblOvf; + (product, dblOvf) = AddOvf(product, product); + + bool addOvf; + int accum; + + if (subOp) + { + (accum, addOvf) = SubtractOvf(op3, product); + } + else + { + (accum, addOvf) = AddOvf(op3, product); + } + int roundConst = 0; if (rounding) @@ -2469,45 +2517,41 @@ private static (int val, bool ovf) MultiplyDoublingOvf(short op1, short op2, boo roundConst = (int)1 << (8 * sizeof(short) - 1); } - int product = (int)((int)op1 * (int)op2); + bool rndOvf; + int result; - var (result, ovf) = AddOvf(product, roundConst); + (result, rndOvf) = AddOvf(accum, roundConst); + return (result, addOvf ^ rndOvf ^ dblOvf); + } + + private static short SaturateHigh(int val, bool ovf) + { if (ovf) { - return (result, ovf); + return val < 0 ? short.MaxValue : short.MinValue; } - return AddOvf(result, product); + return (short)UnsignedShift(val, (int)(-8 * sizeof(short))); } public static short MultiplyDoublingSaturateHigh(short op1, short op2) { - var (product, ovf) = MultiplyDoublingOvf(op1, op2, rounding: false); - - if (ovf) - { - return product < 0 ? short.MaxValue : short.MinValue; - } + var (val, ovf) = MultiplyDoublingOvf(op1, op2, rounding: false, (int)0, subOp: false); - return (short)UnsignedShift(product, (int)(-8 * sizeof(short))); + return SaturateHigh(val, ovf); } public static short MultiplyRoundedDoublingSaturateHigh(short op1, short op2) { - var (product, ovf) = MultiplyDoublingOvf(op1, op2, rounding: true); + var (val, ovf) = MultiplyDoublingOvf(op1, op2, rounding: true, (int)0, subOp: false); - if (ovf) - { - return product < 0 ? short.MaxValue : short.MinValue; - } - - return (short)UnsignedShift(product, (int)(-8 * sizeof(short))); + return SaturateHigh(val, ovf); } public static int MultiplyDoublingWideningSaturate(short op1, short op2) { - var (product, ovf) = MultiplyDoublingOvf(op1, op2, rounding: false); + var (product, ovf) = MultiplyDoublingOvf(op1, op2, rounding: false, (int)0, subOp: false); if (ovf) { @@ -2517,6 +2561,24 @@ public static int MultiplyDoublingWideningSaturate(short op1, short op2) return product; } + public static short MultiplyRoundedDoublingAndAddSaturateHigh(short op1, short op2, short op3) + { + int addend = UnsignedShift((int)op1, (int)(8 * sizeof(short))); + + var (val, ovf) = MultiplyDoublingOvf(op2, op3, rounding: true, addend, subOp: false); + + return SaturateHigh(val, ovf); + } + + public static short MultiplyRoundedDoublingAndSubtractSaturateHigh(short op1, short op2, short op3) + { + int minuend = UnsignedShift((int)op1, (int)(8 * sizeof(short))); + + var (val, ovf) = MultiplyDoublingOvf(op2, op3, rounding: true, minuend, subOp: true); + + return SaturateHigh(val, ovf); + } + public static int MultiplyDoublingWideningAndAddSaturate(int op1, short op2, short op3) => AddSaturate(op1, MultiplyDoublingWideningSaturate(op2, op3)); public static int MultiplyDoublingWideningAndSubtractSaturate(int op1, short op2, short op3) => SubtractSaturate(op1, MultiplyDoublingWideningSaturate(op2, op3)); @@ -2768,8 +2830,25 @@ public static uint ExtractNarrowingSaturateUnsigned(long op1) public static uint ExtractNarrowingSaturateUnsignedUpper(uint[] op1, long[] op2, int i) => i < op1.Length ? op1[i] : ExtractNarrowingSaturateUnsigned(op2[i - op1.Length]); - private static (long val, bool ovf) MultiplyDoublingOvf(int op1, int op2, bool rounding) + private static (long val, bool ovf) MultiplyDoublingOvf(int op1, int op2, bool rounding, long op3, bool subOp) { + long product = (long)((long)op1 * (long)op2); + + bool dblOvf; + (product, dblOvf) = AddOvf(product, product); + + bool addOvf; + long accum; + + if (subOp) + { + (accum, addOvf) = SubtractOvf(op3, product); + } + else + { + (accum, addOvf) = AddOvf(op3, product); + } + long roundConst = 0; if (rounding) @@ -2777,45 +2856,41 @@ private static (long val, bool ovf) MultiplyDoublingOvf(int op1, int op2, bool r roundConst = (long)1 << (8 * sizeof(int) - 1); } - long product = (long)((long)op1 * (long)op2); + bool rndOvf; + long result; - var (result, ovf) = AddOvf(product, roundConst); + (result, rndOvf) = AddOvf(accum, roundConst); + + return (result, addOvf ^ rndOvf ^ dblOvf); + } + private static int SaturateHigh(long val, bool ovf) + { if (ovf) { - return (result, ovf); + return val < 0 ? int.MaxValue : int.MinValue; } - return AddOvf(result, product); + return (int)UnsignedShift(val, (long)(-8 * sizeof(int))); } public static int MultiplyDoublingSaturateHigh(int op1, int op2) { - var (product, ovf) = MultiplyDoublingOvf(op1, op2, rounding: false); - - if (ovf) - { - return product < 0 ? int.MaxValue : int.MinValue; - } + var (val, ovf) = MultiplyDoublingOvf(op1, op2, rounding: false, (long)0, subOp: false); - return (int)UnsignedShift(product, (long)(-8 * sizeof(int))); + return SaturateHigh(val, ovf); } public static int MultiplyRoundedDoublingSaturateHigh(int op1, int op2) { - var (product, ovf) = MultiplyDoublingOvf(op1, op2, rounding: true); - - if (ovf) - { - return product < 0 ? int.MaxValue : int.MinValue; - } + var (val, ovf) = MultiplyDoublingOvf(op1, op2, rounding: true, (long)0, subOp: false); - return (int)UnsignedShift(product, (long)(-8 * sizeof(int))); + return SaturateHigh(val, ovf); } public static long MultiplyDoublingWideningSaturate(int op1, int op2) { - var (product, ovf) = MultiplyDoublingOvf(op1, op2, rounding: false); + var (product, ovf) = MultiplyDoublingOvf(op1, op2, rounding: false, (long)0, subOp: false); if (ovf) { @@ -2825,6 +2900,24 @@ public static long MultiplyDoublingWideningSaturate(int op1, int op2) return product; } + public static int MultiplyRoundedDoublingAndAddSaturateHigh(int op1, int op2, int op3) + { + long addend = UnsignedShift((long)op1, (long)(8 * sizeof(int))); + + var (val, ovf) = MultiplyDoublingOvf(op2, op3, rounding: true, addend, subOp: false); + + return SaturateHigh(val, ovf); + } + + public static int MultiplyRoundedDoublingAndSubtractSaturateHigh(int op1, int op2, int op3) + { + long minuend = UnsignedShift((long)op1, (long)(8 * sizeof(int))); + + var (val, ovf) = MultiplyDoublingOvf(op2, op3, rounding: true, minuend, subOp: true); + + return SaturateHigh(val, ovf); + } + public static long MultiplyDoublingWideningAndAddSaturate(long op1, int op2, int op3) => AddSaturate(op1, MultiplyDoublingWideningSaturate(op2, op3)); public static long MultiplyDoublingWideningAndSubtractSaturate(long op1, int op2, int op3) => SubtractSaturate(op1, MultiplyDoublingWideningSaturate(op2, op3)); @@ -5210,43 +5303,163 @@ private static poly128_t PolynomialMult(long op1, long op2) public static long PolynomialMultiplyWideningHi64(long op1, long op2) => (long)PolynomialMult(op1, op2).hi; - public static sbyte ExtractVector(sbyte[] op1, sbyte[] op2, int op3, int i) => (op3 + i < op1.Length) ? op1[op3 + i] : op2[op3 + i - op1.Length]; + public static sbyte Concat(sbyte[] op1, sbyte[] op2, int i) => (i < op1.Length) ? op1[i] : op2[i - op1.Length]; + + public static sbyte ConcatScalar(sbyte[] op1, sbyte[] op2, int i) + { + return i switch + { + 0 => op1[0], + 1 => op2[0], + _ => 0 + }; + } + + public static sbyte ExtractVector(sbyte[] op1, sbyte[] op2, int op3, int i) => Concat(op1, op2, op3 + i); public static sbyte Insert(sbyte[] op1, int op2, sbyte op3, int i) => (op2 != i) ? op1[i] : op3; - public static byte ExtractVector(byte[] op1, byte[] op2, int op3, int i) => (op3 + i < op1.Length) ? op1[op3 + i] : op2[op3 + i - op1.Length]; + public static byte Concat(byte[] op1, byte[] op2, int i) => (i < op1.Length) ? op1[i] : op2[i - op1.Length]; + + public static byte ConcatScalar(byte[] op1, byte[] op2, int i) + { + return i switch + { + 0 => op1[0], + 1 => op2[0], + _ => 0 + }; + } + + public static byte ExtractVector(byte[] op1, byte[] op2, int op3, int i) => Concat(op1, op2, op3 + i); public static byte Insert(byte[] op1, int op2, byte op3, int i) => (op2 != i) ? op1[i] : op3; - public static short ExtractVector(short[] op1, short[] op2, int op3, int i) => (op3 + i < op1.Length) ? op1[op3 + i] : op2[op3 + i - op1.Length]; + public static short Concat(short[] op1, short[] op2, int i) => (i < op1.Length) ? op1[i] : op2[i - op1.Length]; + + public static short ConcatScalar(short[] op1, short[] op2, int i) + { + return i switch + { + 0 => op1[0], + 1 => op2[0], + _ => 0 + }; + } + + public static short ExtractVector(short[] op1, short[] op2, int op3, int i) => Concat(op1, op2, op3 + i); public static short Insert(short[] op1, int op2, short op3, int i) => (op2 != i) ? op1[i] : op3; - public static ushort ExtractVector(ushort[] op1, ushort[] op2, int op3, int i) => (op3 + i < op1.Length) ? op1[op3 + i] : op2[op3 + i - op1.Length]; + public static ushort Concat(ushort[] op1, ushort[] op2, int i) => (i < op1.Length) ? op1[i] : op2[i - op1.Length]; + + public static ushort ConcatScalar(ushort[] op1, ushort[] op2, int i) + { + return i switch + { + 0 => op1[0], + 1 => op2[0], + _ => 0 + }; + } + + public static ushort ExtractVector(ushort[] op1, ushort[] op2, int op3, int i) => Concat(op1, op2, op3 + i); public static ushort Insert(ushort[] op1, int op2, ushort op3, int i) => (op2 != i) ? op1[i] : op3; - public static int ExtractVector(int[] op1, int[] op2, int op3, int i) => (op3 + i < op1.Length) ? op1[op3 + i] : op2[op3 + i - op1.Length]; + public static int Concat(int[] op1, int[] op2, int i) => (i < op1.Length) ? op1[i] : op2[i - op1.Length]; + + public static int ConcatScalar(int[] op1, int[] op2, int i) + { + return i switch + { + 0 => op1[0], + 1 => op2[0], + _ => 0 + }; + } + + public static int ExtractVector(int[] op1, int[] op2, int op3, int i) => Concat(op1, op2, op3 + i); public static int Insert(int[] op1, int op2, int op3, int i) => (op2 != i) ? op1[i] : op3; - public static uint ExtractVector(uint[] op1, uint[] op2, int op3, int i) => (op3 + i < op1.Length) ? op1[op3 + i] : op2[op3 + i - op1.Length]; + public static uint Concat(uint[] op1, uint[] op2, int i) => (i < op1.Length) ? op1[i] : op2[i - op1.Length]; + + public static uint ConcatScalar(uint[] op1, uint[] op2, int i) + { + return i switch + { + 0 => op1[0], + 1 => op2[0], + _ => 0 + }; + } + + public static uint ExtractVector(uint[] op1, uint[] op2, int op3, int i) => Concat(op1, op2, op3 + i); public static uint Insert(uint[] op1, int op2, uint op3, int i) => (op2 != i) ? op1[i] : op3; - public static long ExtractVector(long[] op1, long[] op2, int op3, int i) => (op3 + i < op1.Length) ? op1[op3 + i] : op2[op3 + i - op1.Length]; + public static long Concat(long[] op1, long[] op2, int i) => (i < op1.Length) ? op1[i] : op2[i - op1.Length]; + + public static long ConcatScalar(long[] op1, long[] op2, int i) + { + return i switch + { + 0 => op1[0], + 1 => op2[0], + _ => 0 + }; + } + + public static long ExtractVector(long[] op1, long[] op2, int op3, int i) => Concat(op1, op2, op3 + i); public static long Insert(long[] op1, int op2, long op3, int i) => (op2 != i) ? op1[i] : op3; - public static ulong ExtractVector(ulong[] op1, ulong[] op2, int op3, int i) => (op3 + i < op1.Length) ? op1[op3 + i] : op2[op3 + i - op1.Length]; + public static ulong Concat(ulong[] op1, ulong[] op2, int i) => (i < op1.Length) ? op1[i] : op2[i - op1.Length]; + + public static ulong ConcatScalar(ulong[] op1, ulong[] op2, int i) + { + return i switch + { + 0 => op1[0], + 1 => op2[0], + _ => 0 + }; + } + + public static ulong ExtractVector(ulong[] op1, ulong[] op2, int op3, int i) => Concat(op1, op2, op3 + i); public static ulong Insert(ulong[] op1, int op2, ulong op3, int i) => (op2 != i) ? op1[i] : op3; - public static float ExtractVector(float[] op1, float[] op2, int op3, int i) => (op3 + i < op1.Length) ? op1[op3 + i] : op2[op3 + i - op1.Length]; + public static float Concat(float[] op1, float[] op2, int i) => (i < op1.Length) ? op1[i] : op2[i - op1.Length]; + + public static float ConcatScalar(float[] op1, float[] op2, int i) + { + return i switch + { + 0 => op1[0], + 1 => op2[0], + _ => 0 + }; + } + + public static float ExtractVector(float[] op1, float[] op2, int op3, int i) => Concat(op1, op2, op3 + i); public static float Insert(float[] op1, int op2, float op3, int i) => (op2 != i) ? op1[i] : op3; - public static double ExtractVector(double[] op1, double[] op2, int op3, int i) => (op3 + i < op1.Length) ? op1[op3 + i] : op2[op3 + i - op1.Length]; + public static double Concat(double[] op1, double[] op2, int i) => (i < op1.Length) ? op1[i] : op2[i - op1.Length]; + + public static double ConcatScalar(double[] op1, double[] op2, int i) + { + return i switch + { + 0 => op1[0], + 1 => op2[0], + _ => 0 + }; + } + + public static double ExtractVector(double[] op1, double[] op2, int op3, int i) => Concat(op1, op2, op3 + i); public static double Insert(double[] op1, int op2, double op3, int i) => (op2 != i) ? op1[i] : op3; @@ -5711,5 +5924,29 @@ public static ulong ReverseElement32(ulong val) return (ulong)result; } + + public static uint DotProduct(uint op1, byte[] op2, int s, byte[] op3, int t) + { + uint result = op1; + + for (int i = 0; i < 4; i++) + { + result += (uint)((uint)op2[s + i] * (uint)op3[t + i]); + } + + return result; + } + + public static int DotProduct(int op1, sbyte[] op2, int s, sbyte[] op3, int t) + { + int result = op1; + + for (int i = 0; i < 4; i++) + { + result += (int)((int)op2[s + i] * (int)op3[t + i]); + } + + return result; + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.tt b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.tt index dca3aac61d8c..5e472b09d7c0 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.tt +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.tt @@ -558,8 +558,25 @@ namespace JIT.HardwareIntrinsics.Arm public static <#= type.unsigned #> ExtractNarrowingSaturateUnsignedUpper(<#= type.unsigned #>[] op1, <#= type.wide #>[] op2, int i) => i < op1.Length ? op1[i] : ExtractNarrowingSaturateUnsigned(op2[i - op1.Length]); - private static (<#= type.wide #> val, bool ovf) MultiplyDoublingOvf(<#= type.name #> op1, <#= type.name #> op2, bool rounding) + private static (<#= type.wide #> val, bool ovf) MultiplyDoublingOvf(<#= type.name #> op1, <#= type.name #> op2, bool rounding, <#= type.wide #> op3, bool subOp) { + <#= type.wide #> product = (<#= type.wide #>)((<#= type.wide #>)op1 * (<#= type.wide #>)op2); + + bool dblOvf; + (product, dblOvf) = AddOvf(product, product); + + bool addOvf; + <#= type.wide #> accum; + + if (subOp) + { + (accum, addOvf) = SubtractOvf(op3, product); + } + else + { + (accum, addOvf) = AddOvf(op3, product); + } + <#= type.wide #> roundConst = 0; if (rounding) @@ -567,45 +584,41 @@ namespace JIT.HardwareIntrinsics.Arm roundConst = (<#= type.wide#>)1 << (8 * sizeof(<#= type.name #>) - 1); } - <#= type.wide #> product = (<#= type.wide #>)((<#= type.wide #>)op1 * (<#= type.wide #>)op2); + bool rndOvf; + <#= type.wide #> result; + + (result, rndOvf) = AddOvf(accum, roundConst); - var (result, ovf) = AddOvf(product, roundConst); + return (result, addOvf ^ rndOvf ^ dblOvf); + } + private static <#= type.name #> SaturateHigh(<#= type.wide #> val, bool ovf) + { if (ovf) { - return (result, ovf); + return val < 0 ? <#= type.name #>.MaxValue : <#= type.name #>.MinValue; } - return AddOvf(result, product); + return (<#= type.name #>)UnsignedShift(val, (<#= type.wide #>)(-8 * sizeof(<#= type.name #>))); } public static <#= type.name #> MultiplyDoublingSaturateHigh(<#= type.name #> op1, <#= type.name #> op2) { - var (product, ovf) = MultiplyDoublingOvf(op1, op2, rounding: false); + var (val, ovf) = MultiplyDoublingOvf(op1, op2, rounding: false, (<#= type.wide #>)0, subOp: false); - if (ovf) - { - return product < 0 ? <#= type.name #>.MaxValue : <#= type.name #>.MinValue; - } - - return (<#= type.name #>)UnsignedShift(product, (<#= type.wide #>)(-8 * sizeof(<#= type.name #>))); + return SaturateHigh(val, ovf); } public static <#= type.name #> MultiplyRoundedDoublingSaturateHigh(<#= type.name #> op1, <#= type.name #> op2) { - var (product, ovf) = MultiplyDoublingOvf(op1, op2, rounding: true); + var (val, ovf) = MultiplyDoublingOvf(op1, op2, rounding: true, (<#= type.wide #>)0, subOp: false); - if (ovf) - { - return product < 0 ? <#= type.name #>.MaxValue : <#= type.name #>.MinValue; - } - - return (<#= type.name #>)UnsignedShift(product, (<#= type.wide #>)(-8 * sizeof(<#= type.name #>))); + return SaturateHigh(val, ovf); } public static <#= type.wide #> MultiplyDoublingWideningSaturate(<#= type.name #> op1, <#= type.name #> op2) { - var (product, ovf) = MultiplyDoublingOvf(op1, op2, rounding: false); + var (product, ovf) = MultiplyDoublingOvf(op1, op2, rounding: false, (<#= type.wide #>)0, subOp: false); if (ovf) { @@ -615,6 +628,24 @@ namespace JIT.HardwareIntrinsics.Arm return product; } + public static <#= type.name #> MultiplyRoundedDoublingAndAddSaturateHigh(<#= type.name #> op1, <#= type.name #> op2, <#= type.name #> op3) + { + <#= type.wide #> addend = UnsignedShift((<#= type.wide #>)op1, (<#= type.wide #>)(8 * sizeof(<#= type.name #>))); + + var (val, ovf) = MultiplyDoublingOvf(op2, op3, rounding: true, addend, subOp: false); + + return SaturateHigh(val, ovf); + } + + public static <#= type.name #> MultiplyRoundedDoublingAndSubtractSaturateHigh(<#= type.name #> op1, <#= type.name #> op2, <#= type.name #> op3) + { + <#= type.wide #> minuend = UnsignedShift((<#= type.wide #>)op1, (<#= type.wide #>)(8 * sizeof(<#= type.name #>))); + + var (val, ovf) = MultiplyDoublingOvf(op2, op3, rounding: true, minuend, subOp: true); + + return SaturateHigh(val, ovf); + } + public static <#= type.wide #> MultiplyDoublingWideningAndAddSaturate(<#= type.wide #> op1, <#= type.name #> op2, <#= type.name #> op3) => AddSaturate(op1, MultiplyDoublingWideningSaturate(op2, op3)); public static <#= type.wide #> MultiplyDoublingWideningAndSubtractSaturate(<#= type.wide #> op1, <#= type.name #> op2, <#= type.name #> op3) => SubtractSaturate(op1, MultiplyDoublingWideningSaturate(op2, op3)); @@ -1388,7 +1419,19 @@ namespace JIT.HardwareIntrinsics.Arm foreach (string typeName in new string[] { "sbyte", "byte", "short", "ushort", "int", "uint", "long", "ulong", "float", "double" }) { #> - public static <#= typeName #> ExtractVector(<#= typeName #>[] op1, <#= typeName #>[] op2, int op3, int i) => (op3 + i < op1.Length) ? op1[op3 + i] : op2[op3 + i - op1.Length]; + public static <#= typeName #> Concat(<#= typeName #>[] op1, <#= typeName #>[] op2, int i) => (i < op1.Length) ? op1[i] : op2[i - op1.Length]; + + public static <#= typeName #> ConcatScalar(<#= typeName #>[] op1, <#= typeName #>[] op2, int i) + { + return i switch + { + 0 => op1[0], + 1 => op2[0], + _ => 0 + }; + } + + public static <#= typeName #> ExtractVector(<#= typeName #>[] op1, <#= typeName #>[] op2, int op3, int i) => Concat(op1, op2, op3 + i); public static <#= typeName #> Insert(<#= typeName #>[] op1, int op2, <#= typeName #> op3, int i) => (op2 != i) ? op1[i] : op3; @@ -1532,6 +1575,24 @@ namespace JIT.HardwareIntrinsics.Arm return (<#= typeName #>)result; } +<# + } + + foreach (var type in new[] { (name: "byte", wide: "uint"), (name: "sbyte", wide: "int") }) + { +#> + + public static <#= type.wide #> DotProduct(<#= type.wide #> op1, <#= type.name #>[] op2, int s, <#= type.name #>[] op3, int t) + { + <#= type.wide #> result = op1; + + for (int i = 0; i < 4; i++) + { + result += (<#= type.wide #>)((<#= type.wide #>)op2[s + i] * (<#= type.wide #>)op3[t + i]); + } + + return result; + } <# } #> diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Program.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Program.cs index 4ee97cb3e726..e94fb995641b 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Program.cs +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Program.cs @@ -73,6 +73,8 @@ private static void PrintSupportedIsa() TestLibrary.TestFramework.LogInformation($" Aes: {Aes.IsSupported}"); TestLibrary.TestFramework.LogInformation($" ArmBase: {ArmBase.IsSupported}"); TestLibrary.TestFramework.LogInformation($" Crc32: {Crc32.IsSupported}"); + TestLibrary.TestFramework.LogInformation($" Dp: {Dp.IsSupported}"); + TestLibrary.TestFramework.LogInformation($" Rdm: {Rdm.IsSupported}"); TestLibrary.TestFramework.LogInformation($" Sha1: {Sha1.IsSupported}"); TestLibrary.TestFramework.LogInformation($" Sha256: {Sha256.IsSupported}"); TestLibrary.TestFramework.LogInformation(string.Empty); diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/StoreBinOpTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/StoreBinOpTest.template new file mode 100644 index 000000000000..fcd1e0d714a7 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/StoreBinOpTest.template @@ -0,0 +1,518 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + private static void {TestName}() + { + var test = new StoreBinaryOpTest__{TestName}(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if ({LoadIsa}.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + if ({LoadIsa}.IsSupported) + { + // Validates calling via reflection works, using Load + test.RunReflectionScenario_Load(); + } + + // Validates passing a static member works + test.RunClsVarScenario(); + + if ({LoadIsa}.IsSupported) + { + // Validates passing a static member works, using pinning and Load + test.RunClsVarScenario_Load(); + } + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + if ({LoadIsa}.IsSupported) + { + // Validates passing a local works, using Load + test.RunLclVarScenario_Load(); + } + + // Validates passing the field of a local class works + test.RunClassLclFldScenario(); + + if ({LoadIsa}.IsSupported) + { + // Validates passing the field of a local class works, using pinning and Load + test.RunClassLclFldScenario_Load(); + } + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + if ({LoadIsa}.IsSupported) + { + // Validates passing an instance member of a class works, using pinning and Load + test.RunClassFldScenario_Load(); + } + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + if ({LoadIsa}.IsSupported) + { + // Validates passing the field of a local struct works, using pinning and Load + test.RunStructLclFldScenario_Load(); + } + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + if ({LoadIsa}.IsSupported) + { + // Validates passing an instance member of a struct works, using pinning and Load + test.RunStructFldScenario_Load(); + } + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class StoreBinaryOpTest__{TestName} + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable({Op1BaseType}[] inArray1, {Op2BaseType}[] inArray2, {RetBaseType}[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); + if ((alignment != 16 && alignment != 32) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public {Op1VectorType}<{Op1BaseType}> _fld1; + public {Op2VectorType}<{Op2BaseType}> _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp2}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op2VectorType}<{Op2BaseType}>, byte>(ref testStruct._fld2), ref Unsafe.As<{Op2BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreBinaryOpTest__{TestName} testClass) + { + {Isa}.{Method}(({RetBaseType}*)testClass._dataTable.outArrayPtr, _fld1, _fld2); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + + public void RunStructFldScenario_Load(StoreBinaryOpTest__{TestName} testClass) + { + fixed ({Op1VectorType}<{Op1BaseType}>* pFld1 = &_fld1) + fixed ({Op2VectorType}<{Op2BaseType}>* pFld2 = &_fld2) + { + {Isa}.{Method}( + ({RetBaseType}*)testClass._dataTable.outArrayPtr, + {LoadIsa}.Load{Op1VectorType}(({Op1BaseType}*)(pFld1)), + {LoadIsa}.Load{Op2VectorType}(({Op2BaseType}*)(pFld2)) + ); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + } + + private static readonly int LargestVectorSize = {LargestVectorSize}; + + private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int Op2ElementCount = Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>() / sizeof({Op2BaseType}); + private static readonly int RetElementCount = Op1ElementCount + Op2ElementCount; + + private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; + private static {Op2BaseType}[] _data2 = new {Op2BaseType}[Op2ElementCount]; + + private static {Op1VectorType}<{Op1BaseType}> _clsVar1; + private static {Op2VectorType}<{Op2BaseType}> _clsVar2; + + private {Op1VectorType}<{Op1BaseType}> _fld1; + private {Op2VectorType}<{Op2BaseType}> _fld2; + + private DataTable _dataTable; + + static StoreBinaryOpTest__{TestName}() + { + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _clsVar1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp2}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op2VectorType}<{Op2BaseType}>, byte>(ref _clsVar2), ref Unsafe.As<{Op2BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>()); + } + + public StoreBinaryOpTest__{TestName}() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp2}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op2VectorType}<{Op2BaseType}>, byte>(ref _fld2), ref Unsafe.As<{Op2BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + _dataTable = new DataTable(_data1, _data2, new {RetBaseType}[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => {Isa}.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + {Isa}.{Method}( + ({RetBaseType}*)_dataTable.outArrayPtr, + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), + Unsafe.Read<{Op2VectorType}<{Op2BaseType}>>(_dataTable.inArray2Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + {Isa}.{Method}( + ({RetBaseType}*)_dataTable.outArrayPtr, + {LoadIsa}.Load{Op1VectorType}(({Op1BaseType}*)(_dataTable.inArray1Ptr)), + {LoadIsa}.Load{Op2VectorType}(({Op2BaseType}*)(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + typeof({Isa}).GetMethod(nameof({Isa}.{Method}), new Type[] { typeof({RetBaseType}*), typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op2VectorType}<{Op2BaseType}>) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof({RetBaseType}*)), + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), + Unsafe.Read<{Op2VectorType}<{Op2BaseType}>>(_dataTable.inArray2Ptr) }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + typeof({Isa}).GetMethod(nameof({Isa}.{Method}), new Type[] { typeof({RetBaseType}*), typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op2VectorType}<{Op2BaseType}>) }) + .Invoke(null, new object[] { + Pointer.Box(_dataTable.outArrayPtr, typeof({RetBaseType}*)), + {LoadIsa}.Load{Op1VectorType}(({Op1BaseType}*)(_dataTable.inArray1Ptr)), + {LoadIsa}.Load{Op2VectorType}(({Op2BaseType}*)(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); + + {Isa}.{Method}(({RetBaseType}*)_dataTable.outArrayPtr, _clsVar1, _clsVar2); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + + public void RunClsVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); + + fixed ({Op1VectorType}<{Op1BaseType}>* pClsVar1 = &_clsVar1) + fixed ({Op2VectorType}<{Op2BaseType}>* pClsVar2 = &_clsVar2) + { + {Isa}.{Method}( + ({Op1BaseType}*)_dataTable.outArrayPtr, + {LoadIsa}.Load{Op1VectorType}(({Op1BaseType}*)(pClsVar1)), + {LoadIsa}.Load{Op2VectorType}(({Op2BaseType}*)(pClsVar2)) + ); + + ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); + } + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read<{Op2VectorType}<{Op2BaseType}>>(_dataTable.inArray2Ptr); + {Isa}.{Method}(({RetBaseType}*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); + + var op1 = {LoadIsa}.Load{Op1VectorType}(({Op1BaseType}*)(_dataTable.inArray1Ptr)); + var op2 = {LoadIsa}.Load{Op2VectorType}(({Op2BaseType}*)(_dataTable.inArray2Ptr)); + {Isa}.{Method}(({RetBaseType}*)_dataTable.outArrayPtr, op1, op2); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); + + var test = new StoreBinaryOpTest__{TestName}(); + {Isa}.{Method}(({RetBaseType}*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunClassLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); + + var test = new StoreBinaryOpTest__{TestName}(); + + fixed ({Op1VectorType}<{Op1BaseType}>* pFld1 = &test._fld1) + fixed ({Op2VectorType}<{Op2BaseType}>* pFld2 = &test._fld2) + { + {Isa}.{Method}( + ({RetBaseType}*)_dataTable.outArrayPtr, + {LoadIsa}.Load{Op1VectorType}(({Op1BaseType}*)(pFld1)), + {LoadIsa}.Load{Op2VectorType}(({Op2BaseType}*)(pFld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + {Isa}.{Method}(({RetBaseType}*)_dataTable.outArrayPtr, _fld1, _fld2); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); + + fixed ({Op1VectorType}<{Op1BaseType}>* pFld1 = &_fld1) + fixed ({Op2VectorType}<{Op2BaseType}>* pFld2 = &_fld2) + { + {Isa}.{Method}( + ({RetBaseType}*)_dataTable.outArrayPtr, + {LoadIsa}.Load{Op1VectorType}(({Op1BaseType}*)(pFld1)), + {LoadIsa}.Load{Op2VectorType}(({Op2BaseType}*)(pFld2)) + ); + + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + {Isa}.{Method}(({RetBaseType}*)_dataTable.outArrayPtr, test._fld1, test._fld2); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); + + var test = TestStruct.Create(); + {Isa}.{Method}( + ({RetBaseType}*)_dataTable.outArrayPtr, + {LoadIsa}.Load{Op1VectorType}(({Op1BaseType}*)(&test._fld1)), + {LoadIsa}.Load{Op2VectorType}(({Op2BaseType}*)(&test._fld2)) + ); + + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunStructFldScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); + + var test = TestStruct.Create(); + test.RunStructFldScenario_Load(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult({Op1VectorType}<{Op1BaseType}> op1, {Op2VectorType}<{Op2BaseType}> op2, void* result, [CallerMemberName] string method = "") + { + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {Op2BaseType}[] inArray2 = new {Op2BaseType}[Op2ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf<{RetBaseType}>())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {Op2BaseType}[] inArray2 = new {Op2BaseType}[Op2ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)(RetElementCount * Unsafe.SizeOf<{RetBaseType}>())); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult({Op1BaseType}[] firstOp, {Op2BaseType}[] secondOp, {RetBaseType}[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (int i = 0; i < RetElementCount; i++) + { + if ({ValidateIterResult}) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_34587/Runtime_34587.cs b/src/tests/JIT/Regression/JitBlue/Runtime_34587/Runtime_34587.cs similarity index 92% rename from src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_34587/Runtime_34587.cs rename to src/tests/JIT/Regression/JitBlue/Runtime_34587/Runtime_34587.cs index 465557eac959..3b4898b3769f 100644 --- a/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_34587/Runtime_34587.cs +++ b/src/tests/JIT/Regression/JitBlue/Runtime_34587/Runtime_34587.cs @@ -30,6 +30,8 @@ private static bool ValidateArm() succeeded &= ValidateAdvSimd(); succeeded &= ValidateAes(); succeeded &= ValidateCrc32(); + succeeded &= ValidateDp(); + succeeded &= ValidateRdm(); succeeded &= ValidateSha1(); succeeded &= ValidateSha256(); @@ -107,6 +109,42 @@ static bool ValidateCrc32() return succeeded; } + static bool ValidateDp() + { + bool succeeded = true; + + if (Dp.IsSupported) + { + succeeded &= AdvSimd.IsSupported; + } + + if (Dp.Arm64.IsSupported) + { + succeeded &= Dp.IsSupported; + succeeded &= AdvSimd.Arm64.IsSupported; + } + + return succeeded; + } + + static bool ValidateRdm() + { + bool succeeded = true; + + if (Rdm.IsSupported) + { + succeeded &= AdvSimd.IsSupported; + } + + if (Rdm.Arm64.IsSupported) + { + succeeded &= Rdm.IsSupported; + succeeded &= AdvSimd.Arm64.IsSupported; + } + + return succeeded; + } + static bool ValidateSha1() { bool succeeded = true; diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_34587/Runtime_34587.csproj b/src/tests/JIT/Regression/JitBlue/Runtime_34587/Runtime_34587.csproj similarity index 100% rename from src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_34587/Runtime_34587.csproj rename to src/tests/JIT/Regression/JitBlue/Runtime_34587/Runtime_34587.csproj diff --git a/src/tests/JIT/Regression/JitBlue/WPF_3226/ILRepro/WPF_3226.il b/src/tests/JIT/Regression/JitBlue/WPF_3226/ILRepro/WPF_3226.il new file mode 100644 index 000000000000..d321fe5ae418 --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/WPF_3226/ILRepro/WPF_3226.il @@ -0,0 +1,94 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// The test was reproducing a JIT bug in `STORE_OBJ` logic when `src` was a small `FIELD` +// in a special format that could not have been transformed as `LCL_FLD` and survived global morph +// as `IND small type` instead of `IND dstType`. A lowering optimization was incorrectly read that +// field and extended it to `dstType` instead of reading the requested dst size starting from that field +// address. + + +.assembly extern mscorlib {} +.assembly extern System.Runtime {} +.assembly extern System.Runtime.Extensions {} +.assembly extern System.Diagnostics.Debug {} + +.assembly WPF_3226 {} + +// =============== CLASS MEMBERS DECLARATION =================== + +.class private auto ansi beforefieldinit Test + extends [System.Runtime]System.Object +{ + + // the struct needs many fields to prevent struct promotion. + .class sequential ansi sealed nested private beforefieldinit B + extends [System.Runtime]System.ValueType + { + .field public int8 a + .field public int8 b + .field public int8 c + .field public int8 d + .field public int8 e + .field public int8 f + .field public int8 g + .field public int8 h + } // end of class B + + .method public hidebysig static valuetype Test/B + CopyAStructUsingAddressOfASmallField(valuetype Test/B** s1) cil managed noinlining +{ + // Code size 14 (0xe) + .maxstack 10 + .locals init (valuetype Test/B V_0, + valuetype Test/B V_1) + IL_0000: nop + ldloca.s V_1 + IL_0001: ldarg.0 + ldind.i + IL_0026: ldflda int8 Test/B::a + IL_0028: ldc.i4.8 + cpblk + IL_000c: ldloc.1 + IL_000d: ret +} // end of method Test::CopyAStructUsingAddressOfASmallField + +.method public hidebysig static int32 Main() cil managed +{ + .entrypoint + // Code size 56 (0x38) + .maxstack 2 + .locals init (valuetype Test/B V_0, + valuetype Test/B* V_1, + valuetype Test/B** V_2, + valuetype Test/B V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldloca.s V_0 + IL_0003: initobj Test/B + IL_0009: ldloca.s V_0 + IL_000b: ldc.i4.2 + IL_000c: stfld int8 Test/B::b + IL_0011: ldloca.s V_0 + IL_0013: conv.u + IL_0014: stloc.1 + IL_0015: ldloca.s V_1 + IL_0017: conv.u + IL_0018: stloc.2 + IL_0019: ldloc.2 + IL_001a: call valuetype Test/B Test::CopyAStructUsingAddressOfASmallField(valuetype Test/B**) + IL_001f: stloc.3 + IL_0020: ldloc.3 + IL_0021: ldfld int8 Test/B::b + IL_0026: ldc.i4.2 + IL_0027: ceq + IL_0029: call void [System.Diagnostics.Debug]System.Diagnostics.Debug::Assert(bool) + IL_002e: nop + IL_002f: ldc.i4.s 100 + IL_0031: stloc.s V_4 + IL_0033: br.s IL_0035 + IL_0035: ldloc.s V_4 + IL_0037: ret +} // end of method Test::Main + +} // end of class Test diff --git a/src/tests/JIT/Regression/JitBlue/WPF_3226/ILRepro/WPF_3226.ilproj b/src/tests/JIT/Regression/JitBlue/WPF_3226/ILRepro/WPF_3226.ilproj new file mode 100644 index 000000000000..e7c67cc80e85 --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/WPF_3226/ILRepro/WPF_3226.ilproj @@ -0,0 +1,12 @@ + + + Exe + + + None + True + + + + + diff --git a/src/tests/baseservices/callconvs/CallFunctionPointers.il b/src/tests/baseservices/callconvs/CallFunctionPointers.il index 2f46bbab6334..8fb05ff4a9fa 100644 --- a/src/tests/baseservices/callconvs/CallFunctionPointers.il +++ b/src/tests/baseservices/callconvs/CallFunctionPointers.il @@ -48,6 +48,69 @@ ret } + .method public hidebysig static int32 CallUnmanagedIntInt_ModOptCdecl(void* p, int32 b) cil managed + { + .maxstack 2 + ldarg.1 + ldarg.0 + calli unmanaged int32 modopt([System.Runtime]System.Runtime.CompilerServices.CallConvCdecl) (int32) + ret + } + + .method public hidebysig static int32 CallUnmanagedIntInt_ModOptStdcall(void* p, int32 b) cil managed + { + .maxstack 2 + ldarg.1 + ldarg.0 + calli unmanaged int32 modopt([System.Runtime]System.Runtime.CompilerServices.CallConvStdcall) (int32) + ret + } + + .method public hidebysig static int32 CallUnmanagedIntInt_ModOptUnknown(void* p, int32 b) cil managed + { + .maxstack 2 + ldarg.1 + ldarg.0 + calli unmanaged int32 modopt([System.Runtime]System.Runtime.CompilerServices.RuntimeFeature) (int32) + ret + } + + .method public hidebysig static int32 CallUnmanagedIntInt_ModOptStdcall_ModOptCdecl(void* p, int32 b) cil managed + { + .maxstack 2 + ldarg.1 + ldarg.0 + calli unmanaged int32 modopt([System.Runtime]System.Runtime.CompilerServices.CallConvStdcall) modopt([System.Runtime]System.Runtime.CompilerServices.CallConvCdecl) (int32) + ret + } + + .method public hidebysig static int32 CallUnmanagedIntInt_ModOptStdcall_ModOptUnknown(void* p, int32 b) cil managed + { + .maxstack 2 + ldarg.1 + ldarg.0 + calli unmanaged int32 modopt([System.Runtime]System.Runtime.CompilerServices.CallConvStdcall) modopt([System.Runtime]System.Runtime.CompilerServices.RuntimeFeature) (int32) + ret + } + + .method public hidebysig static int32 CallUnmanagedCdeclIntInt_ModOptStdcall(void* p, int32 b) cil managed + { + .maxstack 2 + ldarg.1 + ldarg.0 + calli unmanaged cdecl int32 modopt([System.Runtime]System.Runtime.CompilerServices.CallConvStdcall) (int32) + ret + } + + .method public hidebysig static int32 CallUnmanagedStdcallIntInt_ModOptCdecl(void* p, int32 b) cil managed + { + .maxstack 2 + ldarg.1 + ldarg.0 + calli unmanaged stdcall int32 modopt([System.Runtime]System.Runtime.CompilerServices.CallConvCdecl) (int32) + ret + } + .method public hidebysig static char CallUnmanagedCharChar(void* p, char b) cil managed { .maxstack 2 @@ -74,4 +137,67 @@ calli unmanaged stdcall char(char) ret } + + .method public hidebysig static char CallUnmanagedCharChar_ModOptCdecl(void* p, char b) cil managed + { + .maxstack 2 + ldarg.1 + ldarg.0 + calli unmanaged char modopt([System.Runtime]System.Runtime.CompilerServices.CallConvCdecl) (char) + ret + } + + .method public hidebysig static char CallUnmanagedCharChar_ModOptStdcall(void* p, char b) cil managed + { + .maxstack 2 + ldarg.1 + ldarg.0 + calli unmanaged char modopt([System.Runtime]System.Runtime.CompilerServices.CallConvStdcall) (char) + ret + } + + .method public hidebysig static char CallUnmanagedCharChar_ModOptUnknown(void* p, char b) cil managed + { + .maxstack 2 + ldarg.1 + ldarg.0 + calli unmanaged char modopt([System.Runtime]System.Runtime.CompilerServices.RuntimeFeature) (char) + ret + } + + .method public hidebysig static char CallUnmanagedCharChar_ModOptStdcall_ModOptCdecl(void* p, char b) cil managed + { + .maxstack 2 + ldarg.1 + ldarg.0 + calli unmanaged char modopt([System.Runtime]System.Runtime.CompilerServices.CallConvStdcall) modopt([System.Runtime]System.Runtime.CompilerServices.CallConvCdecl) (char) + ret + } + + .method public hidebysig static char CallUnmanagedCharChar_ModOptStdcall_ModOptUnknown(void* p, char b) cil managed + { + .maxstack 2 + ldarg.1 + ldarg.0 + calli unmanaged char modopt([System.Runtime]System.Runtime.CompilerServices.CallConvStdcall) modopt([System.Runtime]System.Runtime.CompilerServices.RuntimeFeature) (char) + ret + } + + .method public hidebysig static char CallUnmanagedCdeclCharChar_ModOptStdcall(void* p, char b) cil managed + { + .maxstack 2 + ldarg.1 + ldarg.0 + calli unmanaged cdecl char modopt([System.Runtime]System.Runtime.CompilerServices.CallConvStdcall) (char) + ret + } + + .method public hidebysig static char CallUnmanagedStdcallCharChar_ModOptCdecl(void* p, char b) cil managed + { + .maxstack 2 + ldarg.1 + ldarg.0 + calli unmanaged stdcall char modopt([System.Runtime]System.Runtime.CompilerServices.CallConvCdecl) (char) + ret + } } diff --git a/src/tests/baseservices/callconvs/TestCallingConventions.cs b/src/tests/baseservices/callconvs/TestCallingConventions.cs index 38c4a1b48b81..935e4016d20f 100644 --- a/src/tests/baseservices/callconvs/TestCallingConventions.cs +++ b/src/tests/baseservices/callconvs/TestCallingConventions.cs @@ -41,24 +41,74 @@ static void BlittableFunctionPointers() Console.WriteLine($"Running {nameof(BlittableFunctionPointers)}..."); IntPtr mod = NativeLibrary.Load(NativeFunctions.GetFullPath()); + var cbDefault = NativeLibrary.GetExport(mod, "DoubleInt").ToPointer(); + var cbCdecl = NativeLibrary.GetExport(mod, "DoubleIntCdecl").ToPointer(); + var cbStdcall = NativeLibrary.GetExport(mod, "DoubleIntStdcall").ToPointer(); const int a = 7; const int expected = a * 2; + + { + // No modopt + Console.WriteLine($" -- unmanaged"); + int b = CallFunctionPointers.CallUnmanagedIntInt(cbDefault, a); + Assert.AreEqual(expected, b); + } + + { + Console.WriteLine($" -- unmanaged cdecl"); + int b = CallFunctionPointers.CallUnmanagedCdeclIntInt(cbCdecl, a); + Assert.AreEqual(expected, b); + } + + { + Console.WriteLine($" -- unmanaged stdcall"); + int b = CallFunctionPointers.CallUnmanagedStdcallIntInt(cbStdcall, a); + Assert.AreEqual(expected, b); + } + + { + Console.WriteLine($" -- unmanaged modopt(cdecl)"); + int b = CallFunctionPointers.CallUnmanagedIntInt_ModOptCdecl(cbCdecl, a); + Assert.AreEqual(expected, b); + } + + { + Console.WriteLine($" -- unmanaged modopt(stdcall)"); + int b = CallFunctionPointers.CallUnmanagedIntInt_ModOptStdcall(cbStdcall, a); + Assert.AreEqual(expected, b); + } + + { + // Value in modopt is not a recognized calling convention + Console.WriteLine($" -- unmanaged modopt unrecognized"); + int b = CallFunctionPointers.CallUnmanagedIntInt_ModOptUnknown(cbDefault, a); + Assert.AreEqual(expected, b); + } + + { + // Multiple modopts with calling conventions + Console.WriteLine($" -- unmanaged modopt(stdcall) modopt(cdecl)"); + int b = CallFunctionPointers.CallUnmanagedIntInt_ModOptStdcall_ModOptCdecl(cbCdecl, a); + Assert.AreEqual(expected, b); + } + { - var cb = NativeLibrary.GetExport(mod, "DoubleInt").ToPointer(); - Assert.Throws(() => CallFunctionPointers.CallUnmanagedIntInt(cb, a)); + Console.WriteLine($" -- unmanaged modopt(stdcall) modopt(unrecognized)"); + int b = CallFunctionPointers.CallUnmanagedIntInt_ModOptStdcall_ModOptUnknown(cbStdcall, a); + Assert.AreEqual(expected, b); } { - var cb = NativeLibrary.GetExport(mod, "DoubleIntCdecl").ToPointer(); - int b = CallFunctionPointers.CallUnmanagedCdeclIntInt(cb, a); - Assert.AreEqual(b, expected); + Console.WriteLine($" -- unmanaged cdecl modopt(stdcall)"); + int b = CallFunctionPointers.CallUnmanagedCdeclIntInt_ModOptStdcall(cbCdecl, a); + Assert.AreEqual(expected, b); } { - var cb = NativeLibrary.GetExport(mod, "DoubleIntStdcall").ToPointer(); - int b = CallFunctionPointers.CallUnmanagedStdcallIntInt(cb, a); - Assert.AreEqual(b, expected); + Console.WriteLine($" -- unmanaged stdcall modopt(cdecl)"); + int b = CallFunctionPointers.CallUnmanagedStdcallIntInt_ModOptCdecl(cbStdcall, a); + Assert.AreEqual(expected, b); } } @@ -67,24 +117,74 @@ static void NonblittableFunctionPointers() Console.WriteLine($"Running {nameof(NonblittableFunctionPointers)}..."); IntPtr mod = NativeLibrary.Load(NativeFunctions.GetFullPath()); + var cbDefault = NativeLibrary.GetExport(mod, "ToUpper").ToPointer(); + var cbCdecl = NativeLibrary.GetExport(mod, "ToUpperCdecl").ToPointer(); + var cbStdcall = NativeLibrary.GetExport(mod, "ToUpperStdcall").ToPointer(); const char a = 'i'; const char expected = 'I'; + + { + // No modopt + Console.WriteLine($" -- unmanaged"); + var b = CallFunctionPointers.CallUnmanagedCharChar(cbDefault, a); + Assert.AreEqual(expected, b); + } + + { + Console.WriteLine($" -- unmanaged cdecl"); + var b = CallFunctionPointers.CallUnmanagedCdeclCharChar(cbCdecl, a); + Assert.AreEqual(expected, b); + } + + { + Console.WriteLine($" -- unmanaged stdcall"); + var b = CallFunctionPointers.CallUnmanagedStdcallCharChar(cbStdcall, a); + Assert.AreEqual(expected, b); + } + + { + Console.WriteLine($" -- unmanaged modopt(cdecl)"); + var b = CallFunctionPointers.CallUnmanagedCharChar_ModOptCdecl(cbCdecl, a); + Assert.AreEqual(expected, b); + } + + { + Console.WriteLine($" -- unmanaged modopt(stdcall)"); + var b = CallFunctionPointers.CallUnmanagedCharChar_ModOptStdcall(cbStdcall, a); + Assert.AreEqual(expected, b); + } + + { + // Value in modopt is not a recognized calling convention + Console.WriteLine($" -- unmanaged modopt(unrecognized)"); + var b = CallFunctionPointers.CallUnmanagedCharChar_ModOptUnknown(cbDefault, a); + Assert.AreEqual(expected, b); + } + + { + // Multiple modopts with calling conventions + Console.WriteLine($" -- unmanaged modopt(stdcall) modopt(cdecl)"); + var b = CallFunctionPointers.CallUnmanagedCharChar_ModOptStdcall_ModOptCdecl(cbCdecl, a); + Assert.AreEqual(expected, b); + } + { - var cb = NativeLibrary.GetExport(mod, "ToUpper").ToPointer(); - Assert.Throws(() => CallFunctionPointers.CallUnmanagedCharChar(cb, a)); + Console.WriteLine($" -- unmanaged modopt(stdcall) modopt(unrecognized)"); + var b = CallFunctionPointers.CallUnmanagedCharChar_ModOptStdcall_ModOptUnknown(cbStdcall, a); + Assert.AreEqual(expected, b); } { - var cb = NativeLibrary.GetExport(mod, "ToUpperCdecl").ToPointer(); - var b = CallFunctionPointers.CallUnmanagedCdeclCharChar(cb, a); - Assert.AreEqual(b, expected); + Console.WriteLine($" -- unmanaged cdecl modopt(stdcall)"); + var b = CallFunctionPointers.CallUnmanagedCdeclCharChar_ModOptStdcall(cbCdecl, a); + Assert.AreEqual(expected, b); } { - var cb = NativeLibrary.GetExport(mod, "ToUpperStdcall").ToPointer(); - var b = CallFunctionPointers.CallUnmanagedStdcallCharChar(cb, a); - Assert.AreEqual(b, expected); + Console.WriteLine($" -- unmanaged stdcall modopt(cdecl)"); + var b = CallFunctionPointers.CallUnmanagedStdcallCharChar_ModOptCdecl(cbStdcall, a); + Assert.AreEqual(expected, b); } } diff --git a/src/tests/ilasm/PortablePdb/IlasmPortablePdbTester.cs b/src/tests/ilasm/PortablePdb/IlasmPortablePdbTester.cs new file mode 100644 index 000000000000..4c996a433719 --- /dev/null +++ b/src/tests/ilasm/PortablePdb/IlasmPortablePdbTester.cs @@ -0,0 +1,252 @@ +using System; +using System.IO; +using System.Runtime.InteropServices; +using System.Reflection.PortableExecutable; +using System.Linq; +using Xunit; +using System.Collections.Generic; +using System.Reflection.Metadata; + +namespace IlasmPortablePdbTests +{ + public class IlasmPortablePdbTester : XunitBase + { + private const string CoreRoot = "CORE_ROOT"; + private const string IlasmFileName = "ilasm"; + private const string TestDir = "TestFiles"; + public string CoreRootVar { get; private set; } + public bool IsUnix { get; private set; } + public string NativeExtension { get; private set; } + public string IlasmFile { get; private set; } + + public IlasmPortablePdbTester() + { + CoreRootVar = Environment.GetEnvironmentVariable(CoreRoot); + IsUnix = !RuntimeInformation.IsOSPlatform(OSPlatform.Windows); + NativeExtension = IsUnix ? string.Empty : ".exe"; + IlasmFile = IlasmFileName + NativeExtension; + } + + // Tests whether pe file includes portable pdb codeview debug directory + // and its contents against the generated portable pdb metadata file + [Theory] + [InlineData("TestPdbDebugDirectory1.il")] + [InlineData("TestPdbDebugDirectory2.il")] + public void TestPortablePdbDebugDirectory(string ilSource) + { + var ilasm = IlasmPortablePdbTesterCommon.GetIlasmFullPath(CoreRootVar, IlasmFile); + IlasmPortablePdbTesterCommon.Assemble(ilasm, ilSource, TestDir, out string dll, out string pdb); + + using (var peStream = new FileStream(dll, FileMode.Open, FileAccess.Read)) + { + using (var peReader = new PEReader(peStream)) + { + var dbgDirEntries = peReader.ReadDebugDirectory(); + Assert.False(dbgDirEntries.IsEmpty); + + var dbgEntry = dbgDirEntries.FirstOrDefault(dbgEntry => dbgEntry.IsPortableCodeView); + Assert.True(dbgEntry.DataSize > 0); + + var portablePdbDbgEntry = peReader.ReadCodeViewDebugDirectoryData(dbgEntry); + Assert.Equal(1, portablePdbDbgEntry.Age); + Assert.Equal(pdb, portablePdbDbgEntry.Path); + + using (var pdbReaderProvider = IlasmPortablePdbTesterCommon.GetMetadataReaderProvider(dll, pdb, peReader, false)) + { + var portablePdbMdReader = pdbReaderProvider.GetMetadataReader(); + Assert.NotNull(portablePdbMdReader); + // check pdb stream + Assert.NotNull(portablePdbMdReader.DebugMetadataHeader); + // check pdb guid + var pdbGuid = portablePdbDbgEntry.Guid.ToByteArray(); + var pdbId = portablePdbMdReader.DebugMetadataHeader.Id.ToArray(); + int i = 0; + foreach (var pdbGuidByte in pdbGuid) + { + Assert.True(i < pdbId.Length); + Assert.Equal(pdbGuidByte, pdbId[i++]); + } + Assert.Equal(i, pdbGuid.Length); + var peMdReader = peReader.GetMetadataReader(); + Assert.NotNull(peMdReader); + + // check entry point if exists + if (!portablePdbMdReader.DebugMetadataHeader.EntryPoint.IsNil) + { + var method = peMdReader.GetMethodDefinition(portablePdbMdReader.DebugMetadataHeader.EntryPoint); + var methodName = peMdReader.GetString(method.Name); + Assert.Equal("Main", methodName); + } + } + } + } + } + + // Tests whether the portable PDB has all document name properly defined + // The test source file includes external source reference and thus has 2 variants depending on OS type + [Fact] + public void TestPortablePdbDocuments() + { + var ilSource = IsUnix ? "TestDocuments1_unix.il" : "TestDocuments1_win.il"; + + var expected = IlasmPortablePdbTesterCommon.GetExpectedDocuments(ilSource, TestDir); + var ilasm = IlasmPortablePdbTesterCommon.GetIlasmFullPath(CoreRootVar, IlasmFile); + IlasmPortablePdbTesterCommon.Assemble(ilasm, ilSource, TestDir, out string dll, out string pdb); + + using (var peStream = new FileStream(dll, FileMode.Open, FileAccess.Read)) + { + using (var peReader = new PEReader(peStream)) + { + using (var pdbReaderProvider = IlasmPortablePdbTesterCommon.GetMetadataReaderProvider(dll, pdb, peReader, false)) + { + var portablePdbMdReader = pdbReaderProvider.GetMetadataReader(); + Assert.NotNull(portablePdbMdReader); + Assert.Equal(expected.Count, portablePdbMdReader.Documents.Count); + + int i = 0; + foreach (var documentHandle in portablePdbMdReader.Documents) + { + Assert.True(i < expected.Count); + var document = portablePdbMdReader.GetDocument(documentHandle); + var name = portablePdbMdReader.GetString(document.Name); + Assert.Equal(expected[i].Name, name); + i++; + } + Assert.Equal(expected.Count, i); + } + } + } + } + + // Tests whether the portable PDB has appropriate sequence points defined + // The test source file includes external source reference and thus has 2 variants depending on OS type + [Fact] + public void TestPortablePdbMethodDebugInformation() + { + var ilSource = IsUnix ? "TestMethodDebugInformation_unix.il" : "TestMethodDebugInformation_win.il"; + + var expected = IlasmPortablePdbTesterCommon.GetExpectedForTestMethodDebugInformation(ilSource); + var ilasm = IlasmPortablePdbTesterCommon.GetIlasmFullPath(CoreRootVar, IlasmFile); + IlasmPortablePdbTesterCommon.Assemble(ilasm, ilSource, TestDir, out string dll, out string pdb); + + using (var peStream = new FileStream(dll, FileMode.Open, FileAccess.Read)) + { + using (var peReader = new PEReader(peStream)) + { + var peMdReader = peReader.GetMetadataReader(); + Assert.NotNull(peMdReader); + using (var pdbReaderProvider = IlasmPortablePdbTesterCommon.GetMetadataReaderProvider(dll, pdb, peReader, false)) + { + var portablePdbMdReader = pdbReaderProvider.GetMetadataReader(); + Assert.NotNull(portablePdbMdReader); + + foreach (var methodDefinitionHandle in peMdReader.MethodDefinitions) + { + // get method definition from pe file metadata + var methodDefinition = peMdReader.GetMethodDefinition(methodDefinitionHandle); + var methodName = peMdReader.GetString(methodDefinition.Name); + Assert.True(expected.TryGetValue(methodName, out var expectedMethodDbgInfo)); + + // verify method debug information from portable pdb metadata + var methodDebugInformation = portablePdbMdReader.GetMethodDebugInformation(methodDefinitionHandle); + var methodDocument = portablePdbMdReader.GetDocument(methodDebugInformation.Document); + var methodDocumentName = portablePdbMdReader.GetString(methodDocument.Name); + Assert.Equal(expectedMethodDbgInfo.Document.Name, methodDocumentName); + + int i = 0; + foreach (var sequencePoint in methodDebugInformation.GetSequencePoints()) + { + var sequencePointDocument = portablePdbMdReader.GetDocument(sequencePoint.Document); + var sequencePointDocumentName = portablePdbMdReader.GetString(sequencePointDocument.Name); + + Assert.True(i < expectedMethodDbgInfo.SequencePoints.Count); + Assert.Equal(expectedMethodDbgInfo.SequencePoints[i].Document.Name, sequencePointDocumentName); + Assert.Equal(expectedMethodDbgInfo.SequencePoints[i].IsHidden, sequencePoint.IsHidden); + Assert.Equal(expectedMethodDbgInfo.SequencePoints[i].Offset, sequencePoint.Offset); + Assert.Equal(expectedMethodDbgInfo.SequencePoints[i].StartLine, sequencePoint.StartLine); + Assert.Equal(expectedMethodDbgInfo.SequencePoints[i].EndLine, sequencePoint.EndLine); + Assert.Equal(expectedMethodDbgInfo.SequencePoints[i].StartColumn, sequencePoint.StartColumn); + Assert.Equal(expectedMethodDbgInfo.SequencePoints[i].EndColumn, sequencePoint.EndColumn); + i++; + } + Assert.Equal(expectedMethodDbgInfo.SequencePoints.Count, i); + } + + } + } + } + } + + // Tests whether the portable PDB has appropriate local scopes defined + [Theory] + [InlineData("TestLocalScopes1.il")] + [InlineData("TestLocalScopes2.il")] + [InlineData("TestLocalScopes3.il")] + [InlineData("TestLocalScopes4.il")] + public void TestPortablePdbLocalScope(string ilSource) + { + var expected = IlasmPortablePdbTesterCommon.GetExpectedForTestLocalScopes(ilSource); + var ilasm = IlasmPortablePdbTesterCommon.GetIlasmFullPath(CoreRootVar, IlasmFile); + IlasmPortablePdbTesterCommon.Assemble(ilasm, ilSource, TestDir, out string dll, out string pdb); + + using (var peStream = new FileStream(dll, FileMode.Open, FileAccess.Read)) + { + using (var peReader = new PEReader(peStream)) + { + var peMdReader = peReader.GetMetadataReader(); + Assert.NotNull(peMdReader); + using (var pdbReaderProvider = IlasmPortablePdbTesterCommon.GetMetadataReaderProvider(dll, pdb, peReader, false)) + { + var portablePdbMdReader = pdbReaderProvider.GetMetadataReader(); + Assert.NotNull(portablePdbMdReader); + + foreach (var methodDefinitionHandle in peMdReader.MethodDefinitions) + { + // get method definition from pe file metadata + var methodDefinition = peMdReader.GetMethodDefinition(methodDefinitionHandle); + var methodName = peMdReader.GetString(methodDefinition.Name); + + // verify local scopes from portable pdb metadata + var localScopeHandles = portablePdbMdReader.GetLocalScopes(methodDefinitionHandle); + + int i = 0; + foreach (var localScopeHandle in localScopeHandles) + { + Assert.True(i < expected.Count); + Assert.Equal(expected[i].MethodName, methodName); + + var localScope = portablePdbMdReader.GetLocalScope(localScopeHandle); + Assert.Equal(expected[i].StartOffset, localScope.StartOffset); + Assert.Equal(expected[i].EndOffset, localScope.EndOffset); + Assert.Equal(expected[i].Length, localScope.Length); + var variableHandles = localScope.GetLocalVariables(); + Assert.Equal(expected[i].Variables.Count, variableHandles.Count); + + int j = 0; + foreach (var variableHandle in localScope.GetLocalVariables()) + { + Assert.True(j < expected[i].Variables.Count); + var variable = portablePdbMdReader.GetLocalVariable(variableHandle); + var variableName = portablePdbMdReader.GetString(variable.Name); + Assert.Equal(expected[i].Variables[j].Name, variableName); + Assert.Equal(expected[i].Variables[j].Index, variable.Index); + Assert.Equal(expected[i].Variables[j].IsDebuggerHidden, + variable.Attributes == LocalVariableAttributes.DebuggerHidden); + j++; + } + Assert.Equal(expected[i].Variables.Count, j); + i++; + } + Assert.Equal(expected.Count, i); + } + } + } + } + } + + public static int Main(string[] args) + { + return new IlasmPortablePdbTester().RunTests(); + } + } +} diff --git a/src/tests/ilasm/PortablePdb/IlasmPortablePdbTesterCommon.cs b/src/tests/ilasm/PortablePdb/IlasmPortablePdbTesterCommon.cs new file mode 100644 index 000000000000..3aeb9213dec5 --- /dev/null +++ b/src/tests/ilasm/PortablePdb/IlasmPortablePdbTesterCommon.cs @@ -0,0 +1,247 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Reflection.Metadata; +using System.Reflection.PortableExecutable; +using Xunit; + +namespace IlasmPortablePdbTests +{ + public static class IlasmPortablePdbTesterCommon + { + public const string CommonIlasmArguments = "-nologo -dll -debug -pdbfmt=portable"; + + public static string GetIlasmFullPath(string coreRootVar, string ilasmFile) + { + Assert.True(!string.IsNullOrWhiteSpace(coreRootVar)); + Assert.True(Directory.Exists(coreRootVar)); + var ilasmFullPath = Path.Combine(coreRootVar, ilasmFile); + Assert.True(File.Exists(ilasmFullPath)); + return ilasmFullPath; + } + + public static void Assemble(string ilasmFullPath, string ilSrc, string testDir, out string dll, out string pdb) + { + var currentDirectory = Environment.CurrentDirectory; + var ilSrcFullPath = Path.Combine(currentDirectory, testDir, ilSrc); + Assert.True(File.Exists(ilSrcFullPath)); + + var dllFileName = $"{Path.GetFileNameWithoutExtension(ilSrc)}.dll"; + var pdbFileName = $"{Path.GetFileNameWithoutExtension(ilSrc)}.pdb"; + + var dllFullPath = Path.Combine(currentDirectory, testDir, dllFileName); + var pdbFullPath = Path.Combine(currentDirectory, testDir, pdbFileName); + + var ilasmArgs = $"{CommonIlasmArguments} -output={dllFullPath} {ilSrcFullPath}"; + var ilasmPsi = new ProcessStartInfo + { + UseShellExecute = false, + WorkingDirectory = currentDirectory, + FileName = ilasmFullPath, + Arguments = ilasmArgs + }; + + Process ilasmProcess = Process.Start(ilasmPsi); + ilasmProcess.WaitForExit(); + + Assert.Equal(0, ilasmProcess.ExitCode); + Assert.True(File.Exists(dllFullPath)); + Assert.True(File.Exists(pdbFullPath)); + + dll = dllFullPath; + pdb = pdbFullPath; + } + + public static MetadataReaderProvider GetMetadataReaderProvider(string dll, string pdb, PEReader peReader, bool embedded) + { + Assert.True(peReader.TryOpenAssociatedPortablePdb( + dll, + filePath => File.OpenRead(filePath), + out var pdbReaderProvider, + out var foundPdbPath)); + + Assert.NotNull(pdbReaderProvider); + if (!embedded) + Assert.Equal(pdb, foundPdbPath); + else + Assert.Null(foundPdbPath); + + return pdbReaderProvider; + } + + public static List GetExpectedDocuments(string testName, string testDir) + { + switch (testName) + { + case "TestDocuments1_win.il": + return new List() + { + new DocumentStub(Path.Combine(Environment.CurrentDirectory, testDir, testName)), + new DocumentStub("C:\\tmp\\non_existent_source1.cs"), + new DocumentStub("C:\\tmp\\non_existent_source2.cs") + }; + case "TestDocuments1_unix.il": + return new List() + { + new DocumentStub(Path.Combine(Environment.CurrentDirectory, testDir, testName)), + new DocumentStub("/tmp/non_existent_source1.cs"), + new DocumentStub("/tmp/non_existent_source2.cs"), + }; + default: + Assert.False(true); + return null; + } + } + + public static Dictionary GetExpectedForTestMethodDebugInformation(string testName) + { + string method1; + string method2; + DocumentStub document1; + DocumentStub document2; + + switch (testName) + { + case "TestMethodDebugInformation_unix.il": + method1 = ".ctor"; + method2 = "Pow"; + document1 = new DocumentStub("/tmp/TestMethodDebugInformation/SimpleMath.cs"); + document2 = new DocumentStub("/tmp/TestMethodDebugInformation/SimpleMathMethods.cs"); + break; + case "TestMethodDebugInformation_win.il": + method1 = ".ctor"; + method2 = "Pow"; + document1 = new DocumentStub("C:\\tmp\\TestMethodDebugInformation\\SimpleMath.cs"); + document2 = new DocumentStub("C:\\tmp\\TestMethodDebugInformation\\SimpleMathMethods.cs"); + break; + default: + Assert.False(true); + return null; + } + + return new Dictionary() + { + { + method1, + new MethodDebugInformationStub(method1, document1, + new List() + { + new SequencePointStub(document1, false, 0x0, 6, 6, 9, 37), + new SequencePointStub(document1, false, 0x7, 7, 7, 9, 10), + new SequencePointStub(document1, false, 0x8, 8, 8, 13, 28), + new SequencePointStub(document1, false, 0xf, 9, 9, 9, 10), + }) + }, + { + method2, + new MethodDebugInformationStub(method2, document2, + new List() + { + new SequencePointStub(document2, false, 0x0, 6, 6, 9, 10), + new SequencePointStub(document2, false, 0x1, 7, 7, 13, 23), + new SequencePointStub(document2, false, 0x3, 8, 8, 13, 23), + new SequencePointStub(document2, false, 0x5, 9, 9, 13, 25), + new SequencePointStub(document2, false, 0x7, 10, 10, 18, 23), + new SequencePointStub(document2, true, 0x9), + new SequencePointStub(document2, false, 0xb, 11, 11, 13, 14), + new SequencePointStub(document2, false, 0xc, 12, 12, 17, 26), + new SequencePointStub(document2, false, 0x10, 13, 13, 17, 21), + new SequencePointStub(document2, false, 0x14, 14, 14, 13, 14), + new SequencePointStub(document2, false, 0x15, 10, 10, 32, 35), + new SequencePointStub(document2, false, 0x19, 10, 10, 25, 30), + new SequencePointStub(document2, true, 0x1e), + new SequencePointStub(document2, false, 0x21, 15, 15, 13, 24), + new SequencePointStub(document2, false, 0x26, 16, 16, 9, 10), + }) + } + }; + } + + public static List GetExpectedForTestLocalScopes(string testName) + { + switch (testName) + { + case "TestLocalScopes1.il": + return new List() + { + new LocalScopeStub("Foo", 0x0, 0x19, 0x19, + new List() + { + new VariableStub("LOCAL_0", 0), + }), + + new LocalScopeStub("Foo", 0x6, 0x14, 0xe, + new List() + { + new VariableStub("LOCAL_1", 1), + new VariableStub("LOCAL_2", 2) + }) + }; + case "TestLocalScopes2.il": + return new List() + { + new LocalScopeStub("Foo", 0x0, 0x20, 0x20, + new List() + { + new VariableStub("LOCAL_0", 0), + }), + + new LocalScopeStub("Foo", 0x6, 0x14, 0xe, + new List() + { + new VariableStub("LOCAL_1", 1), + new VariableStub("LOCAL_2", 2) + }) + }; + case "TestLocalScopes3.il": + return new List() + { + new LocalScopeStub("Foo", 0x9, 0x1f, 0x16, + new List() + { + new VariableStub("LOCAL_0", 0), + new VariableStub("LOCAL_1", 1) + }) + }; + case "TestLocalScopes4.il": + return new List() + { + new LocalScopeStub("Foo", 0x0, 0x24, 0x24, + new List() + { + new VariableStub("LOCAL_0", 0), + }), + + new LocalScopeStub("Foo", 0x6, 0x1f, 0x19, + new List() + { + new VariableStub("LOCAL_11", 1), + new VariableStub("LOCAL_12", 3) + }), + + new LocalScopeStub("Foo", 0xb, 0x15, 0xa, + new List() + { + new VariableStub("LOCAL_2", 2) + }), + + new LocalScopeStub("Foo", 0x10, 0x15, 0x5, + new List() + { + new VariableStub("LOCAL_3", 3) + }), + + new LocalScopeStub("Foo", 0x16, 0x1b, 0x5, + new List() + { + new VariableStub("LOCAL_4", 4) + }) + }; + default: + Assert.False(true); + return null; + } + } + } +} diff --git a/src/tests/ilasm/PortablePdb/IlasmPortablePdbTesterTypes.cs b/src/tests/ilasm/PortablePdb/IlasmPortablePdbTesterTypes.cs new file mode 100644 index 000000000000..35c76ffd5076 --- /dev/null +++ b/src/tests/ilasm/PortablePdb/IlasmPortablePdbTesterTypes.cs @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; +using System.Reflection.Metadata; +using System.Text; + +namespace IlasmPortablePdbTests +{ + public class DocumentStub + { + public string Name { get; set; } + public Guid HashAlgorithm { get; set; } + public byte[] Hash { get; set; } + public Guid Language { get; set; } + public DocumentStub(string name) + { + Name = name; + } + } + + public class SequencePointStub + { + public DocumentStub Document { get; set; } + public int EndColumn { get; set; } + public int EndLine { get; set; } + public bool IsHidden { get; set; } + public int Offset { get; set; } + public int StartColumn { get; set; } + public int StartLine { get; set; } + + public SequencePointStub(DocumentStub document, + bool isHidden = true, + int offset = 0, + int startLine = SequencePoint.HiddenLine, + int endLine = SequencePoint.HiddenLine, + int startCol = 0, + int endCol = 0) + { + Document = document; + StartLine = startLine; + EndLine = endLine; + StartColumn = startCol; + EndColumn = endCol; + IsHidden = isHidden; + Offset = offset; + } + } + + public class MethodDebugInformationStub + { + public string Name { get; set; } + public DocumentStub Document { get; set; } + public List SequencePoints { get; set; } + public MethodDebugInformationStub(string name, DocumentStub document, List sequencePoints = null) + { + Name = name; + Document = document; + SequencePoints = sequencePoints ?? new List(); + } + } + + public class VariableStub + { + public string Name { get; set; } + public int Index { get; set; } + public bool IsDebuggerHidden { get; set; } + public VariableStub(string name, int index, bool isDebuggerHidden = false) + { + Name = name; + Index = index; + IsDebuggerHidden = isDebuggerHidden; + } + } + + public class LocalScopeStub + { + public string MethodName { get; set; } + public int StartOffset { get; set; } + public int EndOffset { get; set; } + public int Length { get; set; } + public List Variables { get; set; } + public LocalScopeStub(string methodName, int startOffset, int endOffset, int length, List variables = null) + { + MethodName = methodName; + StartOffset = startOffset; + EndOffset = endOffset; + Length = length; + Variables = variables ?? new List(); + } + } +} diff --git a/src/tests/ilasm/PortablePdb/IlasmPortablePdbTests.csproj b/src/tests/ilasm/PortablePdb/IlasmPortablePdbTests.csproj new file mode 100644 index 000000000000..f339d73be035 --- /dev/null +++ b/src/tests/ilasm/PortablePdb/IlasmPortablePdbTests.csproj @@ -0,0 +1,51 @@ + + + Exe + + + + + + + + + + + + + + + + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + diff --git a/src/tests/ilasm/PortablePdb/Resources/README.txt b/src/tests/ilasm/PortablePdb/Resources/README.txt new file mode 100644 index 000000000000..760e0a2a8ff8 --- /dev/null +++ b/src/tests/ilasm/PortablePdb/Resources/README.txt @@ -0,0 +1,14 @@ +In order to verify whether ilasm produces correct portable pdb format one can do the following: + +1. Copy 'TestMethodDebugInformation' directory wiht its contents to: + - WINDOWS: C:\\tmp\\ + - LINUX: /tmp/ +2. Run IlasmPortablePdb tests which reference .cs source files from 'TestMethodDebugInformation': + .\..\TestFiles\TestMethodDebugInformation_*.il +3. On successful complition load the generated dlls from tests output directory: + TestMethodDebugInformation_*.dll + TestMethodDebugInformation_*.pdb + with a debugger and step through the .cs code to verify correctness of the portable PDB format + +NOTE: this should work only if 'TestMethodDebugInformation' directory is properly placed in paths +specified in 1. \ No newline at end of file diff --git a/src/tests/ilasm/PortablePdb/Resources/TestMethodDebugInformation/SimpleMath.cs b/src/tests/ilasm/PortablePdb/Resources/TestMethodDebugInformation/SimpleMath.cs new file mode 100644 index 000000000000..dc8766b33fa0 --- /dev/null +++ b/src/tests/ilasm/PortablePdb/Resources/TestMethodDebugInformation/SimpleMath.cs @@ -0,0 +1,11 @@ +namespace TestMethodDebugInformation +{ + public partial class SimpleMath + { + private int _dummy; + public SimpleMath(int dummy) + { + _dummy = dummy; + } + } +} diff --git a/src/tests/ilasm/PortablePdb/Resources/TestMethodDebugInformation/SimpleMathMethods.cs b/src/tests/ilasm/PortablePdb/Resources/TestMethodDebugInformation/SimpleMathMethods.cs new file mode 100644 index 000000000000..b0f01e4eeac7 --- /dev/null +++ b/src/tests/ilasm/PortablePdb/Resources/TestMethodDebugInformation/SimpleMathMethods.cs @@ -0,0 +1,18 @@ +namespace TestMethodDebugInformation +{ + public partial class SimpleMath + { + public int Pow(int n, int d) + { + int i = 0; + int j = 0; + int res = 1; + for (j = 0; j < d; j++) + { + res *= n; + i++; + } + return res; + } + } +} diff --git a/src/tests/ilasm/PortablePdb/TestFiles/TestDocuments1_unix.il b/src/tests/ilasm/PortablePdb/TestFiles/TestDocuments1_unix.il new file mode 100644 index 000000000000..43c6728d450f --- /dev/null +++ b/src/tests/ilasm/PortablePdb/TestFiles/TestDocuments1_unix.il @@ -0,0 +1,23 @@ +// 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. + +.assembly extern System.Runtime +{ +} + +.assembly TestDocuments +{ +} + +.class public auto ansi beforefieldinit TestDocumentsType + extends [System.Runtime]System.Object +{ + .method public hidebysig instance void Foo() cil managed + { + .line 1,1 : 9,10 '/tmp/non_existent_source1.cs' + nop + .line 2,2 : 9,10 '/tmp/non_existent_source2.cs' + ret + } +} \ No newline at end of file diff --git a/src/tests/ilasm/PortablePdb/TestFiles/TestDocuments1_win.il b/src/tests/ilasm/PortablePdb/TestFiles/TestDocuments1_win.il new file mode 100644 index 000000000000..329d660d7e01 --- /dev/null +++ b/src/tests/ilasm/PortablePdb/TestFiles/TestDocuments1_win.il @@ -0,0 +1,23 @@ +// 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. + +.assembly extern System.Runtime +{ +} + +.assembly TestDocuments +{ +} + +.class public auto ansi beforefieldinit TestDocumentsType + extends [System.Runtime]System.Object +{ + .method public hidebysig instance void Foo() cil managed + { + .line 1,1 : 9,10 'C:\\tmp\\non_existent_source1.cs' + nop + .line 2,2 : 9,10 'C:\\tmp\\non_existent_source2.cs' + ret + } +} diff --git a/src/tests/ilasm/PortablePdb/TestFiles/TestLocalScopes1.il b/src/tests/ilasm/PortablePdb/TestFiles/TestLocalScopes1.il new file mode 100644 index 000000000000..7e378d901681 --- /dev/null +++ b/src/tests/ilasm/PortablePdb/TestFiles/TestLocalScopes1.il @@ -0,0 +1,49 @@ +// 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. + +.assembly extern System.Runtime +{ +} + +.assembly TestLocalScopes1 +{ +} + +.class public abstract auto ansi sealed beforefieldinit TestLocalScopesType + extends [System.Runtime]System.Object +{ + .method public hidebysig static int32 Foo(int32 a) cil managed + { + .locals init ([0] int32 LOCAL_0) + IL_0000: nop + IL_0001: ldloc.0 + IL_0002: ldarg.0 + IL_0003: add + IL_0004: stloc.0 + IL_0005: nop + + { + .locals ([1] int32 LOCAL_1, [2] int32 LOCAL_2) + IL_0006: ldloc.0 + IL_0007: ldarg.0 + IL_0008: add + IL_0009: stloc.1 + IL_000a: nop + IL_000b: ldc.i4.s 42 + IL_000d: stloc.2 + IL_000e: nop + IL_000f: ldloc.1 + IL_0010: ldloc.2 + IL_0011: add + IL_0012: stloc.0 + IL_0013: nop + } + + IL_0014: nop + IL_0015: ldloc.0 + IL_0016: ldarg.0 + IL_0017: add + IL_0018: ret + } +} diff --git a/src/tests/ilasm/PortablePdb/TestFiles/TestLocalScopes2.il b/src/tests/ilasm/PortablePdb/TestFiles/TestLocalScopes2.il new file mode 100644 index 000000000000..53ab9333485d --- /dev/null +++ b/src/tests/ilasm/PortablePdb/TestFiles/TestLocalScopes2.il @@ -0,0 +1,59 @@ +// 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. + +.assembly extern System.Runtime +{ +} + +.assembly TestLocalScopes2 +{ +} + +.class public abstract auto ansi sealed beforefieldinit TestLocalScopesType + extends [System.Runtime]System.Object +{ + .method public hidebysig static int32 Foo(int32 a) cil managed + { + .locals init ([0] int32 LOCAL_0) + IL_0000: nop + IL_0001: ldloc.0 + IL_0002: ldarg.0 + IL_0003: add + IL_0004: stloc.0 + IL_0005: nop + + { + .locals ([1] int32 LOCAL_1, [2] int32 LOCAL_2) + IL_0006: ldloc.0 + IL_0007: ldarg.0 + IL_0008: add + IL_0009: stloc.1 + IL_000a: nop + IL_000b: ldc.i4.s 42 + IL_000d: stloc.2 + IL_000e: nop + IL_000f: ldloc.1 + IL_0010: ldloc.2 + IL_0011: add + IL_0012: stloc.0 + IL_0013: nop + } + + IL_0014: nop + + { + IL_0015: nop + IL_0016: ldc.i4.s 7 + IL_0018: ldloc.0 + IL_0019: add + IL_001a: stloc.0 + } + + IL_001b: nop + IL_001c: ldloc.0 + IL_001d: ldarg.0 + IL_001e: add + IL_001f: ret + } +} diff --git a/src/tests/ilasm/PortablePdb/TestFiles/TestLocalScopes3.il b/src/tests/ilasm/PortablePdb/TestFiles/TestLocalScopes3.il new file mode 100644 index 000000000000..a25d72419171 --- /dev/null +++ b/src/tests/ilasm/PortablePdb/TestFiles/TestLocalScopes3.il @@ -0,0 +1,45 @@ +// 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. + +.assembly extern System.Runtime +{ +} + +.assembly TestLocalScopes3 +{ +} + +.class public abstract auto ansi sealed beforefieldinit TestLocalScopesType + extends [System.Runtime]System.Object +{ + .field public static int32 GLOBAL_1 + + .method public hidebysig static void Foo() cil managed + { + IL_0000: nop + IL_0001: ldc.i4.s 10 + IL_0003: stsfld int32 TestLocalScopesType::GLOBAL_1 + IL_0008: nop + + { + .locals init([0] int32 LOCAL_0, [1] int32 LOCAL_1) + IL_0009: nop + IL_000a: ldc.i4.s 2 + IL_000c: stloc.0 + IL_000d: ldsfld int32 TestLocalScopesType::GLOBAL_1 + IL_0012: ldloc.1 + IL_0013: add + IL_0014: stloc.1 + IL_0015: nop + IL_0016: ldloc.0 + IL_0017: ldloc.1 + IL_0018: add + IL_0019: stsfld int32 TestLocalScopesType::GLOBAL_1 + IL_001e: nop + } + + IL_001f: nop + IL_0020: ret + } +} diff --git a/src/tests/ilasm/PortablePdb/TestFiles/TestLocalScopes4.il b/src/tests/ilasm/PortablePdb/TestFiles/TestLocalScopes4.il new file mode 100644 index 000000000000..23e0a9d17d94 --- /dev/null +++ b/src/tests/ilasm/PortablePdb/TestFiles/TestLocalScopes4.il @@ -0,0 +1,74 @@ +// 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. + +.assembly extern System.Runtime +{ +} + +.assembly TestLocalScopes4 +{ +} + +.class public abstract auto ansi sealed beforefieldinit TestLocalScopesType + extends [System.Runtime]System.Object +{ + .method public hidebysig static int32 Foo(int32 a) cil managed + { + .locals init ([0] int32 LOCAL_0) + IL_0000: nop + IL_0001: ldloc.0 + IL_0002: ldarg.0 + IL_0003: add + IL_0004: stloc.0 + IL_0005: nop + + { + .locals ([1] int32 LOCAL_11, [3] int32 LOCAL_12) + IL_0006: ldloc.0 + IL_0007: ldarg.0 + IL_0008: add + IL_0009: stloc.1 + IL_000a: nop + + { + .locals ([2] int32 LOCAL_2) + IL_000b: ldloc.1 + IL_000c: ldarg.0 + IL_000d: add + IL_000e: stloc.2 + IL_000f: nop + + { + .locals ([3] int32 LOCAL_3) + IL_0010: ldloc.2 + IL_0011: ldarg.0 + IL_0012: add + IL_0013: stloc.3 + IL_0014: nop + } } + + IL_0015: nop + + { + .locals ([4] int32 LOCAL_4) + IL_0016: ldloc.3 + IL_0017: ldarg.0 + IL_0018: add + IL_0019: stloc.0 + IL_001a: nop + } + + IL_001b: nop + IL_001c: ldloc.0 + IL_001d: stloc.0 + IL_001e: nop + } + + IL_001f: nop + IL_0020: ldloc.0 + IL_0021: ldarg.0 + IL_0022: add + IL_0023: ret + } +} diff --git a/src/tests/ilasm/PortablePdb/TestFiles/TestMethodDebugInformation_unix.il b/src/tests/ilasm/PortablePdb/TestFiles/TestMethodDebugInformation_unix.il new file mode 100644 index 000000000000..64616b1b66dd --- /dev/null +++ b/src/tests/ilasm/PortablePdb/TestFiles/TestMethodDebugInformation_unix.il @@ -0,0 +1,146 @@ + +// Microsoft (R) .NET Framework IL Disassembler. Version 4.8.3928.0 +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +// Metadata version: v4.0.30319 +.assembly extern System.Runtime +{ + .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: + .ver 4:2:2:0 +} +.assembly TestMethodDebugInformation +{ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx + 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows. + + // --- The following custom attribute is added automatically, do not uncomment ------- + // .custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 07 01 00 00 00 00 ) + + .custom instance void [System.Runtime]System.Runtime.Versioning.TargetFrameworkAttribute::.ctor(string) = ( 01 00 18 2E 4E 45 54 43 6F 72 65 41 70 70 2C 56 // ....NETCoreApp,V + 65 72 73 69 6F 6E 3D 76 33 2E 31 01 00 54 0E 14 // ersion=v3.1..T.. + 46 72 61 6D 65 77 6F 72 6B 44 69 73 70 6C 61 79 // FrameworkDisplay + 4E 61 6D 65 00 ) // Name. + .custom instance void [System.Runtime]System.Reflection.AssemblyCompanyAttribute::.ctor(string) = ( 01 00 1A 54 65 73 74 4D 65 74 68 6F 64 44 65 62 // ...TestMethodDeb + 75 67 49 6E 66 6F 72 6D 61 74 69 6F 6E 00 00 ) // ugInformation.. + .custom instance void [System.Runtime]System.Reflection.AssemblyConfigurationAttribute::.ctor(string) = ( 01 00 05 44 65 62 75 67 00 00 ) // ...Debug.. + .custom instance void [System.Runtime]System.Reflection.AssemblyFileVersionAttribute::.ctor(string) = ( 01 00 07 31 2E 30 2E 30 2E 30 00 00 ) // ...1.0.0.0.. + .custom instance void [System.Runtime]System.Reflection.AssemblyInformationalVersionAttribute::.ctor(string) = ( 01 00 05 31 2E 30 2E 30 00 00 ) // ...1.0.0.. + .custom instance void [System.Runtime]System.Reflection.AssemblyProductAttribute::.ctor(string) = ( 01 00 1A 54 65 73 74 4D 65 74 68 6F 64 44 65 62 // ...TestMethodDeb + 75 67 49 6E 66 6F 72 6D 61 74 69 6F 6E 00 00 ) // ugInformation.. + .custom instance void [System.Runtime]System.Reflection.AssemblyTitleAttribute::.ctor(string) = ( 01 00 1A 54 65 73 74 4D 65 74 68 6F 64 44 65 62 // ...TestMethodDeb + 75 67 49 6E 66 6F 72 6D 61 74 69 6F 6E 00 00 ) // ugInformation.. + .hash algorithm 0x00008004 + .ver 1:0:0:0 +} +.module TestMethodDebugInformation.dll +// MVID: {D57673DB-1B1D-4407-A641-E2495207E45F} +.imagebase 0x0000000180000000 +.file alignment 0x00000200 +.stackreserve 0x0000000000400000 +.subsystem 0x0003 // WINDOWS_CUI +.corflags 0x00000001 // ILONLY +// Image base: 0x000002083D3E0000 + + +// =============== CLASS MEMBERS DECLARATION =================== + +.class public auto ansi beforefieldinit TestMethodDebugInformation.SimpleMath + extends [System.Runtime]System.Object +{ + .field private int32 _dummy + .method public hidebysig specialname rtspecialname + instance void .ctor(int32 dummy) cil managed + { + // Code size 16 (0x10) + .maxstack 8 + .language '{3F5162F8-07C6-11D3-9053-00C04FA302A1}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' + .line 6,6 : 9,37 '/tmp/TestMethodDebugInformation/SimpleMath.cs' + IL_0000: ldarg.0 + IL_0001: call instance void [System.Runtime]System.Object::.ctor() + IL_0006: nop + .line 7,7 : 9,10 '' + IL_0007: nop + .line 8,8 : 13,28 '' + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: stfld int32 TestMethodDebugInformation.SimpleMath::_dummy + .line 9,9 : 9,10 '' + IL_000f: ret + } // end of method SimpleMath::.ctor + + .method public hidebysig instance int32 + Pow(int32 n, + int32 d) cil managed + { + // Code size 41 (0x29) + .maxstack 2 + .locals init ([0] int32 i, + [1] int32 j, + [2] int32 res, + [3] bool V_3, + [4] int32 V_4) + .line 6,6 : 9,10 '/tmp/TestMethodDebugInformation/SimpleMathMethods.cs' + IL_0000: nop + .line 7,7 : 13,23 '' + IL_0001: ldc.i4.0 + IL_0002: stloc.0 + .line 8,8 : 13,23 '' + IL_0003: ldc.i4.0 + IL_0004: stloc.1 + .line 9,9 : 13,25 '' + IL_0005: ldc.i4.1 + IL_0006: stloc.2 + .line 10,10 : 18,23 '' + IL_0007: ldc.i4.0 + IL_0008: stloc.1 + .line 16707566,16707566 : 0,0 '' + IL_0009: br.s IL_0019 + + .line 11,11 : 13,14 '' + IL_000b: nop + .line 12,12 : 17,26 '' + IL_000c: ldloc.2 + IL_000d: ldarg.1 + IL_000e: mul + IL_000f: stloc.2 + .line 13,13 : 17,21 '' + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + .line 14,14 : 13,14 '' + IL_0014: nop + .line 10,10 : 32,35 '' + IL_0015: ldloc.1 + IL_0016: ldc.i4.1 + IL_0017: add + IL_0018: stloc.1 + .line 10,10 : 25,30 '' + IL_0019: ldloc.1 + IL_001a: ldarg.2 + IL_001b: clt + IL_001d: stloc.3 + .line 16707566,16707566 : 0,0 '' + IL_001e: ldloc.3 + IL_001f: brtrue.s IL_000b + + .line 15,15 : 13,24 '' + IL_0021: ldloc.2 + IL_0022: stloc.s V_4 + IL_0024: br.s IL_0026 + + .line 16,16 : 9,10 '' + IL_0026: ldloc.s V_4 + IL_0028: ret + } // end of method SimpleMath::Pow + +} // end of class TestMethodDebugInformation.SimpleMath + + +// ============================================================= + +// *********** DISASSEMBLY COMPLETE *********************** +// WARNING: Created Win32 resource file .\..\..\TestFiles\TestMethodDebugInformation_win.res diff --git a/src/tests/ilasm/PortablePdb/TestFiles/TestMethodDebugInformation_win.il b/src/tests/ilasm/PortablePdb/TestFiles/TestMethodDebugInformation_win.il new file mode 100644 index 000000000000..049c311461de --- /dev/null +++ b/src/tests/ilasm/PortablePdb/TestFiles/TestMethodDebugInformation_win.il @@ -0,0 +1,146 @@ + +// Microsoft (R) .NET Framework IL Disassembler. Version 4.8.3928.0 +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +// Metadata version: v4.0.30319 +.assembly extern System.Runtime +{ + .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: + .ver 4:2:2:0 +} +.assembly TestMethodDebugInformation +{ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .custom instance void [System.Runtime]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx + 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows. + + // --- The following custom attribute is added automatically, do not uncomment ------- + // .custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 07 01 00 00 00 00 ) + + .custom instance void [System.Runtime]System.Runtime.Versioning.TargetFrameworkAttribute::.ctor(string) = ( 01 00 18 2E 4E 45 54 43 6F 72 65 41 70 70 2C 56 // ....NETCoreApp,V + 65 72 73 69 6F 6E 3D 76 33 2E 31 01 00 54 0E 14 // ersion=v3.1..T.. + 46 72 61 6D 65 77 6F 72 6B 44 69 73 70 6C 61 79 // FrameworkDisplay + 4E 61 6D 65 00 ) // Name. + .custom instance void [System.Runtime]System.Reflection.AssemblyCompanyAttribute::.ctor(string) = ( 01 00 1A 54 65 73 74 4D 65 74 68 6F 64 44 65 62 // ...TestMethodDeb + 75 67 49 6E 66 6F 72 6D 61 74 69 6F 6E 00 00 ) // ugInformation.. + .custom instance void [System.Runtime]System.Reflection.AssemblyConfigurationAttribute::.ctor(string) = ( 01 00 05 44 65 62 75 67 00 00 ) // ...Debug.. + .custom instance void [System.Runtime]System.Reflection.AssemblyFileVersionAttribute::.ctor(string) = ( 01 00 07 31 2E 30 2E 30 2E 30 00 00 ) // ...1.0.0.0.. + .custom instance void [System.Runtime]System.Reflection.AssemblyInformationalVersionAttribute::.ctor(string) = ( 01 00 05 31 2E 30 2E 30 00 00 ) // ...1.0.0.. + .custom instance void [System.Runtime]System.Reflection.AssemblyProductAttribute::.ctor(string) = ( 01 00 1A 54 65 73 74 4D 65 74 68 6F 64 44 65 62 // ...TestMethodDeb + 75 67 49 6E 66 6F 72 6D 61 74 69 6F 6E 00 00 ) // ugInformation.. + .custom instance void [System.Runtime]System.Reflection.AssemblyTitleAttribute::.ctor(string) = ( 01 00 1A 54 65 73 74 4D 65 74 68 6F 64 44 65 62 // ...TestMethodDeb + 75 67 49 6E 66 6F 72 6D 61 74 69 6F 6E 00 00 ) // ugInformation.. + .hash algorithm 0x00008004 + .ver 1:0:0:0 +} +.module TestMethodDebugInformation.dll +// MVID: {D57673DB-1B1D-4407-A641-E2495207E45F} +.imagebase 0x0000000180000000 +.file alignment 0x00000200 +.stackreserve 0x0000000000400000 +.subsystem 0x0003 // WINDOWS_CUI +.corflags 0x00000001 // ILONLY +// Image base: 0x000002083D3E0000 + + +// =============== CLASS MEMBERS DECLARATION =================== + +.class public auto ansi beforefieldinit TestMethodDebugInformation.SimpleMath + extends [System.Runtime]System.Object +{ + .field private int32 _dummy + .method public hidebysig specialname rtspecialname + instance void .ctor(int32 dummy) cil managed + { + // Code size 16 (0x10) + .maxstack 8 + .language '{3F5162F8-07C6-11D3-9053-00C04FA302A1}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' + .line 6,6 : 9,37 'C:\\tmp\\TestMethodDebugInformation\\SimpleMath.cs' + IL_0000: ldarg.0 + IL_0001: call instance void [System.Runtime]System.Object::.ctor() + IL_0006: nop + .line 7,7 : 9,10 '' + IL_0007: nop + .line 8,8 : 13,28 '' + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: stfld int32 TestMethodDebugInformation.SimpleMath::_dummy + .line 9,9 : 9,10 '' + IL_000f: ret + } // end of method SimpleMath::.ctor + + .method public hidebysig instance int32 + Pow(int32 n, + int32 d) cil managed + { + // Code size 41 (0x29) + .maxstack 2 + .locals init ([0] int32 i, + [1] int32 j, + [2] int32 res, + [3] bool V_3, + [4] int32 V_4) + .line 6,6 : 9,10 'C:\\tmp\\TestMethodDebugInformation\\SimpleMathMethods.cs' + IL_0000: nop + .line 7,7 : 13,23 '' + IL_0001: ldc.i4.0 + IL_0002: stloc.0 + .line 8,8 : 13,23 '' + IL_0003: ldc.i4.0 + IL_0004: stloc.1 + .line 9,9 : 13,25 '' + IL_0005: ldc.i4.1 + IL_0006: stloc.2 + .line 10,10 : 18,23 '' + IL_0007: ldc.i4.0 + IL_0008: stloc.1 + .line 16707566,16707566 : 0,0 '' + IL_0009: br.s IL_0019 + + .line 11,11 : 13,14 '' + IL_000b: nop + .line 12,12 : 17,26 '' + IL_000c: ldloc.2 + IL_000d: ldarg.1 + IL_000e: mul + IL_000f: stloc.2 + .line 13,13 : 17,21 '' + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + .line 14,14 : 13,14 '' + IL_0014: nop + .line 10,10 : 32,35 '' + IL_0015: ldloc.1 + IL_0016: ldc.i4.1 + IL_0017: add + IL_0018: stloc.1 + .line 10,10 : 25,30 '' + IL_0019: ldloc.1 + IL_001a: ldarg.2 + IL_001b: clt + IL_001d: stloc.3 + .line 16707566,16707566 : 0,0 '' + IL_001e: ldloc.3 + IL_001f: brtrue.s IL_000b + + .line 15,15 : 13,24 '' + IL_0021: ldloc.2 + IL_0022: stloc.s V_4 + IL_0024: br.s IL_0026 + + .line 16,16 : 9,10 '' + IL_0026: ldloc.s V_4 + IL_0028: ret + } // end of method SimpleMath::Pow + +} // end of class TestMethodDebugInformation.SimpleMath + + +// ============================================================= + +// *********** DISASSEMBLY COMPLETE *********************** +// WARNING: Created Win32 resource file .\..\..\TestFiles\TestMethodDebugInformation_win.res diff --git a/src/tests/ilasm/PortablePdb/TestFiles/TestPdbDebugDirectory1.il b/src/tests/ilasm/PortablePdb/TestFiles/TestPdbDebugDirectory1.il new file mode 100644 index 000000000000..b6ef6ed055f9 --- /dev/null +++ b/src/tests/ilasm/PortablePdb/TestFiles/TestPdbDebugDirectory1.il @@ -0,0 +1,21 @@ +// 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. + +.assembly extern System.Runtime +{ +} + +.assembly TestPdbDebugDirectory1 +{ +} + +.class public auto ansi beforefieldinit TestPdbDebugDirectoryType + extends [System.Runtime]System.Object +{ + .method public hidebysig instance int32 Foo() cil managed + { + nop + ret + } +} diff --git a/src/tests/ilasm/PortablePdb/TestFiles/TestPdbDebugDirectory2.il b/src/tests/ilasm/PortablePdb/TestFiles/TestPdbDebugDirectory2.il new file mode 100644 index 000000000000..01ec26800def --- /dev/null +++ b/src/tests/ilasm/PortablePdb/TestFiles/TestPdbDebugDirectory2.il @@ -0,0 +1,37 @@ +// 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. + +.assembly extern System.Runtime +{ +} + +.assembly TestPdbDebugDirectory2 +{ +} + +.class private auto ansi beforefieldinit TestPdbDebugDirectoryType + extends [System.Runtime]System.Object +{ + .method private hidebysig static void Main(string[] args) cil managed + { + .entrypoint + .maxstack 8 + IL_0000: nop + IL_0001: ldstr "hello" + IL_0006: call void [System.Console]System.Console::WriteLine(string) + IL_000b: nop + IL_000c: ret + } + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [System.Runtime]System.Object::.ctor() + IL_0006: nop + IL_0007: ret + } + +} diff --git a/src/tests/ilverify/ILVerification.Tests.csproj b/src/tests/ilverify/ILVerification.Tests.csproj deleted file mode 100644 index 5eaea1b89ea4..000000000000 --- a/src/tests/ilverify/ILVerification.Tests.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - Exe - $(BaseOutputPathWithConfig)ilverify\ - 1 - - true - true - - - - - - - - - - - - - - - - - - - false - Content - - - diff --git a/src/tests/tracing/eventpipe/buffersize/buffersize.csproj b/src/tests/tracing/eventpipe/buffersize/buffersize.csproj index 6d5ae5ccf18d..4ace0a09048d 100644 --- a/src/tests/tracing/eventpipe/buffersize/buffersize.csproj +++ b/src/tests/tracing/eventpipe/buffersize/buffersize.csproj @@ -7,6 +7,7 @@ 0 true true + true diff --git a/src/tests/tracing/eventpipe/common/IpcTraceTest.cs b/src/tests/tracing/eventpipe/common/IpcTraceTest.cs index 1b4a73737155..72f6ec7d4313 100644 --- a/src/tests/tracing/eventpipe/common/IpcTraceTest.cs +++ b/src/tests/tracing/eventpipe/common/IpcTraceTest.cs @@ -378,22 +378,6 @@ static public bool EnsureCleanEnvironment() } } } - - // validate we cleaned everything up - (currentIpcs, currentPids) = getPidsAndSockets(); - - // if there are pipes for processses that don't exist anymore, - // or a process has multiple pipes, we failed. - foreach (IGrouping group in currentIpcs) - { - if (!currentPids.Contains(group.Key) || group.Count() > 1) - { - Logger.logger.Log("Environment is dirty."); - return false; - } - } - Logger.logger.Log("Environment is clean."); - } return true; diff --git a/src/coreclr/tests/src/tracing/eventpipe/gcdump/gcdump.cs b/src/tests/tracing/eventpipe/gcdump/gcdump.cs similarity index 100% rename from src/coreclr/tests/src/tracing/eventpipe/gcdump/gcdump.cs rename to src/tests/tracing/eventpipe/gcdump/gcdump.cs diff --git a/src/coreclr/tests/src/tracing/eventpipe/gcdump/gcdump.csproj b/src/tests/tracing/eventpipe/gcdump/gcdump.csproj similarity index 100% rename from src/coreclr/tests/src/tracing/eventpipe/gcdump/gcdump.csproj rename to src/tests/tracing/eventpipe/gcdump/gcdump.csproj diff --git a/tools-local/tasks/mobile.tasks/WasmAppBuilder/PInvokeTableGenerator.cs b/tools-local/tasks/mobile.tasks/WasmAppBuilder/PInvokeTableGenerator.cs index 7523894f9618..e37f83ec12f1 100644 --- a/tools-local/tasks/mobile.tasks/WasmAppBuilder/PInvokeTableGenerator.cs +++ b/tools-local/tasks/mobile.tasks/WasmAppBuilder/PInvokeTableGenerator.cs @@ -88,21 +88,34 @@ private void EmitPInvokeTable(StreamWriter w, Dictionary modules w.WriteLine("// GENERATED FILE, DO NOT MODIFY"); w.WriteLine(); - foreach (var pinvoke in pinvokes) + var decls = new HashSet(); + foreach (var pinvoke in pinvokes.OrderBy(l => l.EntryPoint)) { - if (modules.ContainsKey(pinvoke.Module)) - w.WriteLine(GenPInvokeDecl(pinvoke)); + if (modules.ContainsKey(pinvoke.Module)) { + var decl = GenPInvokeDecl(pinvoke); + if (decls.Contains(decl)) + continue; + + w.WriteLine(decl); + decls.Add(decl); + } } foreach (var module in modules.Keys) { string symbol = module.Replace(".", "_") + "_imports"; w.WriteLine("static PinvokeImport " + symbol + " [] = {"); - foreach (var pinvoke in pinvokes) - { - if (pinvoke.Module == module) - w.WriteLine("{\"" + pinvoke.EntryPoint + "\", " + pinvoke.EntryPoint + "},"); + + var assemblies_pinvokes = pinvokes. + Where(l => l.Module == module). + OrderBy(l => l.EntryPoint). + GroupBy(d => d.EntryPoint). + Select (l => "{\"" + l.Key + "\", " + l.Key + "}, // " + string.Join (", ", l.Select(c => c.Method.DeclaringType!.Module!.Assembly!.GetName ()!.Name!).Distinct())); + + foreach (var pinvoke in assemblies_pinvokes) { + w.WriteLine (pinvoke); } + w.WriteLine("{NULL, NULL}"); w.WriteLine("};"); } @@ -172,10 +185,11 @@ void EmitNativeToInterp(StreamWriter w, List callbacks) w.WriteLine("InterpFtnDesc wasm_native_to_interp_ftndescs[" + callbacks.Count + "];"); foreach (var cb in callbacks) { - var method = cb.Method; + MethodInfo method = cb.Method; + bool isVoid = method.ReturnType.FullName == "System.Void"; - if (method.ReturnType != typeof(void) && !IsBlittable(method.ReturnType)) - Error("The return type of pinvoke callback method '" + method + "' needs to be blittable."); + if (!isVoid && !IsBlittable(method.ReturnType)) + Error($"The return type '{method.ReturnType.FullName}' of pinvoke callback method '{method}' needs to be blittable."); foreach (var p in method.GetParameters()) { if (!IsBlittable(p.ParameterType)) Error("Parameter types of pinvoke callback method '" + method + "' needs to be blittable."); diff --git a/tools-local/tasks/mobile.tasks/WasmAppBuilder/WasmAppBuilder.cs b/tools-local/tasks/mobile.tasks/WasmAppBuilder/WasmAppBuilder.cs index 0b05c5502c0a..9a5d51cea5cc 100644 --- a/tools-local/tasks/mobile.tasks/WasmAppBuilder/WasmAppBuilder.cs +++ b/tools-local/tasks/mobile.tasks/WasmAppBuilder/WasmAppBuilder.cs @@ -29,6 +29,8 @@ public class WasmAppBuilder : Task public ITaskItem[]? AssemblySearchPaths { get; set; } public ITaskItem[]? ExtraAssemblies { get; set; } public ITaskItem[]? FilesToIncludeInFileSystem { get; set; } + public ITaskItem[]? RemoteSources { get; set; } + Dictionary? _assemblies; Resolver? _resolver; @@ -70,81 +72,66 @@ public override bool Execute () Directory.CreateDirectory(Path.Join(AppDir, "managed")); foreach (var assembly in _assemblies!.Values) File.Copy(assembly.Location, Path.Join(AppDir, "managed", Path.GetFileName(assembly.Location)), true); - foreach (var f in new string[] { "dotnet.wasm", "dotnet.js", "dotnet.timezones.blat" }) + foreach (var f in new string[] { "dotnet.wasm", "dotnet.js", "dotnet.timezones.blat", "icudt.dat" }) File.Copy(Path.Join (MicrosoftNetCoreAppRuntimePackDir, "native", f), Path.Join(AppDir, f), true); File.Copy(MainJS!, Path.Join(AppDir, "runtime.js"), true); - var filesToMap = new Dictionary>(); - if (FilesToIncludeInFileSystem != null) + using (var sw = File.CreateText(Path.Join(AppDir, "mono-config.js"))) { - string supportFilesDir = Path.Join(AppDir, "supportFiles"); - Directory.CreateDirectory(supportFilesDir); + sw.WriteLine("config = {"); + sw.WriteLine("\tassembly_root: \"managed\","); + sw.WriteLine("\tenable_debugging: 0,"); + sw.WriteLine("\tassets: ["); - foreach (var item in FilesToIncludeInFileSystem) + foreach (var assembly in _assemblies.Values) + sw.WriteLine($"\t\t{{ behavior: \"assembly\", name: \"{Path.GetFileName(assembly.Location)}\" }},"); + + if (FilesToIncludeInFileSystem != null) { - string? targetPath = item.GetMetadata("TargetPath"); - if (string.IsNullOrEmpty(targetPath)) + string supportFilesDir = Path.Join(AppDir, "supportFiles"); + Directory.CreateDirectory(supportFilesDir); + + var i = 0; + foreach (var item in FilesToIncludeInFileSystem) { - targetPath = Path.GetFileName(item.ItemSpec); - } + string? targetPath = item.GetMetadata("TargetPath"); + if (string.IsNullOrEmpty(targetPath)) + { + targetPath = Path.GetFileName(item.ItemSpec); + } - // We normalize paths from `\` to `/` as MSBuild items could use `\`. - targetPath = targetPath.Replace('\\', '/'); + // We normalize paths from `\` to `/` as MSBuild items could use `\`. + targetPath = targetPath.Replace('\\', '/'); - string? directory = Path.GetDirectoryName(targetPath); + var generatedFileName = $"{i++}_{Path.GetFileName(item.ItemSpec)}"; - if (!string.IsNullOrEmpty(directory)) - { - Directory.CreateDirectory(Path.Join(supportFilesDir, directory)); - } - else - { - directory = "/"; - } + File.Copy(item.ItemSpec, Path.Join(supportFilesDir, generatedFileName), true); - File.Copy(item.ItemSpec, Path.Join(supportFilesDir, targetPath), true); + var actualItemName = "supportFiles/" + generatedFileName; - if (filesToMap.TryGetValue(directory, out List? files)) - { - files.Add(Path.GetFileName(targetPath)); - } - else - { - files = new List(); - files.Add(Path.GetFileName(targetPath)); - filesToMap[directory] = files; + sw.WriteLine("\t\t{"); + sw.WriteLine("\t\t\tbehavior: \"vfs\","); + sw.WriteLine($"\t\t\tname: \"{actualItemName}\","); + sw.WriteLine($"\t\t\tvirtual_path: \"{targetPath}\","); + sw.WriteLine("\t\t},"); } } - } - using (var sw = File.CreateText(Path.Join(AppDir, "mono-config.js"))) - { - sw.WriteLine("config = {"); - sw.WriteLine("\tvfs_prefix: \"managed\","); - sw.WriteLine("\tdeploy_prefix: \"managed\","); - sw.WriteLine("\tenable_debugging: 0,"); - sw.WriteLine("\tassembly_list: ["); - foreach (var assembly in _assemblies.Values) - { - sw.Write("\t\t\"" + Path.GetFileName(assembly.Location) + "\""); - sw.WriteLine(","); - } + var enableRemote = (RemoteSources != null) && (RemoteSources!.Length > 0); + var sEnableRemote = enableRemote ? "true" : "false"; + + sw.WriteLine($"\t\t{{ behavior: \"icu\", name: \"icudt.dat\", load_remote: {sEnableRemote} }},"); + sw.WriteLine ("\t],"); - sw.WriteLine("\tfiles_to_map: ["); - foreach (KeyValuePair> keyValuePair in filesToMap) - { - sw.WriteLine("\t{"); - sw.WriteLine($"\t\tdirectory: \"{keyValuePair.Key}\","); - sw.WriteLine("\t\tfiles: ["); - foreach (string file in keyValuePair.Value) - { - sw.WriteLine($"\t\t\t\"{file}\","); - } - sw.WriteLine("\t\t],"); - sw.WriteLine("\t},"); + + if (enableRemote) { + sw.WriteLine("\tremote_sources: ["); + foreach (var source in RemoteSources!) + sw.WriteLine("\t\t\"" + source.ItemSpec + "\", "); + sw.WriteLine ("\t],"); } - sw.WriteLine ("\t],"); - sw.WriteLine ("}"); + + sw.WriteLine ("};"); } using (var sw = File.CreateText(Path.Join(AppDir, "run-v8.sh")))